behat

build.xml to set date and time as file name

梦想与她 提交于 2019-12-05 07:57:38
I want to set file name with date and time attached to it so I want to create file named as behat-20140913-195915.html however the example below sets the name as behat-yyyymmdd-hhiiss.html . Anyone know the solution to problem? I followed this example Note : These two don't work too: ${DSTAMP} ${TSTAMP} <?xml version="1.0" encoding="UTF-8"?> <project name="Sport" default="build-default" basedir="."> <tstamp> <format property="TODAY_MY" pattern="yyyymmdd-hhiiss" locale="en,UK" /> </tstamp> <target name="build" description="Runs everything in order ..." depends="behat-bdd" /> <target name="behat

Parameters in behat.yml

纵饮孤独 提交于 2019-12-05 06:14:41
问题 I want to make behat.yml - default: extensions: Behat\MinkExtension\Extension: base_url: 'my-url' a parameter pulled from parameters.yml... Is this possible? I made a mink_base_url parameter in parameters.yml and then added imports: - { resource: parameters.yml } to behat.yml. No matter what I do, I get this [Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException] The service "behat.mink.context.initializer" has a dependency on a non-existent parameter "mink_base_url" 回答1:

Behat “base_url” from command line

大兔子大兔子 提交于 2019-12-04 18:19:33
问题 I would like to know if it's possible to set the base_url via the command line. Example bin/behat --base_url=http://google.fr I would like to avoid creating a new profile and passing it via the command line each time I have to test a new url, for flexibility purpose. Is there any trick here to do this ? Thank you. 回答1: I found the solution by myself. Just pass the base_url in the BEHAT_PARAM environment variable. export BEHAT_PARAMS="context[parameters][base_url]=http://google.fr" Then run

Behat 3 and Laravel, testing environment not being honoured

本小妞迷上赌 提交于 2019-12-04 15:50:42
I am having a confusing problem using Behat 3 and Laravel to test an API. It seems that its not using the 'testing' environment database (in my case an sqlite memory database) ... but only some of the time. I've put a log message in the testing/database.php file to see when its loaded.. and I do see the log message when running Behat. But running the Behat features is adding rows to my development database - and some of my tests are failing for the same reason. My phpunit tests run fine and do not alter the dev database. Is there something that should be in behat.yml that I've missed? EDIT: I

BDD and Behat special characters

↘锁芯ラ 提交于 2019-12-04 14:46:30
There is a similar question @ Gherkin in Behat and input validations scenarios However is not the same. My problem is that I need to had to scenario outlines examples or to arrays Given I have a problem with data | in | this | array | | how | can | I | | add | special | characters | Most of special characters are ok, but wat about quotes and pipes? special characters example: \|!"#$%&/()=?«»'{}[]'`^~*+ºª-_.:,;<>@ł€¶ŧ←↓→øþĸħŋđðßæ|«»¢“”nµ Thanks I know that a year has passed since this was posted, but today had a similar problem and I have posted my solution here . I'm copying it here in case

Behat context per feature

不打扰是莪最后的温柔 提交于 2019-12-04 11:33:05
I am wondering if there is a way to use different context classes for different features. I would like to have one feature use MinkExtensions for browser testing and another one using and HTTP client like Guzzle for API testing - both would have similar steps with different implementation. It should be possible in Behat 3. See http://everzet.com/tagged/Behat Feature: "Multi-contextual runs with support for per-tag, per-directory and per-role context classes. This “importance of the role” mantra I was always preaching will finally become possible as each role will eventually be able to have own

for each element with behat or codeception

只愿长相守 提交于 2019-12-04 07:57:22
I want to test a website which has a dynamic menustructure. I want to loop through all menuitems and run the same series of test on every page. We're talking about 100+ pages that change reguraly. I would like to do this with either behat or codeception. Does anybody have an idea about how to do this? When using Behat with Mink, you can grab your menu items with findAll() and then iterate over it: /** * @When /^I run my test series for all menu items$/ */ public function iRunMyTestSeriesForAllMenuItems() { $result = TRUE; $this->getSession()->visit('http://www.example.com/'); $links = $this-

Struggling to install mink and behat using composer for use with symfony2

给你一囗甜甜゛ 提交于 2019-12-04 05:25:12
I'm trying to install behat and mink with symfony 2.4 using composer but I can't seem to get my composer.json file to an resolve to an installable set of packages. I installed symfony2 using the command on http://symfony.com/doc/current/book/installation.html php composer.phar create-project symfony/framework-standard-edition /path/to/webroot/Symfony 2.4.* Below is my require section of my composer.json file: "require": { "php": ">=5.3.3", "symfony/symfony": "~2.4", "doctrine/orm": "~2.2,>=2.2.3", "doctrine/doctrine-bundle": "~1.2", "twig/extensions": "~1.0", "symfony/assetic-bundle": "~2.3",

Session [url] not available and is not among the last 1000 terminated sessions. How to solve this?

纵然是瞬间 提交于 2019-12-04 04:52:34
问题 When I try to launch php behat.phar The WebDriver firefox window pops up and then my feature test fails at first step and skips the rest. I get: ... Given I am on "first.php" #FeatureContext::visit() Session [url] not available and is not among the last 1000 terminated sessions. Active sessions are[ext. key 51191ae0-8f6f-49d0-27b322967296] ... If I only use behat the test passes. This happens only when I try to use selenium. I'm using MinkExtension GivenIAmOn() premade function my behat.yml:

How to test file download in Behat

帅比萌擦擦* 提交于 2019-12-04 03:24:43
问题 There is this new Export functionality developed on this application and I'm trying to test it using Behat/Mink. The issue here is when I click on the export link, the data on the page gets exported in to a CSV and gets saved under /Downloads but I don't see any response code or anything on the page. Is there a way I can export the CSV and navigate to the /Downloads folder to verify the file? 回答1: Assuming you are using the Selenium driver you could "click" on the link and $this->getSession()