-
Notifications
You must be signed in to change notification settings - Fork 31
Let's include E2E tests for the website #900
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
Open
UlisesGascon
wants to merge
6
commits into
ossf:main
Choose a base branch
from
UlisesGascon:e2e-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Ulises Gascon <[email protected]> Main Changes: - Git Ignore e2e temporary folders - Add basic Playwright configuration compatible with local and CI environments - Include auto-build and serve the application when the tests are running
Signed-off-by: Ulises Gascon <[email protected]>
Signed-off-by: Ulises Gascon <[email protected]> Main Changes: - Include E2E tests for Home page - Include E2E tests for Viewer page - Include support for mocking http requests - Add test snapshot to prevent visual regressions - Include DOM exceptions for videos on the testing environment
✅ Deploy Preview for ossf-scorecard ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Signed-off-by: Ulises Gascon <[email protected]>
4aa8b64 to
b2a6b64
Compare
Signed-off-by: Ulises Gascon <[email protected]>
4cda181 to
3a3ee6b
Compare
Signed-off-by: Ulises Gascon <[email protected]>
3a3ee6b to
f5736ce
Compare
Member
That is a limitation of GitHub Actions (link):
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
We currently don’t have a reliable way to test UI changes on the website beyond building and manually checking it. Manual testing is error-prone. This PR introduces new tests using E2E testing with headless browsers, which run the web app, query the DOM, click elements, and so on.
It’s also difficult to cover all pieces with traditional tests. After discussing with @KoolTheba, we decided to include visual regression tests (snapshot vs snapshot). This lets the testing framework detect UI changes with adjustable sensitivity.
Snapshot testing can vary significantly between machines, so we introduced Chromatic to run these tests consistently and provide a dashboard where we can review and approve or reject changes.
Main Changes
Assumptions
ENABLE_SNAPSHOTSenvironment variable.yarn.lockorpackage.jsonfiles.Notes
Important
I made many changes while writing this. It would be very helpful if you run everything locally following the instructions to confirm the docs make sense and are easy to follow.
Screenshots
Local UI
All tests:
One test suite in detail:
If you run snapshots:
When discrepancies appear:
Chromatic UI
Our dashboard: