Shared Steps
Reuse common test steps across multiple test cases. Create shared steps for login, setup, and other repeated actions to reduce maintenance.
Shared Steps
Shared steps are reusable test step sequences that can be included in multiple test cases.
What are Shared Steps?
Instead of repeating the same steps in every test case, you define them once as shared steps and reuse them wherever needed. This follows the DRY (Don't Repeat Yourself) principle and makes test maintenance much easier.
How Shared Steps Work
- Define Once: Create a shared step sequence (e.g., "User Login")
- Reuse Everywhere: Reference the shared step in any test case
- Update Centrally: Changes to the shared step automatically apply to all test cases using it
Example: Login Shared Step
Shared Step Definition:
1. Navigate to /login
2. Enter email: {email}
3. Enter password: {password}
4. Click Login button
5. Verify redirect to dashboardUsed in Test Cases:
- "Login as Admin" → uses Login shared step with admin credentials
- "Login as Regular User" → uses Login shared step with user credentials
- "Login with Invalid Password" → uses Login shared step, expects failure
Shared Step Parameters
Shared steps support parameters for dynamic values:
{email}: Different email per test case{username}: Different username per test case{product_id}: Different product in each test
Benefits
- Consistency: All tests use the same steps the same way
- Maintenance: Update once, apply everywhere
- Clarity: Test cases are shorter and easier to read
- Reliability: Reduces copy-paste errors
Common Use Cases
- Login/Logout: Standard authentication sequences
- Setup/Teardown: Creating test data before testing, cleaning up after
- Navigation: Common page navigation patterns
- Data Creation: Standard entity creation (users, products, orders)
Related
- Test Cases - Tests that use shared steps
Test Plans
Schedule and organize test execution with test plans. Select test cases from suites, assign testers, and track completion status.
Test Launches - Track Execution Results & Analytics
Track test execution results with launches. Understand launch lifecycle, sources (manual vs CLI), analytics, and how to monitor pass rate trends in Qualflare.