Framework Overview - ChrisMell/OEL-wiki GitHub Wiki
The following section provides a high level overview of the DEL Test Automation Framework, Serenity BDD and the underlying packages that constitute the framework
DEL Test Automation Framework (DELTAF)
DELTAF is a test automation framework that leverages Serenity libraries, which allows for test cases to be quickly automated in a way that’s readable and business friendly. It's currently capable of running UI tests, but with future development, it can be extended to perform API and database testing. Testers can use a Maven command to run the test cases in Chrome, Firefox, and/or Edge browsers, which are explained in detail in the subsequent sections. DELTAF can also be integrated into CI/CD pipelines, an example of which is given in the 'Integration with Jenkins' section.
Serenity BDD
Serenity is a behavior driven development (BDD) library that offers several advantages for the test team. It contains built in libraries to handle common testing requirements, helping the testers get a head start when developing test cases. It’s completely open source and has a dedicated and lively community of users that can provide answers to troubleshooting questions. Serenity comes with tools for documentation and generating detailed reports of the execution results, and is highly customizable.
Pre-Requisite Knowledge Resources
In order to be able to utilize the capabilities of DELTAF, create and execute test cases and expand on the capabilities, below are the some knowledge resources to get started
Resource | Purpose |
---|---|
Java | Programming language used by the framework |
Cucumber | Testing software for writing BDD tests |
Gherkin | Language used by Cucumber in the feature files |
Serenity | Libraries for writing automated tests |
Git | Used for version control |
Getting Started
- GitHub Account - The first step is to get a GitHub account to be added as a collaborator to the repository. To get a Github account navigate to https://github.com/signup and register for an account
- Collaborator to DEL Florida - Once you have your GitHub account, request the owner of the DELFlorida account to add you as a collaborator. This will give access to the code, make changes to the repository and execute scripts
- Java Installation
The testers can download the JDK using the link below. The recommended version is Java 11.0.10, which can be found at this link.
To setup the environment variables, follow the steps below:
- Open “File Explorer” --> Right click “This PC” --> Click “Properties” --> Click “Advanced System Settings” --> Confirm elevation with credentials (if required) --> Click “Environment Variables”
- Add the following to your Path system variable if not present already (Left click “Path” --> click
“Edit”)
- Java Bin folder – e.g: C:\Program Files\Java\jdk-11.0.10\bin
- Setup new system variables (Click “New”)
- JAVA_HOME: - e.g C:\Program Files\Java\jdk-11.0.10
- CLASSPATH: %JAVA_HOME%\lib\tools.jar (as is)
- IntelliJ Installation - This is the recommended IDE for creating and maintaining the framework. IntelliJ has built in components for performing Git operations, creating run/debug configurations, and executing Maven goals.
- Downloading the repository - Go to this link and perform a 'git clone' to copy the repository to your local machine. This can be done from the web page or in IntelliJ.
Framework Components - Main
Overview
The main directory of the project contains core framework code used for the framework to function properly. Very rarely will classes in this section need to be changed unless you are adding new helper classes to support future tests. The table below describes what is found in each package.
Package | Description | Methods In This Package |
---|---|---|
java | Holds the core framework code, as well as two core java classes used during the maven build | PostExec.main(), PreExec.main() |
resources | houses property files used for database connection | None |
database | holds QueryOperation java interface, which is used when connecting to the database | QueryOperation.execute() (Note: Do not change this) |
exception | Holds a custom exception class used when tests encounter a database connection error. Custom exceptions can be stored here in the future if necessary | None |
framework.methods | Holds the ExcelMethods and MiscMethods classes, which has various custom methods used to read & write to excel for certain tests, and some miscellaneous methods used in the framework | getExcelMethods(), writeToExcel(), readFromExcel(), readFromExcelAtPath(), updateExcel(), combineObjectArray() |
helpers | Holds classes that serve to help core functions of the framework, and certain operations not related to specific tests.This includes classes such as the DbHelper, Constant, and PropertyReader | getSqlServerDatabaseConnection(), executeQueryCommand(QueryOperation), closeConnection(), parsePageSource(), jsoupToXpath(Element), getReportFilePathProperty() |
Framework Components - Test
Overview
The test directory of the project contains Java classes that have the page objects, steps for navigating the pages, and custom step definitions that can be referenced from the Gherkin test steps, in the feature file.
Package | Description |
---|---|
Coalition | This package contains Java classes for the custom step definitions, navigation steps, queries, page objects, and verify steps that are used for testing the coalition portal. |
Provider | This package contains Java classes for the custom step definitions, navigation steps, constants, queries, page objects, data handlers, helpers, and verify steps that are used for testing the provider portal. |
Family | This package contains Java classes for the custom step definitions and page objects that are used for testing the family portal. |
Definitions | This package contains a single Java class that has methods to get the actor and to set the stage. |
di | This package contains Java classes that allow the tester to save data for the duration of the test. They use private variables to store the data and getter/setter methods to retrieve and modify the data. There are classes for the provider context, provider profile, director info, instructor info, database connection, and a VPK application |
Login | This package contains Java classes that allow the tester to log in to the applications. There are classes for the step definitions, navigation steps, and page objects. |
Pages | This package contains Java classes that allow the framework to navigate the web driver to certain pages. There are classes for all three application login pages and a navigation class. |