-
Notifications
You must be signed in to change notification settings - Fork 132
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: adding tests (playwright) #48
Merged
Merged
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
Hey @vvidday sorry about the long delay! Thanks again for helping to look into Playwright! Quick overview:
Added some comments in the PR review. I've also set up some very basic tests (unit/component/e2e) in |
greentfrapp
requested changes
Aug 21, 2022
Skipped the 2 failing tests (on chromium) for now, will address in future PR - see #54 for details |
greentfrapp
approved these changes
Aug 23, 2022
Closed
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.
Setup + basic tests using playwright
Currently implements the following (E2E) tests:
Text should be formatted appropriately when user inputs bold/italics
Blocks should be converted appropriately when user initiates conversion by searching/typing
Caret position should be maintained after conversion if initiated from search
Pressing 'Enter' in the middle of a block should create a new line containing the text after the caret position
Pressing 'Backspace' at the beginning of a non-text block should convert the current block to a text block
I also included an example using playwright's component testing (c9a30f1 and 89329ed), which will be very useful since it allows us to mount components with custom props. (eg if we want to test custom inputs like bold/italic bold/headings etc we can mount the component with these inputs instead of having to create them in an end to end test)
One 'downside' of playwright compared to cypress is that we can't (to my knowledge) access instance methods (for example directly calling
Lotion.vue::getCaretPos()
), but we can still test the correctness of the methods outcome e.g. by initiating a change in block type via the menu.Also, I'm not sure regarding CI (I'm not familiar with AWS), currently
npx playwright test
is configured to start the local server withnpm run dev
and test on that url - might need some changes for CI.