feat(e2e): Migrating e2e playwright tests for challeges/saas - #15
Open
realkamran wants to merge 1 commit into
Open
feat(e2e): Migrating e2e playwright tests for challeges/saas#15realkamran wants to merge 1 commit into
realkamran wants to merge 1 commit into
Conversation
|
Solid attempt @realkamran Can you please help us understand this better by identifying the page URL and the source code for the DOM element you are testing here? |
realkamran
commented
Sep 26, 2023
| }); | ||
|
|
||
| test('should render the sass preview', async () => { | ||
| const frame = await Promise.resolve(page.mainFrame()); |
Collaborator
Author
There was a problem hiding this comment.
In this line we are using Promise.resolve() to avoid the TS error Unexpected 'await' of a non-Promise (non-"Thenable") value. and page.mainFrame() gets the iframe, here is the doc reference for that https://playwright.dev/docs/api/class-frame#:~:text=%3B%0A%20%20dumpFrameTree(-,page.mainFrame(),-%2C%20%27%27)
realkamran
commented
Sep 26, 2023
| await frame.isVisible('.text-2'); | ||
| await frame.isVisible('.text-3'); | ||
| await frame.isVisible('.text-4'); | ||
| await frame.isVisible('.text-5'); |
Collaborator
Author
There was a problem hiding this comment.
After getting the iframe, here we are checking five paragraphs of the containing some text (i.e "Hello") is visible in the page.
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.
Checklist:
mainbranch of freeCodeCamp.Page URL: https://www.freecodecamp.org/learn/front-end-development-libraries/sass/use-for-to-create-a-sass-loop
Closes #XXXXX