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
7
votes
1 answer

Behat eating memory

I'm using Behat for testing a Symfony2 application. Whilst each Feature test runs happily when run in isolation, trying to run the whole test suite in one go leads to PHP running out of memory - even when the memory_limit is set to 2GB and…
Andrew Battye
  • 418
  • 5
  • 17
7
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
  • 81,041
  • 149
  • 392
  • 552
7
votes
2 answers

Can't upload a file with Sahi / Mink / Behat in a Symfony2 application

I am using Mink and Sahi for my user interface tests inside a Symfony2 application. But actually I can't manage to upload a file with Sahi. My Sahi server is up and running: [09:51:33] coil@ubuntu:~/Webdev/sahi/bin$ ./sahi.sh -------- SAHI_HOME:…
COil
  • 7,201
  • 2
  • 50
  • 98
7
votes
1 answer

How to test with behat two sites in the same test with different environments (so different URLs)

I'm using Behat and Mink to test several sites. Two of them use Single Sign On, so one of my test includes login in one site, go to second site and check I'm logged in. This is acomplished with this behat code: Feature: SSO In order to login in…
sanzante
  • 844
  • 1
  • 11
  • 28
7
votes
2 answers

How to start a PHP built in web server before running a test and close it after test has run

I am trying to use Behat for BDD testing. When running a build on Jenkins, I would like Behat to open PHP's build in web server and then close it after running the tests. How to do that? Basically I need to run: php -S localhost:8000 In my BDD…
Richard Knop
  • 81,041
  • 149
  • 392
  • 552
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,110
  • 1
  • 14
  • 24
6
votes
2 answers

How to handle browser window or tab using Behat and Mink PHP

I have test that click on link and then new browser window open and in new browser window I need to check some elements are present. How to switch to new Browser window that was opened using BEHAT/MINK?
Ihor Bovkit
  • 120
  • 3
  • 9
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
  • 153
  • 2
  • 5
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
  • 12,257
  • 22
  • 93
  • 165
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
  • 181
  • 1
  • 7
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
  • 696
  • 4
  • 16
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.
  • 11,892
  • 18
  • 75
  • 113
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
  • 278
  • 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
  • 557
  • 4
  • 18
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
  • 405
  • 5
  • 12