Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Testing Framework

Table of Contents

Description

This repo is a skeleton automation framework for testing backend and frontend functionality of any given application. The ATF is enabling to test the integration of AWS components on different environments.

Key Features

  • API testing integration (supported protocols: REST)
  • Database testing operations (for validations, CRUD operations, etc.)
  • UI Testing
  • AWS component testing (e.g., S3, Lambda, DynamoDB)
  • All tests use BDD with Cucumber

Installation requirements

  • AWS CLI v2
  • Java 21 - Amazon Corretto 21.0.X
  • Maven
  • IntelliJ IDEA from JetBrains

Make sure Intellij IDEA plugins are installed

  • Cucumber for Java
  • Gherkin
  • Lombok

Install codestyle format setting ATF Code Style format

Settings -> Editor -> Code Style -> Scheme Import schema ATF-code-style-format.xml`

Running tests

Always use maven profile argument (-P) or Maven plugin checkboxes under Profiles folder to specify the application environment - dev/integration/test

Command line run

mvn clean test -P=<environment_specific_profile> -D<name_of_property_for_overriding>=<value>

Example:

mvn clean test -P test -Dlogging.level.root=debug

IntelliJ IDEA run

  • TestNG Configuration runner by executing the Runner Class under com.happytesting.runner
  • The play icon next to the scenario name in the feature file will trigger the Cucumber Java configuration runner, and need to provide in addition the Glue values like com.happytesting.stepdefs, com.happytesting.hook

Generate Allure report

mvn allure:report
  • Generated report path: target/site
  • Open report: target/site/allure-maven-plugin/index.html

Logs and evidence

All log files and additional evidences like screenshots, page sources, download and others, are stored under the target/logs folder

  • Execution log for the full run- target/logs/testRun/execution.log
  • Execution log per Scenario - target/logs/<timestamp_scenarion_name>/execution.log
  • Download or other files - target/logs/<timestamp_scenarion_name>/<download>

AWS credentials setup

For testing purposes use dedicated test credentials that need to be configured in AWS CLI

Before setting test user credentials, you have to configure your own

Step 1 - Generate your user Access Keys

  • Open the AWS Management Console and sign in using your user credentials
  • Under your account name choose the Security Credentials
  • In the Access keys section, choose Create access key.
  • Chose the Use Case the option Command Line Interface (CLI)
  • Proceed to Retrieve access keys and store the generated Access Keys (copy/paste or download csv)

Step 2 - Configure access keys - Configuration settings using commands

  • Set configurations

NOTE

Beside access keys will require following
region: eu-west-1
output: [leave it blank]
aws configure
  • View configurations
aws configure list

Step 3 - Configure test profiles

  • Request the test profile credentials from the owner of the repo or teammate and set in the same with following commands
  • Develop environment (aka d1)
aws configure --profile <services_name>
  • Automation environment (aka a1)
aws configure --profile <services_name>
  • Integration environment (aka i1)
aws configure --profile <services_name>
  • Test environment (aka t1)
aws configure --profile <services_name>
  • View configured profiles
aws configure list-profiles

Data Generator

The Data Generator feature has been added to the testing framework to streamline the preparation of large volumes of data required for specific Cucumber scenarios. This functionality allows for efficient data generation and storage prior to the test execution, significantly enhancing the performance and ease of tests that require a substantial amount of pre-prepared input.

How to Use

The data generation can be triggered before a test run using the -Dgenerate.data=true Maven parameter during the execution command.

   mvn clean test -P <environment_specific_profile> -Dgenerate.data=true

OR could be triggered individually from GenerateAggregateData test class as a simple TestNG unit test.

Execution Flow:

  • The -Dgenerate.data=true flag triggers the data generation logic.
  • The generated data is saved in a predefined location in CSV format (/target/logs/generator/<scenario_id>/<run_seed>/generated-aggregation-data.csv).
  • Once the data is prepared, the Cucumber test execution begins, and scenarios will reuse the CSV test data as reference by the scenario id value mapped between ScenariosProvider - ScenarioData.scenarioId defined in DataProvider and the value provided as argument to the Given step "<scenarioId>" have been processed by the system
  • For debugging the data and flow consider using:
    1. To regenerate the same data, use the Faker seed value from logs, and paste it to the property ppl.data.generation.seed
    2. Use partition type prefix value from logs to scan for all persisted data with begins_with(#Type, :partitionTypeKeyStart)
    3. Always check for the presence of the latest CSV file in the specified folder before running the tests to avoid test to be skipped with the assumption (the test pass rate won't be affected)

Troubleshooting

Issue: Unable to run mvn clean test

  • Solution: Ensure Java 21 and Maven are in your system PATH.

Issue: AWS profile not found

  • Solution: Double-check profile configurations with aws configure list-profiles.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages