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
8
votes
2 answers

Behat 3 - `FeatureContext` context class not found and can not be used

I have tried Behat 2.5 in the past and had no issues setting it up, but now I just downloaded Behat 3 and I am having some difficulties trying to set it up. My problem is that, after a fresh install, if I create a behat.yml file I cannot seem to be…
Samer
  • 667
  • 1
  • 5
  • 11
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,399
  • 1
  • 15
  • 27
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 S
  • 4,366
  • 6
  • 59
  • 97
7
votes
2 answers

How to Use Behat with Liip\FunctionalTestBundle in Symfony2?

I'm using Liip\FunctionalTestBundle for Unit testing, it works very well. AppCategoryControllerTest.php: class AppCategoryControllerTest extends BoEditoAuthWebTestCase { public function setUp() { parent::setUp(); // It…
Bopi
  • 71
  • 2
7
votes
2 answers

How can i click a span in Behat?

I am using Behat to test an third-party webshop. I have a item in the shoppingcart that i want to delete. A confirmation pop-up shows that asks me if i really want to do it. The structure of this dialog looks as following:
Robbin Voortman
  • 133
  • 1
  • 1
  • 6
7
votes
2 answers

Login before scenario with Behat and Symfony2

First of all I've read this related question and this other approach (blog post). This is my behat.yml: default: suites: users: contexts: - DoctrineFixturesContext - FeatureContext …
soyuka
  • 8,839
  • 3
  • 39
  • 54
7
votes
1 answer

How to test a REST API with Behat and Mink in Symfony 2

I'm builing a REST API in Symfony and I'd like to test it with Behat (using Mink and the behat extension for symfony2). There's no problem for the GET methods, I just "mock" some database objects, use the "I am on " step definition and check the…
petekaner
  • 8,071
  • 5
  • 29
  • 52
7
votes
2 answers

Gherkin highlighting and behat integration with Netbeans 8.0

Is there anyone who has a decent working solution to integrate Netbeans 8.0 with behat, in terms of code highlighting and code-completion. I saw that there exists the Cetriolo plugin which is unfortunately not available for Netbeans 8.0. Has anyone…
Potney Switters
  • 2,902
  • 4
  • 33
  • 51
7
votes
1 answer

How to communicate between contexts in behat 3?

I can't use getMainContext() and getSubcontext($alias) in version 3 any more. What is the way to communicate between context in version 3. Are context traits the only way? # behat.yml default: suites: guest_features: …
yuklia
  • 6,733
  • 5
  • 20
  • 26
7
votes
2 answers

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
  • 5,752
  • 10
  • 44
  • 93
7
votes
1 answer

Enable XDebug in Behat

I am using behat+mink. I wrote some features and am now running tests. How can I enable xdebug to to stop on breakpoints in phpstorm when running behat tests ?
Nealv
  • 6,856
  • 8
  • 58
  • 89
7
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,…
GWed
  • 15,167
  • 5
  • 62
  • 99
7
votes
4 answers

How to test file download in Behat

There is this new Export functionality developed on this application and I'm trying to test it using Behat/Mink. The issue here is when I click on the export link, the data on the page gets exported in to a CSV and gets saved under /Downloads but I…
vijay pujar
  • 1,683
  • 4
  • 19
  • 32
7
votes
1 answer

Symfony2 + Behat 3 : generate Context file to inside the Bundle and not in the features/bootstrap directory

How can I run behat --init -s bugfix to generate Context files inside the Bundle? Is there any way to do this? I see the Sf2DemoBundle but I didn't solve how it works. My files # /composer.json "behat/behat": "dev-master", "behat/mink":…
7
votes
6 answers

How to verify the selected option from the dropdown using Behat/Mink

There are couple of filters on the page and I would like to verify the default filter values. I'm not able to get the selectors working. Can someone help. Here is the code snippet:
vijay pujar
  • 1,683
  • 4
  • 19
  • 32
1 2
3
74 75