Skip to content

Commit

Permalink
Set up Playwright tests using GitHub Actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Mae authored and Joshua Mae committed May 29, 2024
1 parent 570ca33 commit 3b7bf8e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Playwright Tests

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
playwright install
- name: Run Playwright tests
run: |
pytest tests/
9 changes: 9 additions & 0 deletions playwright-tests/first_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from playwright.sync_api import sync_playwright

def test_example():
with sync_playwright() as p:
browser = p.chromium.launch()
page = browser.new_page()
page.goto("https://joshuamae.com")
assert page.title() == "Joshua Mae"
browser.close()
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
playwright
pytest

0 comments on commit 3b7bf8e

Please sign in to comment.