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
4
votes
0 answers

Behat selenium Chromedriver CreatePlatformSocket error

I am trying to run test with selenium and chromedriver. i have a centos 6.7 installed chrome and used chrome lib from chromedriver ( found script here https://chrome.richardlloyd.org.uk/) front: extensions: Behat\MinkExtension: …
4
votes
1 answer

How to properly set desiredCapabilities in behat.yml with Mink

We are using Behat with Mink. So far we used to just set the DesiredCapabilities in the code, but now we want to change that to get them from the behat.yml and use different profiles, so we have one profile for firefox, one for chrome... and so…
yeaitsme
  • 91
  • 1
  • 9
4
votes
3 answers

Behat - Step definition for date? Today and -/+ days?

Wonder if someone can help me, I am using Behat to automate testing of a drupal site.. I am wanting to input a date in the format - dd/mm/YYYY - I can manually enter this, but a variable of a form is for a date over 30 days. Is there a way in Behat…
Karl
  • 599
  • 7
  • 27
4
votes
0 answers

Behat test browser does not scroll down to find element

When I run my behat test, it opens Firefox as expected. However it does not find for example a button because it doesn't scroll down in the page. But when I quickly zoom out in the browser enough by pressing ctrl+-, then I can see that behat…
Stephan Celis
  • 2,492
  • 5
  • 23
  • 38
4
votes
1 answer

Behat: use variable between the steps in a scenario

How can I use variable between the steps within one scenario in behat? I need to store the value of $output and then use it in the second step. Let's say I have the following structure: class testContext extends DefaultContext { /** @When /^I…
laechoppe
  • 232
  • 3
  • 14
4
votes
1 answer

Behat: Goutte/Guzzle downloading file via cURL "Warning: curl_setopt_array(): 3607 is not a valid File-Handle resource"

Using Behat to test some behavior that involves downloading a file. Using Goutte and Guzzle to intercept the file download so I can interact with it in another step. //Where to put the file $tmpFile = 'download.zip'; $handle = fopen($tmpFile,…
Jessica
  • 7,075
  • 28
  • 39
4
votes
1 answer

How to test Behat Context?

Behat is a very good tool, BDD/TDD/DDD is IMHO a foundation of SOLID coding but ... I often see projects using Behat with quite complex Context classes that are NOT tested. For example: Sylius/TaxonomyContext or Sylius/ProductContext /** * @Given…
paq85
  • 864
  • 10
  • 13
4
votes
1 answer

File upload with Behat, Mink & PhantomJS

I am trying to upload a file using Behat. Therefore I wrote this simple HTML page: …
Dero
  • 309
  • 1
  • 2
  • 17
4
votes
3 answers

Testing multi-tenancy Laravel applications using Behat / Mink and Behat Laravel Extension

I am building a multi-tenant SaaS application which I am trying to write tests for with Behat, using Mink and the Behat Laravel Extension When you register for an account, you get your own subdomain on the site {account}.tenancy.dev my behat.yml…
Andrew Willis
  • 2,289
  • 3
  • 26
  • 53
4
votes
2 answers

Behat testing in laravel with javascript - not using test environment

I have a Laravel 5 project using Behat for acceptance testing. I'm also running this in a Homestead Vagrant box. I have a page in my site that uses Javascript, and I'm using the Selenim2 driver with phantom js. Selenium seems to be working fine.…
Doug Steinberg
  • 1,122
  • 14
  • 32
4
votes
2 answers

behat formatters in version 3

With v3 behat seems to have changed the formatter options in the config yml. There is no formatter section anymore but only a formatters one. What I want is to get rid of the comments in the default output like #…
4
votes
4 answers

How to get the Mink Selenium 2 Driver to wait for the page to load with Behat

I am in the process of upgrading from the Behat 2.x series to the Behat 3.x series. In the prior version I could load the Selenium 1 driver, which attached to PhantomJS to execute tests. When I did this I was able to hook into a function called…
Patrick
  • 3,302
  • 4
  • 28
  • 47
4
votes
1 answer

Behat 3 - passing parameters (from imported file) to FeatureContext constructor

I'm fairly new to Behat and YAML, and I'm having trouble passing large arrays of parameters to the FeatureContext constructor. With Behat 2, the following worked fine: behat.yml (shortened for convenience): default: context: extensions: …
smrkem
  • 173
  • 3
  • 12
4
votes
2 answers

Can I use one of scenarios as my meta-step instead of define it in Context class?

I need to define meta-step like I have an item in my order cart. But instead of creating definition for this step in Context class I want just use existing steps in some feature file. Because I already have scenario for testing feature Adding item…
Michael Sivolobov
  • 12,388
  • 3
  • 43
  • 64
4
votes
2 answers

This page is asking you to confirm that you want to leave

I am running the behat tests on my site installation. I am getting the following errors when running the tests. I switched into using firefox, because I had issues with the new chromedriver 2.10. Can I work around this one? Error message: Modal…
Potney Switters
  • 2,902
  • 4
  • 33
  • 51