- Description
- Installation Requirements
- Running Tests
- Generate Allure Report
- Logs and Evidence
- AWS Credentials Setup
- Data Generator
- Troubleshooting
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.
- 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
- 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`
Always use maven profile argument (-P) or Maven plugin checkboxes under Profiles folder to specify the application environment - dev/integration/test
mvn clean test -P=<environment_specific_profile> -D<name_of_property_for_overriding>=<value>
Example:
mvn clean test -P test -Dlogging.level.root=debug- 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
mvn allure:report- Generated report path:
target/site - Open report:
target/site/allure-maven-plugin/index.html
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>
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
- 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- 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-profilesThe 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.
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=trueOR could be triggered individually from GenerateAggregateData test class as a simple TestNG unit test.
Execution Flow:
- The
-Dgenerate.data=trueflag 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.scenarioIddefined 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:
- To regenerate the same data, use the Faker seed value from logs, and paste it to the property
ppl.data.generation.seed - Use partition type prefix value from logs to scan for all persisted data with
begins_with(#Type, :partitionTypeKeyStart) - 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)
- To regenerate the same data, use the Faker seed value from logs, and paste it to the property
- Solution: Ensure Java 21 and Maven are in your system PATH.
- Solution: Double-check profile configurations with
aws configure list-profiles.