-
Notifications
You must be signed in to change notification settings - Fork 3
How to build custom test cases with AWS Greengrass Testing Framework
Rafe Luan edited this page Nov 30, 2022
·
3 revisions
AWS Greengrass Testing Framework offers developers some easy ways to build your custom test cases. There are 2 steps you can follow.
- A Feature File is an entry point to the Cucumber tests. This is a file where you will describe your tests in descriptive language (like English). It is an essential part of Cucumber, as it serves as an automation test script as well as live documents.
-
aws-greengrass-testing-features module contains feature files for all the test cases.
- Existing Greengrass Components
- Need to add just the feature file. Example.
- Custom Components
- Create component in aws-greengrass-testing-components, e.g. Mqtt components.
- Add recipe file in resources folder of corresponding sub-module of aws-greengrass-testing-features. Example.
- Add feature file to same resources folder.
- Existing Greengrass Components
- A Step Definition is a Java method with an expression that links it to one or more Gherkin steps. When Cucumber executes a Gherkin step in a scenario, it will look for a matching step definition to execute.
- Common Step definitions exist in aws-greengrass-testing-features-api, which is the sub-module of aws-greengrass-testing-features, additional steps related to common feature deployment, resources, etc, could be added to existing corresponding Step classes.
- If step definitions specific to the the component need to be added then they could be added to src folder of feature sub-module like MqttSteps (specific for mqtt component).