This is a Cucumber implementation of Frameworkium, it utilises frameworkium-core with an added BDD layer, provided by Cucumber-JVM, to give you a BDD Automation solution.
- Clone this project
git clone https://github.com/Frameworkium/frameworkium-bdd.git - Create your own package for your project under
src/test/java - Create a
gluepackage within your project package where you will put all your step definition classes - Add your glue packages to the
glueparameter of the@CucumberOptionsinsideUITestRunnerandAPITestRunner - Create a
pagespackage within your project package where you will put your page object classes - Create feature files in
src/test/resources/features - Run all tests using
mvn clean verify
Frameworkium-BDD uses conventional Cucumber-JVM layout as shown below. The main
package and features package path is already configured within the pom.xml so
that TestNG knows where all the necessary components are when tests are run.
The layout looks something like this
.
├── src/
| ├── test/
| ├── java/
| | └── com.your.package/
| | ├── glue/
| | | └──SomeSteps.java
| | └── pages/
| | └──PageObject.java
| └── resources/
| ├── features/
| | └── Feature_file.feature
└── pom.xml
An overview of some of the important packages.
| Package/file | Description |
|---|---|
| glue | Contain your 'step definition' classes (e.g SomeSteps.java) which join together the page objects with the feature files |
| pages | Contain page object classes |
| features | Contain your 'feature files' which hold all your test scenarios |
See the main Frameworkium docs
for the full list of command line options.
The only addition we have made is adding a tags parameter to select the
cucumber tests you to run (this replaces the tests and groups TestNG parameters used in Frameworkium).
If no tag property is set all tests, excluding those tagged with @ignore will be executed.
Run all tests with the @smoke tag
mvn clean verify -Dcucumber.options="--tags @smoke"
Run all test that do NOT have the tag @wip
mvn clean verify -Dcucumber.options="--tags not @wip"
Run all test that have the tag @p1 OR @smoke
mvn clean verify -Dcucumber.options="--tags @p1,@smoke"
Comprehensive docs on cucumber tagging can be found on the official cucumber docs.
Tag your API Scenarios with the @api tag so the APITestRunner is used,
otherwise a browser window will be opened for each test, slowing it down!
This also means you could have UI and API scenario's in the same feature file if you wished.
You can also use one tag at the feature level to create an API runner for all tests in the feature file.
Works the same as in core e.g. -Dthreads=4.
The Allure reporting used in Frameworkium is also used with this framework
generated by running mvn allure:report.
See the main Frameworkium docs for more info.
You can also report test results back to zephyr although a different tag is
required from Frameworkium in the format @TestCaseId(TEST-1).
See the main Frameworkium docs for more info