Questions tagged [behat]

Behat is a php framework for autotesting your business expectations. It's a Behavior Driven Development (BDD) framework for PHP, initially inspired by Ruby's Cucumber project. Now it's not only accepted as a PHP implementation of Cucumber, but it provides some quite unique features the original didn't have.

Behat is a php framework for autotesting your business expectations. It's a Behavior Driven Development (BDD) framework for PHP, initially inspired by Ruby's Cucumber project. Now it's not only accepted as a PHP implementation of Cucumber, but it provides some quite unique features the original didn't have.

1111 questions
6
votes
2 answers

How can i specify an order in mink/behat tests?

I'm using mink/behat to test my website. I need certain features be executed before others. Is there a way to specify an order of execution? For example: There are 3 features: Administration, Login, Buy I need to execute them in this order: Login,…
Bernd Strehl
  • 2,852
  • 4
  • 24
  • 43
6
votes
4 answers

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

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…
K. Norbert
  • 10,494
  • 5
  • 49
  • 48
5
votes
2 answers

Behat hangs when there are multiple scenarios, but works on a single one

I have Behat test cases written like so: Feature: Checkout In order to buy products As a customer I need to be able to checkout items in the cart Background: Given step 1 And step 2 @Ready Scenario: Deliver now When step 3 Then…
abbood
  • 23,101
  • 16
  • 132
  • 246
5
votes
1 answer

How to fix behat 'DMore\ChromeDriver\StreamReadException' in behat script

I am executing my behat script and getting the following exception : DMore\ChromeDriver\StreamReadException in /vendor/dmore/chrome-mink-driver/src/DevToolsConnection.php I am getting the following exception in my local and also in my Acquia…
paul po
  • 99
  • 1
  • 10
5
votes
0 answers

Running Selenium in test environment (Symfony+Behat)

Could anybody give some advice for setting Behat with SF4? When I run behat database is loaded with fixtures for test environment, but Selenium starts browser and tries to find data in dev mode. The only way I managed to run Selenium in test mode is…
mykbas
  • 180
  • 2
  • 9
5
votes
2 answers

Twig is_granted fails in Behat scenario

I have this Behat setup: default: extensions: Behat\Symfony2Extension: ~ Behat\MinkExtension: sessions: default: symfony2: ~ And this scenarion: Scenario: Event list for…
andrius.k
  • 799
  • 1
  • 10
  • 26
5
votes
1 answer

Behat + selenium 2 wait for page to load

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…
Danack
  • 24,939
  • 16
  • 90
  • 122
5
votes
2 answers

Authentification with HTTP cookie in Selenium using Behat

I would like to create a behat definition to authenticate a user using a cookie. It works with the Behat BrowserKitDriver, when there is no @javascript tag on the behat scenario. But it did not work with the Behat Selenium2Driver, when there is the…
mykiwi
  • 1,671
  • 1
  • 19
  • 35
5
votes
2 answers

Semantical Error happens when using Behat only

Hello StackOverflow community, I just joined the community and this is my first question :) I'm using Symfony2. When I access a page manually using my browser (firefox): http://localhost:8000/vendor/add-product The page renders fine and I see a…
5
votes
3 answers

Behat test validation message

I have validation form using JavaScript and I want to test the validation message, because messages are in few languages. However, Behat throws an exception Could not open connection: Curl error thrown for http POST…
Matrix12
  • 446
  • 8
  • 19
5
votes
3 answers

Composer: Cannot install behat and mink in laravel 5.2 new project

I want to learn BDD using behat in a laravel project but I come accross dependencies problems with composer (this may be a very basic question but I have very little experience in composer so that I don't know what to do). I create a new…
Iam Zesh
  • 1,797
  • 2
  • 20
  • 42
5
votes
2 answers

Laravel 5 testing in memory

I am writing tests via behat for my large Laravel 5 project. I have a testing copy of my MySQL database in MySQL and a seeder for that database that shares some of the seeders of other environments. All of that works as expected. However, I tried…
Christopher Raymond
  • 1,196
  • 2
  • 12
  • 19
5
votes
1 answer

Can you call scenarios as steps in Behat 3?

When writing functionnal tests, some parts are repeated quite frequently. For example users logging in : I go to "/login" I fill in "login" with "username" I fill in "password" with "password" I press "Login" I would like to define those steps as…
i.am.michiel
  • 10,281
  • 7
  • 50
  • 86
5
votes
2 answers

Testing Symfony2 emails with Behat 3

I followed the Behat 2.5 docs to test mails. After a few tweaks to match Behat 3 I have ended with the following code (I have removed non-relevant parts): public function getSymfonyProfile() { $driver = $this->mink->getSession()->getDriver(); …
albertedevigo
  • 18,262
  • 6
  • 52
  • 58
5
votes
2 answers

Array as argument in Behat step

Is it possible to pass an array as argument in Behat step? For example want something like this: When I select <"Alex","Sergey"> in "users" I know that for this situation I can use: When I select "Alex" from "users" And I additionally select…
milkovsky
  • 8,772
  • 4
  • 28
  • 32