NCIOCPL / cgov-digital-platform-qa

QA Automation framework for the Cancer Gov Digital Platform
1 stars 10 forks source link

CancerGov Digital Platform QA Framework

This is the QA automation framework for the CancerGov Digital Communications Platform

Prerequisites:

Command line execution:

To run the default test suite (all tests), execute the command

mvn test

Specifying the environment

Hostnames are specified in the config.properties file, as environment.hostname.<NAME> (where <NAME> is the human-friendly name of the environment.) Each environment.hostname entry is a fully qualified hostname (e.g. environment.hostname.prod=www.cancer.gov).

The default runtime environment is specified as the value of the environment.active property. (e.g. environment.active=qa)

Specifying a test suite.

The entire set of tests is executed by default.

To execute a specific test suite, execute the command

mvn test -Dsurefire.suiteXmlFiles=<testfile>

Where <testfile> is the test suite file and path. e.g.

mvn test -Dsurefire.suiteXmlFiles=suites/cross-cutting.xml

Multiple test suites may be specified by separating them with commas.

Configuration

Most configuration appears in configuration/config.properties. Values in the configuration file may be overridden locally via configuration/config.override.properties (the override file is excluded from source control). Select configuration data may be overridden via command line parameters. The order of precedence is:

  1. Look for a value from the command line.
  2. Fallback to a value from config.override.properties.
  3. Fallback to the value in config.properties.

Folder Structure

Architecture

Tests in this framework follow the PageObject pattern.

The testing system makes use of the Selenium WebDriver browser automation project to control a web browser and read/modify page values.

All browser interactions are controlled using classes in the gov.cancer namespace in {proj_root}/src/main/java/gov/cancer/. High-level page objects are in the gov.cancer.pageobject namespace, with additional helper classes in gov.cancer.framework.

All test classes reside under the gov.cancer.tests namespace in {proj_root}/src/test/java/gov/cancer/tests. Test classes work with methods from the PageObjects. They do not import anything from the org.openqa.selenium namespace.

Tests are run using the TestNG framework.