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
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
  • 7,862
  • 2
  • 36
  • 53
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
  • 5,761
  • 4
  • 24
  • 42
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,394
  • 3
  • 27
  • 45
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
  • 4,387
  • 4
  • 16
  • 24
7
votes
2 answers

Behat and Symfony data fixtures

I'm wondering is it possible to use separate database for the Behat tests? is there any way to drop and truncate database and load data fixtures with it like you can do with PHPUnit?
Einius
  • 1,222
  • 1
  • 19
  • 43
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,481
  • 6
  • 52
  • 83
7
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
  • 647
  • 1
  • 5
  • 11
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,162
  • 3
  • 14
  • 30
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
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
  • 4
  • 15
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
  • 6,187
  • 2
  • 40
  • 80
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
  • 744
  • 1
  • 9
  • 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
  • 73,317
  • 142
  • 374
  • 539
1 2
3
73 74