behat

I'm trying to configure behat and seeing an error - failed to open stream: No such file or directory in /usr/bin/behat

∥☆過路亽.° 提交于 2019-12-11 01:36:29
问题 PHP Warning: require_once(behat/autoload.php): failed to open stream: No such file or directory in /usr/bin/behat on line 23 PHP Fatal error: require_once(): Failed opening required 'behat/autoload.php' (include_path='.:/usr/bin/pear:/usr/lib/php:/Users/steve/perforce/') in /usr/bin/behat on line 23 Any ideas what might be causing this?? 回答1: do you have the file at one of the following places :/usr/bin/pear/behat/autoload.php OR :/usr/lib/php/behat/autoload.php: OR /Users/steve/perforce

Behat hangs when there are multiple scenarios, but works on a single one

懵懂的女人 提交于 2019-12-10 14:10:20
问题 I have Behat test cases written like so: Feature: Checkout In order to buy products As a customer I need to be able to checkout items in the cart Background: Given step 1 And step 2 @Ready Scenario: Deliver now When step 3 Then step 4 @NoneReady Scenario: Deliver later When step a Then step b And step c @AddressNotCovered Scenario: Address Not Covered When step i Then step ii If I run behat on a single tag, it works just fine: $ behat --tags=Ready Feature: Checkout In order to buy products As

Element must be user-editable in order to clear it (Behat)

左心房为你撑大大i 提交于 2019-12-10 11:27:55
问题 I am automating a website using the Behat framework, working in PHPStorm, have the latest chromedriver and selenium jar up and running: I cant seem to interact with standard Date fields across the site e.g: input type="date" ng-show="options.editEnabled" Feature file: Then I select a start date of "01012014" public function startDate ($date) { $this->getElement('startDate')->setValue($date); } Returns an error of invalid element state: Element must be user-editable in order to clear it. I

Laravel 5 testing in memory

扶醉桌前 提交于 2019-12-10 06:01:18
问题 I am writing tests via behat for my large Laravel 5 project. I have a testing copy of my MySQL database in MySQL and a seeder for that database that shares some of the seeders of other environments. All of that works as expected. However, I tried switching to using a sqlite in-memory database because it would speed up my automated tests dramatically and because I'm running "artsian migrate:refresh ---seeder=TestDatabaseSeeder at the start of every behat scenario. The problem I'm having is

build.xml to set date and time as file name

三世轮回 提交于 2019-12-10 04:26:49
问题 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>

How to assert page/tab/window title in Behat + Mink

会有一股神秘感。 提交于 2019-12-08 03:12:58
问题 I need to assert a page title for my test, which is the tab/window title using Behat+Mink I tried getWindowName() but realized that is not the function I am looking for. 回答1: You should use a regular find by css for the title tag and use getText() to get the title. The css should be: "head title" Your solution is almost ok, you need to watch for possible exception, especially fatal ones that can stop your suite if encountered. For example find() method will return an object or null , if null

Behat 3 - how to retrieve custom extension in context

走远了吗. 提交于 2019-12-07 22:40:47
问题 I need to add and later from context retrieve extra options/configuration from behat.yml file. Behat is not allowing me to add some random parameters into behat.yml file, so I created new custom extension. This extension is allowing me to pass specific config values extensions: App\Behat\DevToolsExtension: api_url: "https://api.example.com" So now behat is not complaining about new configuration in behat.yml file. Now I'm stuck. How can I retrieve this configuration from my extension in

How do I interact with a popup window with Mink, Selenium 2, and Behat?

时光怂恿深爱的人放手 提交于 2019-12-07 17:21:02
问题 I am running through an internal site with Behat and for the most part it is going really well. But the problem is that on certain parts of the site we have popup windows that come up to complete an action. In this case we hit a "Withdraw" button and a popup comes up to have you select a reason and save it. In an ideal world, and if I had actually designed this app, the site wouldn't be using any popup windows. But I am the new guy who is supposed to implement automated functional tests (and

How to assert page/tab/window title in Behat + Mink

只谈情不闲聊 提交于 2019-12-07 11:40:29
I need to assert a page title for my test, which is the tab/window title using Behat+Mink I tried getWindowName() but realized that is not the function I am looking for. You should use a regular find by css for the title tag and use getText() to get the title. The css should be: "head title" Your solution is almost ok, you need to watch for possible exception, especially fatal ones that can stop your suite if encountered. For example find() method will return an object or null , if null is returned and you are using getText() on it it will result in a fatal exception and your suite will stop.

Filling in hidden inputs with Behat

扶醉桌前 提交于 2019-12-07 05:02:13
问题 I am writing Behat tests and I need to change the value of a hidden input field <input type="hidden" id="input_id" ..... /> I need to change the value of this input field, but I keep getting Form field with id|name|label|value "input_id" not found I have been using the step $steps->And('I fill in "1" for "input_id"', $world); Is there something special which needs to be done to modify hidden input fields? 回答1: Despite the fact that user can't fill hidden fields, there are some situations when