This is the QA automation framework for the CancerGov Digital Communications Platform
- JDK 1.8.0_144 or later
- Oracle's download site
- Installation Instructions Windows Mac
- Apache maven tool
- On Mac:
- Install Homebrew
brew install maven
- On Mac:
To run the default test suite (all tests), execute the command
mvn test
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
)
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.
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:
- Look for a value from the command line.
- Fallback to a value from
config.override.properties
. - Fallback to the value in
config.properties
.
configuration
- Main configuration filesresources/drivers
- Driver files for different browsers on differnt platforms.src
- The source code for this suite.src/main/java/gov/cancer/framework
- utility classes used by page objects.src/main/java/gov/cancer/pageobject
- the page object classes used for testing.src/test/java/gov/cancer/tests
- the test classes.
suites
- TestNG test suite files.target
- Generated files. (Not version controlled.)test-data
- Like it says on the label.test-output
- Reports and the like. (Not version controlled.)
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.