Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(e2e): homepage screenshot tests #2033

Merged
merged 11 commits into from
Aug 20, 2024

Conversation

DenysKarmazynDFINITY
Copy link
Contributor

@DenysKarmazynDFINITY DenysKarmazynDFINITY commented Aug 16, 2024

Motivation

The goal of this PR is to add basic snapshot tests for homepage (user logged in and logged out states).

Changes

  1. Basic Playwright code.
  2. To properly compare homepage screenshots, I deactivate the infinite Hero background animation before taking a snapshot.
  3. Added data-tid to the related elements on the page.

Tests

Please see the committed screenshots.

@DenysKarmazynDFINITY DenysKarmazynDFINITY requested a review from a team as a code owner August 16, 2024 11:50
@DenysKarmazynDFINITY
Copy link
Contributor Author

DenysKarmazynDFINITY commented Aug 16, 2024

To get the pipeline correctly running, #2032 should be merged first. Though, the PR code can be already reviewed.

@DenysKarmazynDFINITY DenysKarmazynDFINITY force-pushed the test(frontend)/homepage-snapshots branch 3 times, most recently from b5331d2 to edb6b77 Compare August 19, 2024 08:20
@DenysKarmazynDFINITY
Copy link
Contributor Author

The pipeline is now green, so PR can be fully reviewed.

@DenysKarmazynDFINITY DenysKarmazynDFINITY force-pushed the test(frontend)/homepage-snapshots branch 2 times, most recently from 8697de6 to e7fa7e6 Compare August 19, 2024 13:00
e2e/authentication.spec.ts Outdated Show resolved Hide resolved
e2e/homepage.spec.ts Show resolved Hide resolved
e2e/homepage.spec.ts Outdated Show resolved Hide resolved
e2e/shared/constants.ts Outdated Show resolved Hide resolved
e2e/shared/utils.ts Outdated Show resolved Hide resolved
playwright.config.ts Outdated Show resolved Hide resolved
src/frontend/src/lib/constants/test-ids.constant.ts Outdated Show resolved Hide resolved
@DenysKarmazynDFINITY
Copy link
Contributor Author

@peterpeterparker @AntonioVentilii-DFINITY thanks for the reviews! I applied all your comments, so the code is ready for another go.

e2e/homepage.spec.ts Outdated Show resolved Hide resolved
e2e/utils/pages/homepage.page.ts Outdated Show resolved Hide resolved
e2e/utils/pages/homepage.page.ts Outdated Show resolved Hide resolved
e2e/utils/pages/homepage.page.ts Outdated Show resolved Hide resolved
playwright.config.ts Outdated Show resolved Hide resolved
e2e/utils/pages/homepage.page.ts Outdated Show resolved Hide resolved
e2e/utils/pages/homepage.page.ts Outdated Show resolved Hide resolved
Copy link
Member

@peterpeterparker peterpeterparker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

e2e/utils/pages/homepage.page.ts Show resolved Hide resolved
@DenysKarmazynDFINITY DenysKarmazynDFINITY merged commit 5637359 into main Aug 20, 2024
11 checks passed
@DenysKarmazynDFINITY DenysKarmazynDFINITY deleted the test(frontend)/homepage-snapshots branch August 20, 2024 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants