Add end-to-end tests with Playwright#270
Merged
Merged
Conversation
ce2bbb6 to
91d06fb
Compare
6e74db7 to
1ca91be
Compare
336ad13 to
23386d1
Compare
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
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.
The end-to-end testing framework Playwright has been added, along with a couple of tests.
Usage
Tests can be executed in the terminal with
pnpm e2e. They are also included in the test workflow on GitHub. The UI version (shown below) can be started withpnpm e2e:ui.Background
Whenever I refactor large parts of the application, I manually click through various pages to check that everything still works. Playwright automates this process, makes it more systematic, and reduces the risk of accidentally overlooking regressions.
The tests also verify various elements generated by the seed script and the deduction system, that the search produces the expected categories, and other aspects that are closely tied to the data. As such, they also verify that the data behaves correctly, in addition to the existing database unit tests.
Webkit
As usual, WebKit makes life harder for no good reason. Many simple tests fail, even though everything works correctly in a real browser. For now, I have excluded WebKit from the tests. In fact, at the moment, the tests run only on Chromium.
UI Demo
This is a visualization of the test case "user can enter properties" in
search.spec.ts.playwright-demo-720p.mov