Simple Method for Checking for Order With Behat

While needing to write a test to check the order of 2 items (within a given CSS query) in Behat, I did a little googling and came across this website here.

The tutorial is great and i just wanted to give a shout out to the author for their great content. I also made a slight change to include testing for the existing of the 2 items.

Here is my slightly updated version:

You can see an example of the test i wrote using this method here.

1 thought on Simple Method for Checking for Order With Behat

  1. good job

    some suggestions

     

    line up the | on your feature file, also the method seems cool however behat should not test too much the UX i think, you should follow this repo¬†https://github.com/igorw/doucheswag and do things that way and understand the concepts and why we don’t use behat for such that, becauase it becomes too brittle, you should at least be suspicious about this usage.

    encouragements, good job

Leave a Reply