Skip to content

Commit

Permalink
chore: tweaks for workshop session
Browse files Browse the repository at this point in the history
  • Loading branch information
angela-tran committed Oct 9, 2024
1 parent 2ee66e5 commit 640083f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ 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 root
RUN pip install pytest-playwright playwright -U
RUN playwright install-deps

# USER $USER
# RUN playwright install
USER $USER
RUN playwright install

# docs requirements are in a separate file for the GitHub Action
COPY docs/requirements.txt docs/requirements.txt
Expand Down
21 changes: 21 additions & 0 deletions run_playwright.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Basic command (runs Chromium)

pytest -k test_example --headed --slowmo 1000

# (From here, run second test only in the interest of time)

# Use --browser to run with a different browser

# pytest -k test_get_started_link --headed --browser firefox

# Use --device to run with different viewports

# pytest -k test_get_started_link --headed --device "iPhone 13"

# Run in debug mode (https://playwright.dev/python/docs/running-tests#debugging-tests)

# PWDEBUG=1 pytest -s -k test_get_started_link

# More CLI options:
# https://playwright.dev/python/docs/test-runners
# https://playwright.dev/python/docs/running-tests#command-line
8 changes: 8 additions & 0 deletions test_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,13 @@ def test_get_started_link(page: Page):

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

page.get_by_label("Medicare Cardholder").click()

page.get_by_text("Choose this benefit").click()

page.get_by_text("Continue to Medicare.gov").click()

page.wait_for_timeout(5000)

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

0 comments on commit 640083f

Please sign in to comment.