Download the PHP package alnutile/pickle without Composer
On this page you can find all versions of the php package alnutile/pickle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alnutile/pickle
More information about alnutile/pickle
Files in alnutile/pickle
Package pickle
Short Description Gherkin to Dusk
License MIT
Homepage https://github.com/alnutile/gd
Informations about the package pickle
Pickle
Overview
Converting Gherkin file to PHPUnit Compatible and Dusk Compatible files.
This will attempt to make an easy way to work with Dusk and PHPUnit from a Gherkin formatted file.
If you are familiar with Behat then this workflow might be similar.
Topics
- UI Example
- Running
- RoadMap
- Install
- Testing
- Contributing
- Security
- Credits
- License
Initialize
In this example I have written a feature 1 file and now I want to turn that into my first PHPUnit compatible test.
For example I make a file tests/features/profile.feature
One of the key aspects I will talk about later is how I can use one file to drive two types of tests, Integration then Browser. And how the Gherkin syntax can influence how I name my classes in line with the business writing of the feature 2.
NOTE: the above feature does not really summarize the goal in business terms it is still quite a bit focused on the web.
So at this point I can type, assuming you installed Pickle globally as I cover below:
or for a Browser test:
In this case let's focus on domain context eg Integration.
Now it will make a test for me in tests/Feature/ProfileTest.php
and I can start working on that file which would look something like this
Running
Now this is just icing on the cake and you can just default back to the basics and it will all still work.
Or just go back to using PHPUnit
Or Dusk via Pickle
Or via Dusk
UI Example
After I am done with my Integration tests and all that work is in place I can start on the Browser tests.
So I run the command
And I get
By setting the $this->browser
as global I can work one step or function at a time:
- visit the page
- enter a form field
- enter another form field
- submit
- look for results
Appending Tests
As here is an example of when you need to add new Scenarios to a feature file and you need to then update the Class file.
For example
We now need to append more to it so we run
pickle append tests/features/test_profile.feature
or
pickle append --context=browser tests/features/test_profile.feature
This will add the new Scenario and methods making sure not to duplicate Scenarios.
🤖🤖WARNING🤖🤖
This will not update existing Scenarios
For example you modify this Scenario
to
So the new line And I can add my photo
will show up as a method
but it will not add it to the Scenario
step as seen after initialize as
You just need to add it, to the correct ordered location before or after
RoadMap
Initialize (DONE)
The ability to use a Gherkin file to create a Unit or Browser test
Todo
Move the work into pickle
cli file see at root of app. Simple stuff since it is working in the test
I will take that one asap
Right now the test show it working now I need to add it to the global command
Append Snippets (DONE)
The ability to add more steps and scenarios to existing Unit and Browser tests
So if they add new steps or scenarios to the feature pickle is smart enough to append the scenario(s) (easy stuff there) but also append steps into the scenario as needed.
Todo
Everything! I mean I have code to prevent duplicate methods.
Run from Gherkin (DONE)
Running from the Gherkin test either the domain or ui test with nice Gherkin based output
eg
And it would know to use the tests/Feature/ProfileTest.php
and output in that nice Gherkin format like Behat.
Todo
I will track these as Issues here
And as much as possible / soon in Projects here
Install
First you need to install the Global Composer Tool to help over all learn more
Then make sure that ~/.composer/vendor/bin
to your $PATH`
You might have this already
eg edit your ~/.bash_profile` and add
Then type
Now if you type
You should get some output like this
Now for Pickle
now you should be able to run from any location on your Mac
and to upgrade often since it is a busy project
Testing
Contributing
Please see CONDUCT for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Alfred Nutile
- All Contributors
Footnotes
1 Feature files are written in Gherkin. You can see some examples here
The "Feature" area gives the feature a title then sense
- What is being built
- Who it is being built for
- What is the business result
Then then leads into the "Scenarios"
You can read more about BDD here
License
The MIT License (MIT). Please see License File for more information.
All versions of pickle with dependencies
behat/behat Version ^3.3
behat/gherkin Version ^4.4
illuminate/console Version ~5.4
illuminate/filesystem Version ~5.1|~5.2
illuminate/support Version ~5.4
larapack/dd Version 1.*
mnapoli/silly Version ^1.5
mnapoli/silly-pimple Version ^1.0
mockery/mockery Version 0.9.*
symfony/console Version ~3.2
symfony/process Version ~3.2
symfony/yaml Version ^3.2