As said, I want to add a command to my Behat Project.
I will add a '--list-scenarios' option to my behat command
The files I add or modify are in my vendor project, so I'm actually in search of how to not use the vendor directory.
git checkout <old_name> | |
git branch -m <new_name> | |
git push origin -u <new_name> | |
git push origin --delete <old_name> |
<?php | |
namespace App\UserBundle\Form\Type; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; | |
class EditFormType extends AbstractType | |
{ |
In the MinkExtension, there is differents drivers (more here).
Each one have it's caracteristics.
Generally, the Goutte driver is used to run, but there is more and more websites which have Js to be more interactive.
Goutte driver cannot run JS (it only get the page with it's raw text and do what you want it to do).
Here, traits allows to order the functions according to the categories you choose (as for me, what they do).
Even if you don't have many of functions, it's became really usefull (+gain of time) at the end. Because, after a little while, it can be really annoying to scroll beetwing functions.
And it appears more clean to have functions disposed and sorted in files.
<?php | |
/** | |
* some functions to make a pause (minutes, seconds or milliseconds) | |
* The last one is a little more tricky as she will stop the Scenario to wait for the end of the loading of the | |
* scripts behind (you must be cautious if a script is created to run all the time) | |
* | |
* @author netraagal | |
*/ | |
namespace App\Features; | |
use Behat\Mink\Driver\Selenium2Driver; |
<?php | |
/** | |
* All of those functions can be used to verify the validity of what is on the page | |
* | |
* @author netraagal | |
*/ | |
namespace App\Features; | |
use Behat\Mink\Driver\Selenium2Driver; | |
use Behat\Mink\Element\NodeElement; | |
use \Exception; |
<?php | |
/** | |
* those functions allos me to use only 1 Step definitio to get an element, even if I don't use the same | |
* parameters to get it. | |
* You can search with: | |
* - the xpath (Which can be really tricky sometimes) | |
* - an attribute of the element : id (the best) or name or value | |
* - the css (the more used) | |
* I pass the type of element and the element above but you can only use css and xpath (as the attributes | |
* can also be used on the css) |
<?php | |
/** | |
* some functions to create a new tab/window (it's up to your personal settings), | |
* to move between them (to the right, to the left or by it's number in the list of windows. | |
* You can also close the current window or close all (the first window will be open as if you | |
* close it, the Scenario will fails). | |
* | |
* I block the actual driver is not an instance of Selenium2 driver, but I don't really remember | |
* if it's an obligation :) | |
* |