Skip to content

Integration of Cucumber BDD and frameworkium-core to offer support for using tests written as feature files.

License

Notifications You must be signed in to change notification settings

Frameworkium/frameworkium-bdd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frameworkium-BDD

build release

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.

Getting Started

  1. Clone this project git clone https://github.com/Frameworkium/frameworkium-bdd.git
  2. Create your own package for your project under src/test/java
  3. Create a glue package within your project package where you will put all your step definition classes
  4. Add your glue packages to the glue parameter of the @CucumberOptions inside UITestRunner and APITestRunner
  5. Create a pages package within your project package where you will put your page object classes
  6. Create feature files in src/test/resources/features
  7. Run all tests using mvn clean verify

Project Layout

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

Running Tests

Command Line Options

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.

Examples

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.

API tests

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.

Parallel Execution

Works the same as in core e.g. -Dthreads=4.

Reporting

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.

Zephyr Integration

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