Skip to content

radxdatahub/AutomatedTesting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RADx-AutomatedTesting

Functional Testing

OverView

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

Table of Contents

1.Prerequisites

2.Installation

3.Project Structure

4.Writing Tests

5.Running Tests

6.Report Generation

Prerequisites

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)

Installation

Clone the repository

 git clone https://github.com/BAH-RADx/RADx-AutomatedTesting
 cd  RADx-AutomatedTesting

Install Dependencies

mvn clean install

Configuration

configure 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=test
browser=chrome/chromeHeadless
windowsize=true
webdriverwait=60
url = <<your url here>>

ProjectStructure

folder structure

WritingTests

Feature Files

 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

Step definitions

@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();
   }

Page Object Model (POM)

@FindBy(xpath="//a[text()='Data Access']")
  public WebElement DataAccess;
  	public void clickpublicData() {
  	click(DataAccess);
  	waitForTimeInMilliSecs(5000);
  	click(publicdata);
  	waitForTimeInMilliSecs(5000);
  }

RunningTests

To Execute tests , you can use Maven or run them directly from IDE

using Maven

mvn clean test

using IDE

1.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

ReportGeneration

Cucumber provides powerful reporting capabilities . you can generate HTML reports

plugin= {
		"pretty",
		"html:target/cucumber-reports/report.html"
},

API Testing

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.

Prerequisites

  • Node.js (v14+)
  • npm
  • Postman
  • Newman (npm install -g newman)
  • GitHub account

Installation

  1. Clone the repository
    git clone https://github.com/BAH-RADx/RADx-AutomatedTesting
    cd RADx-AutomatedTesting/APITesting

Install dependencies

npm install
  1. Project Structure

collections/ - Postman collections (.json)
environments/ - Postman environment files
.github/workflows/ - GitHub Actions workflow files
reports/ - Generated HTML reports
  1. Writing Tests
  • Create or update Postman collections in the collections/ directory.
  • Use Postman to define requests, tests, and environment variables.
  1. 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
  1. 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
  1. Report Generation

    After test execution, HTML reports are available in the reports/ directory. View reports/report.html for detailed results.

About

Automation Testing Framework for Data Hub

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors