behat

Behat 3 and Laravel, testing environment not being honoured

旧城冷巷雨未停 提交于 2019-12-21 21:35:46
问题 I am having a confusing problem using Behat 3 and Laravel to test an API. It seems that its not using the 'testing' environment database (in my case an sqlite memory database) ... but only some of the time. I've put a log message in the testing/database.php file to see when its loaded.. and I do see the log message when running Behat. But running the Behat features is adding rows to my development database - and some of my tests are failing for the same reason. My phpunit tests run fine and

Struggling to install mink and behat using composer for use with symfony2

試著忘記壹切 提交于 2019-12-21 12:57:09
问题 I'm trying to install behat and mink with symfony 2.4 using composer but I can't seem to get my composer.json file to an resolve to an installable set of packages. I installed symfony2 using the command on http://symfony.com/doc/current/book/installation.html php composer.phar create-project symfony/framework-standard-edition /path/to/webroot/Symfony 2.4.* Below is my require section of my composer.json file: "require": { "php": ">=5.3.3", "symfony/symfony": "~2.4", "doctrine/orm": "~2.2,>=2

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

Undefined, Undefined in Chrome notification when it's triggered from Selenium

筅森魡賤 提交于 2019-12-20 04:38:40
问题 I am working on automating a website written in Python and using Angular where there are many confirmation notifications. The issue I have is that Behat doesn't seem to recognise those notifications, let alone allow me to interact with them. I have attached screenshots of what the notification should look like and the Undefined – Undefined error message Behat produces instead. My scenario: Then I select the Delete the Media Plan Line Checkbox And I delete the Media Plan Line And I select Yes

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

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

江枫思渺然 提交于 2019-12-18 13:35:48
问题 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 #

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