behat

Why can magento behat test not find my database?

梦想与她 提交于 2019-12-13 20:03:54
问题 When I call bin/behat to execute my tests, I get this error: test.dev bin/behat [Zend_Db_Adapter_Exception] SQLSTATE[HY000] [2002] No such file or directory [PDOException] SQLSTATE[HY000] [2002] No such file or directory This is my composer.json : { "require": { "php": ">=5.4.0" }, "require-dev": { "magetest/magento-behat-extension": "dev-develop", "magetest/magento-phpspec-extension": "~2.0", "peridot-php/webdriver-manager": "dev-master", "bossa/phpspec2-expect": "dev-master", "behat/mink

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

How to switch to dynamically named iframe with Behat/Mink

ε祈祈猫儿з 提交于 2019-12-12 15:06:19
问题 Writing test for an iFrame generated when a button is clicked. The iFrame name and id are similar but generated dynamically. I have used "switchToiFrame" successfully before. <div class="bbbb-frame-container" style="height: 400px; width: 665px; margin-top: -200px; margin-left: -332.5px;"> <div class="user-support-frame-close-container" style="display: block;"> <div class="user-support-frame-close">Close</div> </div> <iframe id="poplock_default9636_priv" frameborder="0" name="poplock

How to communicate between contexts in behat 3?

丶灬走出姿态 提交于 2019-12-12 08:10:38
问题 I can't use getMainContext() and getSubcontext($alias) in version 3 any more. What is the way to communicate between context in version 3. Are context traits the only way? # behat.yml default: suites: guest_features: paths: [ %paths.base%/features/web ] filters: { role: guest } contexts: [ GuestContext ] user_features: paths: [ %paths.base%/features/web ] filters: { role: member } contexts: [ MemberContext ] groupled_features: paths: [ %paths.base%/features/web ] filters: { role: grouplead}

behat fillField xpath giving error?

笑着哭i 提交于 2019-12-12 06:01:07
问题 This line of code: $this->fillField('xpath','//fieldset[@id="address-container"]/input[@name="address_add[0][city]"]', "Toronto"); Is giving me this error Form field with id|name|label|value|placeholder "xpath" not found. (Behat\Mink\Exception\ElementNotFoundException) The reason I want to use xpath in my fillField is because there are actually multiple input[@name="address_add[0][city]"] in my html document. I figure an xpath will let me target specifically the field I want to populate. What

Behat fails runing after updating dependencies

徘徊边缘 提交于 2019-12-12 05:51:29
问题 Just updated composer on a functioning Behat, and now getting the following messages open running behat. PHP Deprecated: "Symfony\Component\Console\Helper\DialogHelper" is deprecated since version 2.5 and will be removed in 3.0. Im using Behat-3 (~3.0@dev). Any advice will be appreciated :) 回答1: I don't know what your composer.json looks like but I would suggest you to use stable versions for packages in require blocks. Try to use specific versions when possible. "require": { "hello/world":

Chrome is not started with selenium and behat

你离开我真会死。 提交于 2019-12-12 05:24:43
问题 Please help. I use windows to run my tests. I run selenium with chrome driver: java -Dwebdriver.chrome.driver=chromedriver.exe -jar selenium-server-standalone-3.4.0.jar My behat_dev.yml : default: suites: default: mink_session: selenium2 javascript_session: selenium2 extensions: Behat\MinkExtension: base_url: http://en.wikipedia.org default_session : selenium2 javascript_session: selenium2 browser_name : chrome goutte: ~ selenium2 : wd_host : http://127.0.0.1:4444/wd/hub browser: chrome