Skip to content
RecipesDoc

Playwright and GitHub Actions in an Empty Repo

Certyn sets up a Playwright project and a GitHub Actions workflow that runs it, starting from an empty repository.

For teams that have no automated tests yet and want a working start: a Playwright project, first tests, and CI.

Your setup

  • A new, empty GitHub repo for the tests.
  • A web app on a test environment that Certyn already knows.
  • GitHub Actions as CI.

Say this to Certyn

Set up Playwright in github.com/acme/e2e, which is empty. Add tests for login and checkout and a GitHub Actions workflow. Push to main.

What Certyn does

  1. Opens the GH_TOKEN form. Make a fine-grained token for that repo with Contents Read and write and Workflows Read and write (the workflow permission, needed for any file in .github/workflows). Add Pull requests Read and write for later PRs.
  2. On its Machine, creates the Playwright project with TypeScript: config with the base URL from an environment variable, a tests/ folder, and a few first tests for the flows you named.
  3. Runs the tests against your environment until they pass.
  4. Adds .github/workflows/playwright.yml: install, install browsers, run the tests on push and pull request, keep the HTML report.
  5. An empty repo has no branch to open a pull request against. Because you asked, Certyn pushes this first commit to main. Later changes come as pull requests from certyn/... branches.

What you get

  • A Playwright project in your repo that runs locally and in GitHub Actions.
  • First tests for your main flows.
  • Later: add a test for X or fix the failing test gives a pull request.

Limits

  • Certyn does not set GitHub secrets or variables. Add the app URL (and any test account) in the repo's Settings → Secrets and variables → Actions, with the names the workflow uses.
  • Without the workflow permission, GitHub rejects the push of the workflow file. Certyn then shows you the file to add yourself.
  • Certyn pushes to main only when you ask. Turn on branch protection after the first commit.