Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/frameworkium/frameworkium-bdd

Integration of Cucumber BDD and frameworkium-core to offer support for using tests written as feature files.
https://github.com/frameworkium/frameworkium-bdd

automation bdd cucumber-jvm selenium selenium-webdriver

Last synced: about 2 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# Frameworkium-BDD

![build](https://github.com/frameworkium/frameworkium-bdd/workflows/frameworkium-bdd%20build/badge.svg)
![release](https://img.shields.io/github/v/release/frameworkium/frameworkium-bdd)

This is a Cucumber implementation of [Frameworkium][frameworkium],
it utilises [frameworkium-core][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](https://frameworkium.github.io/#_pages/Command-Line-Options.md)
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](https://cucumber.io/docs/cucumber/api/#tags).

### 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](https://frameworkium.github.io/#_pages/Allure-Reporting.md) 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](https://frameworkium.github.io/#_pages/ZephyrJiraLogging.md)* for more info

[status-svg]: https://travis-ci.org/Frameworkium/frameworkium-bdd.svg?branch=master
[status]: https://travis-ci.org/Frameworkium/frameworkium-bdd
[frameworkium]: https://github.com/Frameworkium/frameworkium
[core]: https://github.com/Frameworkium/frameworkium-core