The BDD Test Automation Framework provides an efficient , scalable , and maintainable approach to automating acceptance and Regression tests using Behavior-Driven Development (BDD) principles. This framework is built on industry-standard tools and integrates seamlessly with cucumber,Selenium WebDriver and TestNG
By using Gherkin syntax to define test acses , this framework bridges the gap between business stakeholders and Technical Teams ensuring the shared understanding of system Behavior.The goal is to enable teams to automate tests that are both highly readable and easily maintainable.
This framework also supports parallel test excexution,comprehensive reporting and is easily extendable for integrating with continuous integration / continuous deployment (CI/CD) pipelines
Before you can use the framework , ensure that you have the following installed on your system:
- Java 11 or higher (for running the Tests)
- Maven (for project Management and dependency handling)
- Cucumber(for BDD Testing)
- Selenium WebDriver(for browser automation)
- TestNG(for test Execution)
Optional Tools
- IDE (IntelliJIDEA,Eclipse,Visual Studio,etc)
- Browser drivers(chromeDriver,GeckoDriver,etc)
git clone https://github.com/BAH-RADx/RADx-AutomatedTesting
cd RADx-AutomatedTestingmvn clean installconfigure the framework by editing the env in environment.properties file in src/test/resources directory and specify the browser name , test url in (dev,test,prod) properties files in src/test/resources
env=testbrowser=chrome/chromeHeadless
windowsize=true
webdriverwait=60
url = <<your url here>> Scenario: Curator - public Data - Add files to the workbench
Given the user navigates to the login page of RADx
When the user logs in with "curator" credentials
Then the user is taken to the user dashboard
Then the user click Data Access >> Public Data
And the user can able to select All , unselect All Files
And the user can able to select Files and Download Zip Files
And the user can able to select Files based on Filter Type
And the user can able to launch workbench
And the user can able to sort the table data
And the user can able to select files and add to the workbench@Then ("the user click Data Access >> Public Data")
public void clickpublicData() {
PublicDataPage.clickpublicData();
}
@And ("the user can able to select All , unselect All Files")
public void select_Deselect_all() {
PublicDataPage.validateSelect();
PublicDataPage.validateUnSelect();
}@FindBy(xpath="//a[text()='Data Access']")
public WebElement DataAccess;
public void clickpublicData() {
click(DataAccess);
waitForTimeInMilliSecs(5000);
click(publicdata);
waitForTimeInMilliSecs(5000);
}To Execute tests , you can use Maven or run them directly from IDE
mvn clean test1.Open the project in your prefered IDE. 2.Navigate to the TestRunner.java file in the src/test/java directory 3.Right click on the file and select Run
Cucumber provides powerful reporting capabilities . you can generate HTML reports
plugin= {
"pretty",
"html:target/cucumber-reports/report.html"
},This project automates API testing using Postman collections, executed via Newman CLI. It integrates with GitHub Actions for CI/CD and generates detailed HTML reports for test results.
- Node.js (v14+)
- npm
- Postman
- Newman (
npm install -g newman) - GitHub account
- Clone the repository
git clone https://github.com/BAH-RADx/RADx-AutomatedTesting cd RADx-AutomatedTesting/APITesting
Install dependencies
npm install- Project Structure
collections/ - Postman collections (.json)
environments/ - Postman environment files
.github/workflows/ - GitHub Actions workflow files
reports/ - Generated HTML reports
- Writing Tests
- Create or update Postman collections in the collections/ directory.
- Use Postman to define requests, tests, and environment variables.
-
Running Tests Locally
Run the following command to execute tests and generate an HTML report:
newman run collections/<your-collection>.json \
-e environments/<your-environment>.json \
-r cli,html \
--reporter-html-export reports/report.html-
CI/CD Integration with GitHub Actions
Tests are automatically run on every push or pull request via GitHub Actions. Workflow file: .github/workflows/api-tests.yml Example workflow step:
- name: Run API Tests
run: |
newman run collections/<your-collection>.json \
-e environments/<your-environment>.json \
-r cli,html \
--reporter-html-export reports/report.html
-
Report Generation
After test execution, HTML reports are available in the reports/ directory. View reports/report.html for detailed results.
