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.

1099 questions
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
  • 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
  • 769
  • 1
  • 10
  • 22
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
  • 23,022
  • 14
  • 78
  • 112
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
  • 298
  • 4
  • 16
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,657
  • 2
  • 18
  • 38
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,086
  • 1
  • 12
  • 18
5
votes
1 answer

Behat 3.0 features folder/path

I am trying to setup Behat 3.0. I want to change the path of where my features go. Currently, my behat.yml config looks like this: default: autoload: '': app/tests/acceptance Running behat --init wil create the…
FooBar
  • 4,496
  • 10
  • 33
  • 68
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,063
  • 7
  • 46
  • 85
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
  • 17,502
  • 6
  • 46
  • 56
5
votes
3 answers

How to set a request header in behat tests?

I am developing a Rest API and testing it with Behat and mink-selenium2-driver (for the first time) . For security purposes, every call needs to contain a apikey in the request header. My Problem is, i cannot set the header. My test looks like this:…
user3210460
  • 71
  • 1
  • 4
5
votes
2 answers

Behat 3 within symfony2.4 (doctrine access)

Situation I want to use BDD and Behat in my symfony projects from now on. Current project is sf2.4, and I strive to make Behat 3 work. I use the latest doc concerning behat3, as recommanded by jakub in this post. issue Behat 3 seems to work well.…
Wisebes
  • 475
  • 4
  • 14
5
votes
1 answer

Could not evaluate XPath (Behat/Mink)

I'm using the following function: /** * Click on the element with the provided xpath query * * @When /^I click on the element with xpath "([^"]*)"$/ */ public function iClickOnTheElementWithXPath($xpath) { $session =…
Ginz Its
  • 51
  • 1
  • 3
5
votes
2 answers

How to handle confirm popup with phantomjs + behat + mink

In my tests I use this step to confirm a javascript confirm popup: /** * @when /^(?:|I )confirm the popup$/ */ public function confirmPopup() { $this->getSession()->getDriver()->getWebDriverSession()->accept_alert(); } This step work fine…
Benjamin Lazarecki
  • 2,860
  • 17
  • 27
5
votes
1 answer

Is it possible to use different step data depending on the current environment with Behat?

I am running into a bit of a conundrum. We have an antiquated system that I am writing Behat tests for. It works great for the most part. But I have noticed an issue where the Behat tests will fail if the data I am testing against the current…