-
Notifications
You must be signed in to change notification settings - Fork 0
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
[#6] - Add tests #41
Open
thatisrich
wants to merge
13
commits into
main
Choose a base branch
from
feature/initial-automated-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
[#6] - Add tests #41
Conversation
This file contains 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
Open
thatisrich
requested review from
chrishbite,
jaymcp and
a team
as code owners
November 28, 2024 11:28
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.
Description
#6 - This PR adds some initial Playwright integration and e2e tests.
The initial tests are designed to ensure the
Image Comparison
block can be added to a page with various settings and be rendered (or not, as the case may be) and interacted with correctly.The
001-insert-block.spec.ts
test adds the block with a series of image variations (both images, no images, and a single image populated), and container size variations, then asserts if the block is rendered correctly on the front end. The test also runsaxe
to check for some basic accessibility violations.The
002-fe-interactions.spec.ts
test sets the starting divider position and then ensures the divider can be changed without error on the front end, in both horizontal and vertical directions.Change Log
.gitignore
- Adds Playwright files / folders to be ignored.wp-env.json
- Ensures the plugin is activated by default inwp-env
package.json
- Includes the Playwright and env dependencies and test commandsplaywright.config.ts
- The Playwright config setting the folder structure and setuptests/config/global-setup.ts
- Base environment setup to ensure images are included in the media librarytests/assets/before.png
+tests/assets/after.png
- Images used in the testtests/e2e/001-insert-block.spec.ts
- Initial e2e test following the detail outlined abovetests/e2e/002-fe-interactions.spec.ts
- e2e test for front end interactionsREADME.md
- Adds brief testing commands to the documentationSteps to test
The Playwright tests use
wp-env
, so a fresh docker WP instance will be created and ran in silo from any existing local environments. Please ensure docker is running prior to running the tests.npm install
to get the latest packagesnpm run test:e2e
for headless testing (wp-env
will be started on first run so may take a bit longer while setting up)npm run test:e2e:debug
for step-by-step navigation of the tests (each test will open, then close, a new Chromium window)test.step
is shown on the command line as the test proceedsScreenshots/Videos
Screenshot - Playwright test results
Video - Playwright tests running in debug mode
Checklist: