Overview
Schedule automatic test runs using cron expressions to continuously monitor your application. Stably runs your configured Playwright projects on the schedule you define.Defining Schedules
Create astably.yaml file in the root of your repository to configure scheduled test runs.
Basic Configuration
stably.yaml
- Schedule name: A descriptive identifier (e.g.,
nightly-smoke) - cron: A cron expression defining when to run
- stablyArgs: Arguments passed to the Stably CLI (same as
npx stably test)
Cron Expression Format
Cron expressions use the standard UNIX format:Common Cron Patterns
Daily Schedules
Daily Schedules
Hourly Schedules
Hourly Schedules
Weekly Schedules
Weekly Schedules
Monthly Schedules
Monthly Schedules
Use crontab.guru to easily validate and understand your cron expressions.
Cron Expression Limitations
- Stably crons do not support alternative expressions like
MON,SUN,JAN, orDEC - You cannot configure both day of month and day of week simultaneously
- The timezone is always UTC
Schedule Arguments
ThestablyArgs field accepts the same arguments as the npx stably test command:
Project Selection
Project Selection
Run specific Playwright projects:
Test Filtering with Grep
Test Filtering with Grep
Filter tests using patterns:
Worker Configuration
Worker Configuration
Control parallelism:
Environment Variables
Environment Variables
Set environment for test data:
Complete Examples
- Basic Monitoring
- Weekday Testing
- Multi-Environment
- Priority-Based
stably.yaml
How Schedules Work
1
Configuration
Define schedules in
stably.yaml in your repository root2
Deployment
Deploy your tests and configuration:
3
Automatic Execution
Stably runs your tests at the scheduled times in UTC timezone
4
Results & Notifications
View results in your dashboard and receive notifications based on your notification settings
Best Practices
Match Testing Frequency to Risk
Run critical tests more frequently (hourly) and comprehensive suites less often (daily/weekly)
Consider Time Zones
All schedules run in UTC. Plan around your team’s working hours and off-peak times
Use Descriptive Names
Name schedules clearly to indicate what and when (e.g.,
weekday-morning-smoke)Balance Coverage and Cost
More frequent runs provide faster feedback but consume more resources
Optimize for Fast Feedback
Optimize for Fast Feedback
- Run smoke tests frequently (every 15-60 minutes)
- Run comprehensive regression suites less often (daily/weekly)
- Use
--grepto run only priority tests more frequently
Leverage Off-Peak Hours
Leverage Off-Peak Hours
- Schedule resource-intensive tests during off-peak hours
- Run nightly regressions when usage is low
- Consider weekend runs for comprehensive testing
Use Multiple Schedules
Use Multiple Schedules
- Create different schedules for different test types
- Separate production monitoring from staging validation
- Balance frequency with test importance
Monitor Schedule Performance
Monitor Schedule Performance
- Review execution times and adjust schedules accordingly
- Ensure tests complete before the next scheduled run
- Optimize slow tests that delay feedback
Viewing Scheduled Runs
1
Access Dashboard
Navigate to your project in the Stably dashboard
2
View Scheduled Runs
See all scheduled test runs with:
- Schedule name and configuration
- Last execution time and results
- Next scheduled execution time
- Execution history and trends
3
Review Results
Click on any run to see:
- Detailed test results with pass/fail status
- Screenshots and traces for failures
- AI-powered failure analysis
- Historical trends and flakiness detection
Troubleshooting
Schedules Not Running
Schedules Not Running
Problem: Scheduled tests aren’t executingSolution:
- Verify
stably.yamlis in repository root - Ensure you’ve run
npx stably deployafter creating/updating schedules - Check cron expression syntax using crontab.guru
- Verify project names match your
playwright.config.ts
Incorrect Run Times
Incorrect Run Times
Problem: Tests run at unexpected timesSolution:
- Remember all schedules run in UTC timezone
- Convert your local time to UTC for the cron expression
- Use a timezone converter to verify the schedule
Tests Taking Too Long
Tests Taking Too Long
Problem: Scheduled runs don’t complete before the next run startsSolution:
- Increase worker count in
stablyArgs(e.g.,--workers 50) - Reduce schedule frequency to allow tests to complete
- Optimize slow tests or remove non-critical tests
- Split into multiple schedules with different test sets
Invalid Cron Expression
Invalid Cron Expression
Problem: Schedule not accepted or parsing errorsSolution:
- Use standard 5-field cron format only
- Don’t use named days/months (
MON,JAN, etc.) - Don’t combine day-of-month and day-of-week
- Validate using crontab.guru
Complete Configuration Reference
Schedule Entry Structure
Field Definitions
| Field | Type | Required | Description |
|---|---|---|---|
schedules | object | Yes | Root object containing all schedule definitions |
<schedule-name> | string | Yes | Unique identifier for the schedule |
cron | string | Yes | Standard UNIX cron expression (5 fields) |
stablyArgs | string | No | Arguments passed to npx stably test |
Valid stablyArgs
| Argument | Example | Description |
|---|---|---|
--project | --project smoke | Run specific Playwright project |
--grep | --grep @p0 | Filter tests by pattern |
--workers | --workers 50 | Set parallel worker count |
--env | --env STAGING | Set environment for variables |
--retries | --retries 2 | Configure test retries |