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

How to debug features in Behat 3 with echo

I am trying to debug a feature in Behat 3 to see what is going on. Echo statements don't seem to work - I get no output. The step I'm trying to use currently looks like this: /** * @Then /^echo last request$/ */ public function…
Adamski
  • 3,307
  • 2
  • 29
  • 72
10
votes
2 answers

Adding information to Behat output from custom context code

I am trying to determine how I would add additional information to Behat's output (pretty, html, junit, etc) so I can have more contextual information for the test purposes. Specifically I have some unique data that gets generated during some of…
Patrick
  • 3,123
  • 3
  • 25
  • 43
10
votes
4 answers

Behat "base_url" from command line

I would like to know if it's possible to set the base_url via the command line. Example bin/behat --base_url=http://google.fr I would like to avoid creating a new profile and passing it via the command line each time I have to test a new url, for…
lnki
  • 411
  • 1
  • 4
  • 9
10
votes
3 answers

How to make Behat wait for an AJAX call?

Scenario: Modify and save an incomplete change to a Campaign Given I click on the Campaign section folder And I press Save in the selected Campaign Then I should see an error balloon informing the changes cannot be saved Point is that this 'error…
user806474
9
votes
1 answer

Testing drag and drop with behat and mink

I'm trying to emulate drag and drop UI behaviour in a behat test. So far with no success, despite mink allegedly supporting that interaction. Weirdly enough it was hard for me to find any relevant blog posts about the subjects. Ones I've found (this…
guessimtoolate
  • 7,659
  • 1
  • 15
  • 23
9
votes
2 answers

Travis-CI + Sauce Connect + Behat: Unable to get Internet Explorer to run tests

I have Travis-CI running Sauce Connect to run Behat tests. Everything works just fine if I tell Sauce to use Firefox 26 on Windows 7. But if I change the browser to Internet Explorer (any of the three versions that Sauce Labs makes available on…
Trott
  • 52,114
  • 21
  • 134
  • 179
9
votes
2 answers

Behat "Unrecognized options"

I'm trying to run Behat (first time for me) and it worked. But i have a configuration problem. I tried to change the paths of features and bootstrap like so: #behat.yml default: paths: features: app/tests/features bootstrap:…
Patrick
  • 1,411
  • 12
  • 25
9
votes
3 answers

Can I send raw keyboard input using Mink and Selenium2?

I am using Behat and Mink with the Selenium2 driver, and I'm trying to type directly into a form field (simulating raw keyboard input), instead of using the fillField() function. This is what I'm trying: $element =…
jcsanyi
  • 7,953
  • 2
  • 25
  • 51
9
votes
1 answer

Gherkin + Behat Scenario outline throws Behat\Gherkin\Exception\ParserException

I am trying to run registration example and I am getting stuck Scenario: New user registration; poor password Given I am on "/register" When I fill in "username" with "admin" And I fill in "password1" with "" And I fill in "password2"…
Fatmuemoo
  • 2,119
  • 3
  • 17
  • 34
9
votes
2 answers

Struggling to get Mink working with Behat

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…
pogo
  • 2,257
  • 2
  • 24
  • 36
8
votes
3 answers

Step definitions in external files in Behat

Behat by default looks for the step definitions in file named FeatureContext (all steps in one file). Having a lot of steps, it's hard to maintain such a big file. I'd like to have one definition file per feature file. How can I have step…
Sfisioza
  • 3,441
  • 5
  • 38
  • 53
8
votes
1 answer

Make CSS Selector (first-child) work in Behat 3 with Sahi Driver

I was just wondering if you could point out where the problem is here, if it's Behat, the CSS selector, or the Sahi Driver. We have just upgraded to Behat 3 and are using Sahi Driver (most recent open source version). We have found that any Behat…
sugarwaffle
  • 541
  • 4
  • 13
8
votes
2 answers

Class 'Behat\Behat\Context\BehatContext' not found in PHP with Behat

I am trying to learn Behat using the tutorial on the website. The first step goes OK, no errors appear. But when I am changing the ls_project/features/bootstrap/FeatureContext.php, as shown in the tutorial second step, I am getting the following…
fabrice
  • 1,265
  • 1
  • 10
  • 24
8
votes
2 answers

Gherkin - simply re-use Given statements as When statements... acceptable?

Here are three example BDD statements that should help explain my question: Scenario: User logs in Given I am on the login screen When I enter the valid username "myUsername" And I enter the valid password "myPassword" And I press the login…
Charlie Seligman
  • 3,508
  • 4
  • 50
  • 84
7
votes
2 answers

Javascript test : Selenium cookies data url

I have a Behat test running Selenium whenever Javascript is needed. My current Behat test works just fine if Javascript (so Selenium is disable). At the moment, my only error feedback from Selenium is the following statement : unknown: Failed to…
1
2
3
73 74