-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
E2E (cover.test.js): Wait for the height input element #47294
Conversation
Size Change: +586 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice fix, apparently page.$x
is synchronous, the await
didn't wait for anything.
)[ 0 ]; | ||
const heightInput = await page.waitForSelector( | ||
'input[id*="block-cover-height-input"]' | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an idiomatic way in Puppeter/Playwright to find an input labelled as "Minimum height of cover"? React Testing Library can do it with the .getByLabelText
query. If there is a <label for="x">
with that text and the for
attribute points to an <input id="x">
, it will return the input
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an idiomatic way in Puppeter/Playwright to find an input labelled as "Minimum height of cover"?
Not in Puppeteer, but fortunately, there is one in Playwright:
await page.getByLabel("Minimum height of cover");
We should definitely use it when this spec is migrated.
There's also an asynchronous |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks @WunderBart 🙌
Flaky tests detected in 9b18ea6. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3966668605
|
What?
Fix failing spec when the concurrent mode is enabled (#46467 (comment)):
How?
Update the input element selector so we can wait until it's available.
✅ Tested against changes in #46467.