behat

sahi and symfony2

眉间皱痕 提交于 2019-12-02 09:42:18
i would like to test behat, mink and sahi with symfony2 so, in my 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: ~ and in test.feature @mink:sahi Scenario: Open page with products list and check it Given I am on "/hello" Then the response should contain "hello" when i execute i have this PHP Fatal error: Call to undefined function Buzz\Client\curl_init() in C:\wamp\ www\Symfony_Standard_2.0.15_2\Symfony\vendor\buzz\lib\Buzz\Client\AbstractCurl.p hp on line 26 help me please, It seems that you do not have

How to stop Behat tests in the middle to run element inspector?

大憨熊 提交于 2019-12-02 08:51:16
I'm using Chrome driver and currently to pause the browser in the middle of the tests I do: And I ... And I wait for 3600 seconds And I ... given the following method: /** * @Given I wait for :number seconds */ public function iWaitForSeconds($number) { $this->getSession()->wait($number * 1000); } so I can freely use DevTools to inspect the objects of the given page at specific place in my tests. The problem is that when opening DevTools , the script stops with error: And I wait for 3600 seconds # CWTest\Context\HelperContext::iWaitForSeconds() disconnected: not connected to DevTools (Session

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

Behat / Mink / Selenium testing broken (macOS)

折月煮酒 提交于 2019-12-01 14:57:38
I have been using Selenium for quite some time for automated browser testing. I never did figure out how to get it to run in anything other than Firefox. Well now FireFox will launch but won't get pulled to the front and it just sits there and does nothing. I have a feeling it's because FireFox updated itself. I'm running macOS Sierra. I have installed and enabled the WebDriver 2.48 extension into Safari. I have downloaded and tried both selenium-server-standalone-2.53.1.jar and selenium-server-standalone-3.0.0-beta4.jar but I get different results from each. With 2.53.1 and Firefox 49, it

How to run Behat tests when there are errors of level E_USER_DEPRECATED

旧巷老猫 提交于 2019-12-01 13:23:09
I have a Symfony 2.7 Form Type which is causing some errors of level E_USER_DEPRECATED . This errors do not come from my own code but from vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php . In dev mode using a web browser, I can access the page using said form just fine. The WDT does show me some DEPRECATED messages but the form does work, the page is returned with status 200. Using Behat 3 (with Behat\Symfony2Extension\Driver\KernelDriver and Behat\Mink\Driver\BrowserKitDriver ), the request for the same URL returns a status 500 server error. The stack trace in

How to run Behat tests when there are errors of level E_USER_DEPRECATED

社会主义新天地 提交于 2019-12-01 09:46:12
问题 I have a Symfony 2.7 Form Type which is causing some errors of level E_USER_DEPRECATED . This errors do not come from my own code but from vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php . In dev mode using a web browser, I can access the page using said form just fine. The WDT does show me some DEPRECATED messages but the form does work, the page is returned with status 200. Using Behat 3 (with Behat\Symfony2Extension\Driver\KernelDriver and Behat\Mink\Driver

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

Is there a way to have Behat NOT fail on PHP Notice errors?

試著忘記壹切 提交于 2019-11-30 10:17:58
I understand that it is a best practice to have all variables defined and to check for array indexes before evaluating. However, I'm trying to run some tests on new functionalities developed on top of some legacy code which has not been coded this way. Behat fails with this message: Scenario: Add a new resource # features/accounting.feature:6 Given I am user "admin" # FeatureContext::iAmUser() Notice: Undefined index: 13 in classloader.php line 126 When I create a new resource # FeatureContext::iCreateANewResource() Then [...] I will fix these notices eventually, but I need Behat to ignore