Skip to content

Commit

Permalink
chore: proof of concept changes to install playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
angela-tran committed Oct 9, 2024
1 parent 58e3cfd commit 2ee66e5
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ USER $USER
# install devcontainer requirements
RUN pip install -e .[dev,test]

# USER root
# RUN pip install playwright
# RUN pip install pytest-playwright playwright -U
# RUN playwright install-deps

# USER $USER
# RUN playwright install

# docs requirements are in a separate file for the GitHub Action
COPY docs/requirements.txt docs/requirements.txt
RUN pip install -r docs/requirements.txt
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ dev = [
test = [
"coverage",
"pytest",
"playwright",
"pytest-django",
"pytest-mock",
"pytest-playwright",
"pytest-socket",
]

Expand Down
21 changes: 21 additions & 0 deletions test_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import re
from playwright.sync_api import Page, expect


def test_has_title(page: Page):
page.goto("https://dev-benefits.calitp.org/")

# Expect a title "to contain" a substring.
expect(page).to_have_title(re.compile("Cal-ITP"))


def test_get_started_link(page: Page):
page.goto("https://dev-benefits.calitp.org/")

# Click the Choose your provider link.
page.get_by_text("Choose your provider").click()

page.get_by_text("California State Transit (dev)").click()

# # Expects page to have a heading with the name of Installation.
# expect(page.get("heading", name="Installation")).to_be_visible()

0 comments on commit 2ee66e5

Please sign in to comment.