behat

Symfony2 conditional service declaration

送分小仙女□ 提交于 2021-02-07 13:37:51
问题 I'm currently trying to find a solid solution to change the dependencies of a Symfony2 service dynamically. In detail: I have a Services which uses a HTTP-Driver to communicate with an external API. class myAwesomeService { private $httpDriver; public function __construct( HTTDriverInterface $httpDriver ) { $this->httpDriver = $httpDriver; } public function transmitData($data) { $this->httpDriver->dispatch($data); } } While running the Behat tests on the CI, I'd like to use a httpMockDriver

How to customize screen resolution with saucelabs (selenium, behat3.0 mink) capabilities

断了今生、忘了曾经 提交于 2021-01-28 22:58:12
问题 This is my behat.yml file : firefox: suites: firefox: contexts: -FeatureContext extensions: Behat\MinkExtension: javascript_session: selenium2 base_url: https://example.com selenium2: wd_host: username:pwd@ondemand.saucelabs.com/wd/hub browser: firefox capabilities: {'platform':'OS X 10.10', 'browser':'firefox', 'version':'42.0', "screen-resolution":"1280x1024"} Which is giving error " [Symfony\Component\Config\Definition\Exception\InvalidConfigurationException] Unrecognized option "screen

Behat + selenium 2 wait for page to load

大兔子大兔子 提交于 2020-01-09 11:39:29
问题 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

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

和自甴很熟 提交于 2020-01-09 08:05: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? 回答1: Starting the

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

橙三吉。 提交于 2020-01-09 08:03:10
问题 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? 回答1: Starting the

Increase behat performance with drush driver

為{幸葍}努か 提交于 2020-01-06 19:29:12
问题 I am running behat inside vagrant in a drupal installation. When I use the drush driver, in order to authenticate an admin for example, the test runs extremelly slow(2'). My behat.yml is: default: suites: default: contexts: - FeatureMinkContext - FeatureContext: - "/vagrant/images/behat" - 813 - 1855 - Drupal\DrupalExtension\Context\DrupalContext - Drupal\DrupalExtension\Context\MinkContext - Drupal\DrupalExtension\Context\MessageContext - Drupal\DrupalExtension\Context\DrushContext

Behat works fine but PhantomJS fails on dropdown menu when trying to click

♀尐吖头ヾ 提交于 2020-01-06 09:08:34
问题 Gherkin below works fine with behat but when I use PhantomJS I get error on When I follow "Profile" line below: Note: The element is a dropdown menu from bootstrap so it toggles after click. Error : Exception thrown by (//html/.//a[./@href][(((./@id = 'Profile' or contains(normalize-space(string(.)), 'Profile')) or contains(./@title, 'Profile') or contains(./@rel, 'Profile')) or .//img[contains(./@alt, 'Profile')])] | .//*[./@role = 'link'][((./@id = 'Profile' or contains(./@value, 'Profile')

Behat works fine but PhantomJS fails on dropdown menu when trying to click

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-06 09:06:33
问题 Gherkin below works fine with behat but when I use PhantomJS I get error on When I follow "Profile" line below: Note: The element is a dropdown menu from bootstrap so it toggles after click. Error : Exception thrown by (//html/.//a[./@href][(((./@id = 'Profile' or contains(normalize-space(string(.)), 'Profile')) or contains(./@title, 'Profile') or contains(./@rel, 'Profile')) or .//img[contains(./@alt, 'Profile')])] | .//*[./@role = 'link'][((./@id = 'Profile' or contains(./@value, 'Profile')

How to inject Symfony param from parameters.yml into Behat 3 configuration?

柔情痞子 提交于 2020-01-04 06:46:48
问题 I need to set the base_url for Behat\MinkExtension . Here is a part of my app/config/parameters.yml : parameters: # ... behat_base_url: http://my-app.local/app_test.php # ... Here is a part of my behat.yml : frontend: gherkin: filters: tags: "@frontend" suites: javascript: mink_session: default mink_javascript_session: selenium2 contexts: - FeatureContext: ~ extensions: Behat\Symfony2Extension: ~ Behat\MinkExtension: base_url: http://my-app.local/app_test.php sessions: default: symfony2: ~

Behat Mink webdriver session is destroyed after every feature in a suite

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-04 02:40:10
问题 I am trying to automate sugarcrm functionality with behat BDD and Mink with selenium webdriver for php. I have properly installed both of them and able to run behat and mink together. for example checking login on sugarcrm as one feature. Now the problem is when i create two feature file say login.feature and setup.feature. Behat successfully automate login process in browser but as soon as it switches to setup.feature which require login session to be maintained from previous feature, it