Skip to content

Damounet/AngularCucumberTesting

Repository files navigation

Angular functionnal testing with CucumberJS

This project aims to give an implementation of Cucumber tests in an Angular application and propose a solution to let everyone be involved in your project testing.

This project is a fork of the Angular Tour of Heroes tutorial application, which already have functional tests. Tests have been duplicated and re-implemented in the Cucumber way.

Objectives

  • Involve the Product Owner (PO) / the business in the writing of the test documentation and having specifications while working in Agile method.
  • Compartmentalize the implementation of the tests so that:
    • The PO / business analysts are in charge of writing the scenarios (that can be used as acceptance criteria in a User Story). How to write features files
    • The Quality Assurance (QA) is in charge of implementing each step of the scenarios given by the PO. How to write steps files
    • The development team creates helpers called pages that will help the QA writing their tests. How to write pages files

Dependencies

Protractor Cucumber Framework to launch the test suite.

Cucumber JS is the javascript implementation of Cucumber.

Chai brings better assertion in our tests.

Installation

Install all the dependencies using :

yarn install

In order to run the protractors tests you need to get the selenium drivers with :

yarn webdriver-manager update

Running the tests

First you need to run the Tour of Heroes application :

yarn run start

To run tour of heroes functional tests:

protractor protractor-toh.conf.js

To run tour of heroes cucumber functional tests:

All cucumber tests :

yarn cucumber

InitialState tests :

yarn initialTest

Dashboard tests :

yarn dashboard

Heroes tests :

yarn heroes

HeroDetails tests :

yarn heroDetails

Messages tests :

yarn messages

For more information about running cucumber tests : https://github.com/cucumber/cucumber-js/blob/master/docs/cli.md

Generating the html report

After running the cucumber tests :

yarn report

Extract of all the known steps

Run :

yarn sentences

It outputs :

  • a csv file listing all the known steps and how many times each is used.
  • a markdown file listing all the known steps sorted out by keyword.

About

Testing the Tour of Heroes Tutorial app using cucumber.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published