Skip to content

Commit

Permalink
test: take a screenshot of frontend for visual inspection
Browse files Browse the repository at this point in the history
  • Loading branch information
afuetterer committed Nov 30, 2023
1 parent 7a76824 commit 97092cc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,17 @@ jobs:
npm run build:prod
playwright install chromium
if: matrix.python-version == '3.12' && matrix.db-backend == 'postgres'
- run: mkdir screenshots
- name: Run end-to-end tests
run: pytest -p randomly -p no:cacheprovider --reuse-db --numprocesses=auto --dist=loadscope -m e2e --nomigrations
if: matrix.python-version == '3.12' && matrix.db-backend == 'postgres'
env:
DJANGO_DEBUG: True
GITHUB_DB_BACKEND: ${{ matrix.db-backend }}
- uses: actions/upload-artifact@v3
with:
name: screenshots
path: screenshots

coveralls:
name: Indicate completion to coveralls
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ dist
.on-save.json

rdmo/management/static

screenshots
4 changes: 4 additions & 0 deletions rdmo/management/tests/test_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ def test_management_navigation(logged_in_admin_user: Page, helper: ModelHelper)
url_name = url_name.replace(" ", "")
expect(page).to_have_url(re.compile(rf".*/{url_name}/"))

# take a screenshot for visual inspection
if helper.model == Catalog:
page.screenshot(path="screenshots/management-navigation-catalog.png", full_page=True)


@pytest.mark.parametrize("helper", model_helpers)
def test_management_has_items(logged_in_admin_user: Page, helper: ModelHelper) -> None:
Expand Down

0 comments on commit 97092cc

Please sign in to comment.