Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i specify an order in mink/behat tests?

I'm using mink/behat to test my website. I need certain features be executed before others. Is there a way to specify an order of execution?

For example: There are 3 features: Administration, Login, Buy I need to execute them in this order: Login, Administration, Buy

Thank you!

like image 921
Bernd Strehl Avatar asked Jun 25 '13 13:06

Bernd Strehl


People also ask

How behat works?

Behat is a tool that makes behavior driven development (BDD) possible. With BDD, you write human-readable stories that describe the behavior of your application. These stories can then be auto-tested against your application. And yes, it's as cool as it sounds!

What is Behat mink?

Behat is a popular and open-source Behavior-Driven-Development (aka BDD) framework for PHP. It makes it possible to write tests using a structured natural language. For testing applications in a web context, it uses another component, Mink, which role is to manage browser sessions using drivers.

What are Behat tests?

Behat is a PHP testing framework which can be used to automate acceptance tests in a human readable language called Gherkin. Since it is based on Cucumber, it also helps teams to adopt and implement Behavioral Driven Development (BDD).


1 Answers

Behat executes files in an alphabetic order. You could prefix them with a number to force the order.

However...

Scenarios are meant to be independent and the execution order shouldn't matter.

like image 150
Jakub Zalas Avatar answered Oct 14 '22 01:10

Jakub Zalas