mink

Running behat tests in parallel (in two browser windows)

↘锁芯ラ 提交于 2019-12-02 02:28:06
I followed this blog as an example and read the ParallerRunner info. When I call bin/behat command, one browser window opens and runs all the tests successfully with the setting below. symfony/behat.yml default: context: class: Site\CommonBundle\Features\Context\FeatureContext extensions: Behat\Symfony2Extension\Extension: mink_driver: true kernel: env: test debug: true Behat\MinkExtension\Extension: base_url: 'http://symfony.local/app_test.php/' javascript_session: selenium2 browser_name: firefox goutte: ~ selenium2: ~ paths: features: %behat.paths.base%/src bootstrap: %behat.paths.features%

How to test file download in Behat

泪湿孤枕 提交于 2019-12-01 17:30:35
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? Ian Bytchek Assuming you are using the Selenium driver you could "click" on the link and $this->getSession()->wait(30) until the download is finished and then check the Downloads folder for the file. That

Running behat tests in parallel (in two browser windows)

岁酱吖の 提交于 2019-12-01 09:39:06
问题 I followed this blog as an example and read the ParallerRunner info. When I call bin/behat command, one browser window opens and runs all the tests successfully with the setting below. symfony/behat.yml default: context: class: Site\CommonBundle\Features\Context\FeatureContext extensions: Behat\Symfony2Extension\Extension: mink_driver: true kernel: env: test debug: true Behat\MinkExtension\Extension: base_url: 'http://symfony.local/app_test.php/' javascript_session: selenium2 browser_name:

Can I make Behat/ZombieJS/Mink simulate a click on a “non-link” element, to fire JS listeners?

ε祈祈猫儿з 提交于 2019-12-01 05:42:43
I am using Behat for testing, with the ZombieJS driver, and everything is working very well so far, but there is one thing that bothers me, I can't seem to figure out how to get Behat to simulate a click on a non-link element. I guess this comes from Mink being a "cross-browser" driver, and it doesn't really make sense to click on non-link elements. For my use case though, I need it, because there are several elements on the page that have javascript event listeners attached to them, and I want to test these functionalities. I tried using Then I follow "div.sa" But it fails with the expected

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

PHP Mink/Zombie - handling hanging processes after a fatal exception?

江枫思渺然 提交于 2019-11-29 18:02:26
I'm using the PHP script with Mink+Zombie driver (install as on nodejs cannot find module 'zombie' with PHP mink ) from here: PHP Mink/Zombie - page visit returns status code 0? ; re-posting for completeness: <?php $nodeModPath = "/home/USERNAME/.nvm/versions/node/v4.0.0/lib/node_modules"; # composer autoload: require_once __DIR__ . '/vendor/autoload.php'; $URL = "https://demo.centreon.com/centreon"; $USERNAME = "admin"; $PASSWORD = "centreon"; $LFID = "useralias"; $PFID = "password"; $BFID = "submitLogin"; $zsrv = new \Behat\Mink\Driver\NodeJS\Server\ZombieServer(); $zsrv->setNodeModulesPath(

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

PHP Mink/Zombie - handling hanging processes after a fatal exception?

泄露秘密 提交于 2019-11-28 12:48:19
问题 I'm using the PHP script with Mink+Zombie driver (install as on nodejs cannot find module 'zombie' with PHP mink) from here: PHP Mink/Zombie - page visit returns status code 0? ; re-posting for completeness: <?php $nodeModPath = "/home/USERNAME/.nvm/versions/node/v4.0.0/lib/node_modules"; # composer autoload: require_once __DIR__ . '/vendor/autoload.php'; $URL = "https://demo.centreon.com/centreon"; $USERNAME = "admin"; $PASSWORD = "centreon"; $LFID = "useralias"; $PFID = "password"; $BFID =

nodejs cannot find module 'zombie' with PHP mink

醉酒当歌 提交于 2019-11-28 02:10:48
I'm trying out Mink (PHP) on Ubuntu 14.04; I basically did the following: $ apt-show-versions nodejs nodejs:amd64/trusty 0.10.45-1nodesource1~trusty1 uptodate $ npm -v 2.15.1 $ sudo npm install -g zombie npm WARN engine zombie@4.2.1: wanted: {"node":"^4.0.0"} (current: {"node":"0.10.45","npm":"2.15.1"}) ... zombie@4.2.1 /usr/lib/node_modules/zombie ├── ms@0.7.1 ├── debug@2.2.0 ... $ ls /usr/lib/node_modules/zombie/node_modules/ babel-runtime bluebird debug eventsource iconv-lite jsdom lodash mime ms request tough-cookie ws So, basically, even if I get a warning, the modules build, and should