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
Bump puppeteer from 19.3.0 to 19.4.0 #3084
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -251,13 +251,14 @@ describe('/components/accordion', () => { | |||||||||||
|
||||||||||||
const $element = await page.$('.govuk-accordion__section-button') | ||||||||||||
|
||||||||||||
expect(getAccessibleName($element)).resolves.toBe( | ||||||||||||
await expect(getAccessibleName(page, $element)).resolves.toBe( | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Puppeteer was receiving the It was flagged by TypeScript in another PR so was my first guess at fixing the issue. We now wait for the assertion to complete before the Accordion button gets a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Neat! Thanks for fixing that 🙌🏻 |
||||||||||||
'Section A , Show this section' | ||||||||||||
) | ||||||||||||
|
||||||||||||
await $element.click() | ||||||||||||
await page.waitForTimeout(100) | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We see For a single test run 50ms is sufficient but still saw occasional failures. As mentioned in the comments, this is possibly due to accessibility tree (and text announcement) changes when There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion Rather than a timeout, we could use an aria selector to make Puppeteer wait. Once we're past that lookup, we know the accessibility tree has been updated and we can run our check that it's the element we hold a reference of that's actually been updated.
Suggested change
Unfortunately Puppeteer still doesn't expose the necessary APIs to compare that this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thinking we could encapsulate that inside the |
||||||||||||
|
||||||||||||
expect(getAccessibleName($element)).resolves.toBe( | ||||||||||||
await expect(getAccessibleName(page, $element)).resolves.toBe( | ||||||||||||
'Section A , Hide this section' | ||||||||||||
) | ||||||||||||
}) | ||||||||||||
|
@@ -269,13 +270,14 @@ describe('/components/accordion', () => { | |||||||||||
|
||||||||||||
const $element = await page.$('.govuk-accordion__section-button') | ||||||||||||
|
||||||||||||
expect(getAccessibleName($element)).resolves.toBe( | ||||||||||||
await expect(getAccessibleName(page, $element)).resolves.toBe( | ||||||||||||
'Test , Additional description , Show this section' | ||||||||||||
) | ||||||||||||
|
||||||||||||
await $element.click() | ||||||||||||
await page.waitForTimeout(100) | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah don't worry, like you said we're back to not knowing if We may well see I'm happy with this workaround temporarily There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair enough. I've opened an issue with Puppeteer to improve our chances of it being fixed 😄 |
||||||||||||
|
||||||||||||
expect(getAccessibleName($element)).resolves.toBe( | ||||||||||||
await expect(getAccessibleName(page, $element)).resolves.toBe( | ||||||||||||
'Test , Additional description , Hide this section' | ||||||||||||
) | ||||||||||||
}) | ||||||||||||
|
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.
We've seen Jest Puppeteer replace the global
page
between concurrent tests so now a param