Automatic BDD testing tool for Com App.
-
Installs the appropiate chromedriver executable in your gem path.
-
Simulates how a real user would interact with the app.
-
Provides support for Behaviour-Driven Development. Executes specifications written using Gherkin syntax.
-
DSL describing a web application using Page Object Model pattern, for use with Capybara in automated acceptance testing.
-
Makes direct calls to the browser using each browser’s native support for automation.
-
Points to a directory and require all the requested files at once.
-
Dotenv
-
Minitest
-
Rake
The following rake task will execute the user_login cucumber profile:
user@localhost:~/bdd_project$ rake user_login
Create a copy of the file env.sample and name it .env. Modify the environmental variables accordingly.
- APP_URL
- APP_USERNAME
- APP_PASSWORD
n/a
The following tree represents the most important elements of this tool:
├── features
│ ├── pages
│ │ ├── sections/*.rb
│ │ └── *.rb
│ ├── step_definitions
│ │ └── *.rb
│ ├── support
│ │ ├── helpers/*.rb
│ │ └── env.rb
│ ├── *.feature
├── reports
├── .env
├── cucumber.yml
└── Rakefile
Cucumber requires step_definitions/ folder, support/ folder and support/env.rb in order to execute the tests.
-
Pages folder : it will keep the page object models of our web application. Check out Site Prism in order to start defining these models.
-
Step_Definitions folder: implementation details of the steps the tool automates; they are written using Ruby & Capybara.
-
Support folder: contains env.rb, which will set up the testing environment. Capybara configuration will be set here.
If you are curious (and feel intreped) you can verify how cucumber create this skeleton:
user@localhost:~/bdd_project$ cucumber --init
create features
create features/step_definitions
create features/support
create features/support/env.rb
Please, do not do this on your current project unless you want to loose all your content.
They provide a high-level description of the software features under test. For a complete reference, check Cucumber's Gherkin reference. As an example:
Feature: User can deposit money on his bank account
Scenario: User makes a deposit of 100$
Given the user has a bank account with 0$
When the user deposits 100$ on his account
Then the new balance of his account is 100$
ToDo
Enviromental variables used in the application
Contains cucumber profiles to be tested. The syntax is:
<profile_name>: -f pretty -f html -o reports/<html_output_file>.html --tags <profile_tag>
<profile_name> will be used in Rakefile to invoke the desired profile. Each one can have a different configuration.
<profile_tag> is the tag name given in the feature file, so you can group different test under a common tag. It starts with @ (for example, @user_login)
Describes which rake tasks are associated with the profiles previously defined on cucumber.yml . For example:
Cucumber::Rake::Task.new(:user_login) do |t|
t.profile = 'all'
end
You can reach the author on github or by email [email protected]
TBD