Skip to content

Commit

Permalink
Add screenshots, upload to github
Browse files Browse the repository at this point in the history
  • Loading branch information
blackary committed Sep 29, 2023
1 parent 466f50a commit 9330376
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ jobs:
playwright install --with-deps
- name: Test with tox
run: tox
- uses: actions/upload-artifact@v3
if: failure()
with:
name: screenshots
path: screenshot*.png
7 changes: 6 additions & 1 deletion tests/test_frontend_sections.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def test_deprecation_warning(page: Page):

def test_in_section_false(page: Page):
sleep(0.5)
page.screenshot(path="screenshot_sections2.png")
bbox_not_in_section = (
page.get_by_role("link", name="Example Five")
.get_by_text("Example Five")
Expand All @@ -100,7 +101,11 @@ def test_in_section_false(page: Page):

# Check that the in_section=False page is at least 10 pixels to the left of the
# in_section=True page
assert bbox_not_in_section["x"] < bbox_in_section["x"] - 10
try:
assert bbox_not_in_section["x"] < bbox_in_section["x"] - 10
except AssertionError as e:
page.screenshot(path="screenshot_sections3.png")
raise e


def test_page_hiding(page: Page):
Expand Down

0 comments on commit 9330376

Please sign in to comment.