mink

Struggling to get Mink working with Behat

China☆狼群 提交于 2019-12-21 04:08:06
问题 I've been following this guide (and installed everything through composer): http://docs.behat.org/cookbook/behat_and_mink.html and am attempting to get Behat + Mink working but everytime I try and run bin/behat I get the following error: PHP Fatal error: Call to a member function getSession() on a non-object in vendor/behat/mink-extension/src/Behat/MinkExtension/Context/RawMinkContext.php on line 80 That line of code is: return $this->getMink()->getSession($name); So for some reason the mink

Optimising behat test suite

三世轮回 提交于 2019-12-19 10:17:44
问题 I have a test suite which has 20 feaure files and 100% MySQL CRUD operations are being carried out. It takes about 5 minutes to finish. If I did the test manually it would take about 7 minutes max. What I need to know is, what I need to do in order to optimise the whole process? Note : ParallelRunnder is not supported for Behat 3 so it is out of scope for now! If you're going to suggest to use Behat 3, then please help me modifying my composer.json & behat.yml files because when I do it

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

只愿长相守 提交于 2019-12-19 07:23:16
问题 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

How can i get the Parameters from Behat.yml to a php file?

别等时光非礼了梦想. 提交于 2019-12-18 17:29:25
问题 I have a Behat.yml default : context : parameters : user: xyz password : abc Also i have a file called FeatureContext.php which retrieves the values from behat.yml through public function iExample($user, $password) { $userName=$this->getParameter($user); } But it throws an error like "Call to undefined method FeatureContext::getParameter()" Am i missing something ? .. i have also added autoload.php in FeatureContext.php through require_once __DIR__.'/../../vendor/autoload.php'; Please let

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-12-18 09:49:07
问题 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

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

牧云@^-^@ 提交于 2019-12-18 09:48:22
问题 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

Fatal error: Call to a member function press() on a non-object

怎甘沉沦 提交于 2019-12-13 07:46:52
问题 I am going to make a test add article with behat in symfony but i should this error: this is AjouterContext.php: <?php namespace test\MedBundle\Behat\Context; use Behat\Behat\Context\Context; use Behat\Behat\Context\BehatContext; use Behat\Behat\Exception\PendingException; use Behat\Gherkin\Node\PyStringNode; use Behat\Gherkin\Node\TableNode; use Behat\MinkExtension\Context\MinkContext; use test\MedBundle\Entity\Apps; use test\MedBundle\Entity\Product; /** * Defines application features from

I can not run sahi [duplicate]

巧了我就是萌 提交于 2019-12-13 03:36:53
问题 This question already has an answer here : Closed 7 years ago . Possible Duplicate: sahi and symfony2 I would like to test behat, mink and sahi with symfony2. In my file config_test.yml I have mink: base_url: http://localhost/Symfony_Standard_2.0.15_2/symfony/web/app_test.php default_session: symfony sahi: ~ in my test.feature when I use Scenario: Open page with products list and check it Given I am on "/hello" Then the response should contain "hello" the result is well: 1 scenario (1 passed)

How to efficiently test accessing a large file with Behat/Mink?

戏子无情 提交于 2019-12-12 20:44:55
问题 I'd like to write Behat/Mink scenarios to check whether certain user accounts can download a large file. I can use the When I follow "largefile.zip" event, but that appears to download the entire file. Rather than wasting time and resources streaming the large file, I'd like to (for example) just check the result of an HTTP HEAD request, or just try to start downloading the file with an HTTP GET request and then cancel it immediately and check the response status code . How can I do that with

Behat/Mink Unable to simulate click on button in footer [closed]

会有一股神秘感。 提交于 2019-12-12 18:29:06
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . Attempts to use the "Then I press" (for buttons) or "Then I follow" (for links) regex for items in the footer fails with error "element/link with id|link|name was not found.. " As an example I found this anomaly