behat

Call to a member function getSession() on a non-object in vendor/behat/mink-extension/src/Behat/MinkExtension/Context/RawMinkContext.php on line 81

匆匆过客 提交于 2019-11-29 18:05:42
I get this error when trying to run my behat tests from the command line. The full output of the error looks like this: $ behat Feature: View a list of current custom tariffs In order to provide custom call pricing to customers As a user of the Voxbeam Admin site I expect to be able to correctly administrate a users custom tariffs @sahi Scenario: Listing existing custom tariffs # features/custom_tariff_admin.feature:7 PHP Fatal error: Call to a member function getSession() on a non-object in /Users/stuart/bin/vendor/behat/mink-extension/src/Behat/MinkExtension/Context/RawMinkContext.php on

Mink/Goutte How to check checkbox without attribute in Goutte?

冷暖自知 提交于 2019-11-29 17:24:30
I apologize in advance but I am very beginner. I try to check checkbox without id or name. <span class="ps-align-left"> <input type="checkbox" value="43899" style="background-color: rgb(252, 252, 252);"/> 43899 </span> I figure out how to do it with selenium2driver. So I use function "find" like this: public function checkOption() { $this->getSession()->getPage()->find('css', '.ps-align-left>input')->check(); } And it works fine but when I try to run test with headless browser Goutte I get error: /usr/bin/php5.6 /tmp/ide-behat.php --format PhpStormBehatFormatter /home/grzegorz/PhpstormProjects

Behat + selenium 2 wait for page to load

我只是一个虾纸丫 提交于 2019-11-28 13:47:19
Is there a way to reliably wait for pages to load when using Behat with Mink using the Selenium2Driver? I've inherited some legacy tests that wait like this: Background: Given I am on "http://test.example.com" And I wait for "20000" Given I click on the element with css selector ".button1" And I wait for "30000" Given I click on the element with css selector ".button2" And I wait for "30000" Given I click on the element with css selector ".button1" And I wait for "10000" i.e. just this single test takes 1minute 30seconds. What I'd like to do is have a generic way of waiting for the previous

How to run tests in behat on firefox 48.0 using selenium stand alone server?

随声附和 提交于 2019-11-28 01:37:06
Previously I worked with Behat 3 and Stand Alone Server 2.45 and everything worked properly. I use PhpStorm as my IDE. Later, after installing the update of Firefox (ver. 48.0) my tests stop working. I also try to run tests with Selenium Standalone Server ver. 3.0.0-beta3 but Firefox browser not open. Is there any way to run tests under browser FF 48.0? Maybe someone would like to share information about the working configuration of Behat, FF48 and Stand Alone Server? Starting the selenium server standalone with chrome driver command, for latest selenium (3.0+) java -Dwebdriver.chrome.driver

How to make Behat wait for an AJAX call?

隐身守侯 提交于 2019-11-27 13:14:38
问题 Scenario: Modify and save an incomplete change to a Campaign Given I click on the Campaign section folder And I press Save in the selected Campaign Then I should see an error balloon informing the changes cannot be saved Point is that this 'error balloon' in the final step is a ajax call which will then bring a green or red balloon according to the success of the operation. Currently what I do is after 'And I press Save...' I will do a sleep(3) to give it time for this balloon to show up.