Coder Social home page Coder Social logo

donniezhanggit / frameworkium-bdd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from frameworkium/frameworkium-bdd

0.0 0.0 0.0 1.12 MB

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

License: Apache License 2.0

Java 93.45% Gherkin 6.55%

frameworkium-bdd's Introduction

Frameworkium-BDD Build Status

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

frameworkium-bdd's People

Contributors

5a4fa0dc42c6f avatar gitnikos avatar ham1 avatar robertgates55 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.