Skip to main content

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

It couldn’t be simpler. Just use the AI chat to add the desired test schedule in your stably.yaml config.

Schedule Configuration

Most users should be able to simply define schedules using AI or the UI editor
Basic Configuration
stably.yaml
schedules:
  nightly-smoke:
    cron: "0 2 * * *"
    stablyTestArgs: "--project smoke --project mobile-smoke"
    timezone: "America/New_York"

  hourly-critical:
    cron: "0 * * * *"
    stablyTestArgs: "--project critical --grep @p0"
Each schedule consists of:
  • Schedule name: A descriptive identifier (e.g., nightly-smoke)
  • cron: A cron expression defining when to run
  • stablyTestArgs: Arguments passed to the Stably CLI (same as npx stably test) (optional)
  • timezone: IANA timezone string (e.g., America/New_York) (optional, defaults to UTC)
  • autofix: Automatically fix failing tests after each run (optional, see Autofix)

Cron Expression Format

Cron expressions use the standard UNIX format:
┌───────────── minute (0 - 59)
│ ┌───────────── hour (0 - 23)
│ │ ┌───────────── day of month (1 - 31)
│ │ │ ┌───────────── month (1 - 12)
│ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday)
│ │ │ │ │
│ │ │ │ │
* * * * *

Common Cron Patterns

# Every day at 2:00 AM UTC
cron: "0 2 * * *"

# Every day at 9:00 AM and 5:00 PM UTC
cron: "0 9,17 * * *"

# Every day at midnight UTC
cron: "0 0 * * *"
# Every hour on the hour
cron: "0 * * * *"

# Every 6 hours (00:00, 06:00, 12:00, 18:00)
cron: "0 */6 * * *"

# Every 15 minutes
cron: "*/15 * * * *"
# Every Monday at 9:00 AM UTC
cron: "0 9 * * 1"

# Every weekday (Mon-Fri) at 8:00 AM UTC
cron: "0 8 * * 1-5"

# Every Sunday at midnight UTC
cron: "0 0 * * 0"
# First day of every month at 2:00 AM UTC
cron: "0 2 1 * *"

# Last day of every month (use 28-31)
cron: "0 2 28-31 * *"

# 15th of every month at noon UTC
cron: "0 12 15 * *"
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, or DEC
  • You cannot configure both day of month and day of week simultaneously
  • The default timezone is UTC. You can override it per schedule with the timezone field

Schedule Arguments

The stablyTestArgs field accepts the same arguments as the npx stably test command:
Run specific Playwright projects:
stablyTestArgs: "--project smoke"

# Multiple projects
stablyTestArgs: "--project smoke --project critical"
Filter tests using patterns:
# Run only P0 tests
stablyTestArgs: "--grep @p0"

# Combine project and grep
stablyTestArgs: "--project critical --grep @p0"
Control parallelism:
# Use 50 parallel workers
stablyTestArgs: "--project regression --workers 50"
Set environment for test data:
stablyTestArgs: "--project smoke --env PRODUCTION"

Complete Examples

stably.yaml
schedules:
  # Run smoke tests every hour
  hourly-health-check:
    cron: "0 * * * *"
    stablyTestArgs: "--project smoke"

  # Full regression nightly with autofix
  nightly-regression:
    cron: "0 2 * * *"
    stablyTestArgs: "--project regression --project e2e"
    autofix: true

How Schedules Work

1

Configuration

Define schedules in stably.yaml in your repository root
2

Deployment

Publish your changes
3

Automatic Execution

Stably runs your tests at the scheduled times in the configured timezone (UTC by default)
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)

Use Descriptive Names

Name schedules clearly to indicate what and when (e.g., weekday-morning-smoke)
  • Run smoke tests frequently (every 15-60 minutes)
  • Run comprehensive regression suites less often (daily/weekly)
  • Use --grep to run only priority tests more frequently
  • Schedule resource-intensive tests during off-peak hours
  • Run nightly regressions when usage is low
  • Consider weekend runs for comprehensive testing
  • Create different schedules for different test types
  • Separate production monitoring from staging validation
  • Balance frequency with test importance
  • 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

Problem: Scheduled tests aren’t executingSolution:
  • Verify stably.yaml is in repository root
  • Check cron expression syntax using crontab.guru
  • Verify project names match your playwright.config.ts
Problem: Tests run at unexpected timesSolution:
  • Schedules default to UTC unless a timezone is specified
  • Use the timezone field to run in your local timezone (e.g., timezone: "America/New_York")
  • Use a timezone converter to verify the schedule
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

schedules:
  <schedule-name>:
    cron: "<cron-expression>"
    stablyTestArgs: "<cli-arguments>"
    timezone: "<iana-timezone>"

Field Definitions

FieldTypeRequiredDescription
schedulesobjectYesRoot object containing all schedule definitions
<schedule-name>stringYesUnique identifier for the schedule
cronstringYesStandard UNIX cron expression (5 fields)
stablyTestArgsstringNoArguments passed to npx stably test
timezonestringNoIANA timezone (e.g., America/New_York). Defaults to UTC
autofixbooleanNoAutomatically run stably fix on failing tests after the run completes
The stably.yaml file also supports agent configuration. See CLI Agent Configuration for details.

Valid stablyTestArgs

ArgumentExampleDescription
--project--project smokeRun specific Playwright project
--grep--grep @p0Filter tests by pattern
--workers--workers 50Set parallel worker count
--env--env STAGINGSet environment for variables
--retries--retries 2Configure test retries

Next Steps