Get Started
Best Practices
Best practices for writing tests in Revyl.
Write Clear and Effective Tests
Create tests that read like well-structured guides while thoroughly examining your application. For optimal clarity and maintainability:
- Targeted Focus – Each test should validate just one functionality or behavior, making debugging straightforward.
- Simplicity First – Keep test steps uncomplicated. When complex setup is needed, utilize Modules for better organization.
- Precise Assertions – Craft assertions that mirror actual user interactions, ensuring key behaviors are verified without excessive detail.
Adopt the STAR Approach
The STAR approach offers a structured methodology for creating robust and maintainable tests:
- Setup - Prepare the test environment and establish prerequisites
- Trigger - Execute the specific action or functionality being tested
- Assert - Verify results match expected outcomes
- Reset - Clean up and return the system to its original state
Leverage Modules for Reusability
Encapsulate common actions in Test Modules to create more maintainable tests:
- Reduce Redundancy – Package frequently used interactions into reusable components.
- Maintainability – Update functionality in one location rather than across multiple test cases.
Utilize Variables for Flexibility
Incorporating variables into your tests enhances adaptability and maintainability:
- Data-Driven Testing – Execute tests with multiple data sets without duplicating test logic.
- Credential Management – Store sensitive information securely and reference it without hardcoding.
- Dynamic Content Handling – Adapt to changing content by updating variables rather than test steps.
- Parameterization – Create more generic test steps that can be reused with different inputs.