Michael S.
Michael S.

Reputation: 701

Github Actions: How to setup a Cronjob that runs automated Playwright tests (once a day)

I would like to run automated Playwright tests with Github Actions. I created a cronjob for this, but it has no effect. What else should I consider? Here is the content of my .github/workflows/playwright.yml:

name: Playwright Tests
on:
  push:
    branches: [ main, master ]
  pull_request:
    branches: [ main, master ]
  schedule:
    - cron: '12 14 * * Mon-Fri'
jobs:
  test:
    timeout-minutes: 60
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-node@v2
      with:
        node-version: '14.x'
    - name: Install dependencies
      run: npm ci
    - name: Install Playwright Browsers
      run: npx playwright install --with-deps
    - name: Run Playwright tests
      run: npx playwright test
    - uses: actions/upload-artifact@v2
      if: always()
      with:
        name: playwright-report
        path: playwright-report/
        retention-days: 30

Upvotes: 0

Views: 1907

Answers (2)

Alapan Das
Alapan Das

Reputation: 18624

In the future, if you have to create cron jobs, I can recommend crontab.guru. Its UI is simple to create effective cron schedules.

Crontab guru screenshot

Upvotes: 1

Michael S.
Michael S.

Reputation: 701

The run came 2 hours late. Patience is required here.

Upvotes: 0

Related Questions