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
6
votes
3 answers

Filling in hidden inputs with Behat

I am writing Behat tests and I need to change the value of a hidden input field I need to change the value of this input field, but I keep getting Form field with id|name|label|value "input_id" not…
Sean
  • 1,044
  • 1
  • 14
  • 21
6
votes
1 answer

org.openqa.selenium.NoSuchSessionException: Unable to find session with ID error testing with Behat/Mink and Selenium2Driver in docker container

I'm trying to test a Symfony3 web application with Behat/Mink and Selenium2Driver so that I can test Javascript functionallity too. The application runs in a docker container, so I added a new docker container for selenium-hub and chrome as…
Manolo
  • 16,729
  • 16
  • 67
  • 115
6
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,572
  • 1
  • 15
  • 32
6
votes
1 answer

Mink instance has not been set on Mink context class. Have you enabled the Mink Extension? (RuntimeException)

i'm trying to use mink with Behat on Zend framework 1 but when i run Behat command i get this error "Mink instance has not been set on Mink context class. Have you enabled the Mink Extension? (RuntimeException)" here's my composer: "behat/behat":…
ahmed reda
  • 133
  • 2
  • 5
6
votes
2 answers

Behat with PhpStorm does not show stack trace for exceptions

I've just started using Behat 3.0 with PhpStorm 8.0. Everything is working fine, except that for exceptions, there is no stack trace shown in PhpStorm. The test just fails with no feedback on where the failure occurred. If I use Behat in terminal,…
Gaz_Edge
  • 12,970
  • 5
  • 50
  • 91
6
votes
1 answer

build.xml to set date and time as file name

I want to set file name with date and time attached to it so I want to create file named as behat-20140913-195915.html however the example below sets the name as behat-yyyymmdd-hhiiss.html. Anyone know the solution to problem? I followed this…
BentCoder
  • 10,692
  • 17
  • 82
  • 143
6
votes
1 answer

Symfony2 conditional service declaration

I'm currently trying to find a solid solution to change the dependencies of a Symfony2 service dynamically. In detail: I have a Services which uses a HTTP-Driver to communicate with an external API. class myAwesomeService { private…
sl0815
  • 141
  • 1
  • 6
6
votes
2 answers

How to debug behat features using xdebug?

Having hard time with Behat, cent find the way to debug (php/xdebug using breakpoints and steps). Does anybody have experience or maybe there is better way to do the same? Edited: "behat/mink": "*", "behat/mink-extension":…
Aram
  • 618
  • 4
  • 15
6
votes
3 answers

Behat context in a trait

The basic Behat use case recommends using FeatureContext class. Also, you can specify any other PHP classes in the features/bootstrap directory and they are loaded, but in the alphabetical order, no matter what the dependencies are. Given there is a…
Pavel S.
  • 10,292
  • 14
  • 68
  • 108
6
votes
3 answers

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

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 …
Paul Saunders
  • 268
  • 2
  • 10
6
votes
3 answers

execute javascript with behat and phantomjs

I am working on a solution for functional test with javascript support. Naturally, using Symfony Framework, I choose Behat with Sahi driver, and I had my test suites green. The problem was that sahi is quite slow, and not stable enough and that is…
fxlacroix
  • 535
  • 3
  • 16
6
votes
4 answers

How do I tell Behat / Mink to hover over an element on a webpage?

I am new to Behat. I am currently using the Mink Extension and the Selenium2 driver and I would like to know how to specify that the test should hover over an element as part of the Scenario. For example, here is my scenario: Scenario: Testing that…
Peter Meth
  • 385
  • 4
  • 12
6
votes
2 answers

Behat - Context class not found.

This is my directory structure: composer.json composer.phar vendor/ bin/ behat tests/ functional/ behat.yml features/ registration.feature bootstrap/ FeatureContext.php I…
Richard Knop
  • 73,317
  • 142
  • 374
  • 539
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,138
  • 4
  • 45
  • 46
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
  • 21,507
  • 9
  • 112
  • 218