Skip to content
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

[code-infra] Tentative fix for Argos flaky screenshot tests #15374

Merged

Conversation

JCQuintas
Copy link
Member

  • Move to use TS instead of JS
  • Add page.waitForLoadState() before screenshot

@JCQuintas JCQuintas added enhancement This is not a bug, nor a new feature scope: code-infra Specific to the core-infra product labels Nov 11, 2024
@JCQuintas JCQuintas requested a review from a team November 11, 2024 15:43
@JCQuintas JCQuintas self-assigned this Nov 11, 2024
@@ -62,7 +62,7 @@ async function main() {

// Wait for all requests to finish.
// This should load shared resources such as fonts.
await page.goto(`${baseUrl}#no-dev`, { waitUntil: 'networkidle0' });
await page.goto(`${baseUrl}#no-dev`, { waitUntil: 'networkidle' });
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seemed a bug

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure? 🤔
https://www.webshare.io/academy-article/puppeteer-networkidle0-vs-networkidle2
it seems like it is correct. 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using playwright, the types flag that as a type error

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, nice. 👍
It's a difference between Playwright and Puppeteer. 🙈
https://playwright.dev/docs/api/class-page#page-goto-option-wait-until

@mui-bot
Copy link

mui-bot commented Nov 11, 2024

Deploy preview: https://deploy-preview-15374--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against b6f281b

Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement, thanks for looking into this! 🙏 👍

@@ -62,7 +62,7 @@ async function main() {

// Wait for all requests to finish.
// This should load shared resources such as fonts.
await page.goto(`${baseUrl}#no-dev`, { waitUntil: 'networkidle0' });
await page.goto(`${baseUrl}#no-dev`, { waitUntil: 'networkidle' });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure? 🤔
https://www.webshare.io/academy-article/puppeteer-networkidle0-vs-networkidle2
it seems like it is correct. 🤔

test/regressions/.mocharc.js Show resolved Hide resolved
Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's test this. 🚀 🤞

@@ -62,7 +62,7 @@ async function main() {

// Wait for all requests to finish.
// This should load shared resources such as fonts.
await page.goto(`${baseUrl}#no-dev`, { waitUntil: 'networkidle0' });
await page.goto(`${baseUrl}#no-dev`, { waitUntil: 'networkidle' });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, nice. 👍
It's a difference between Playwright and Puppeteer. 🙈
https://playwright.dev/docs/api/class-page#page-goto-option-wait-until

@JCQuintas JCQuintas merged commit 60d0913 into mui:master Nov 11, 2024
22 checks passed
@JCQuintas JCQuintas deleted the regression-test-screenshot-migrate-to-ts branch November 11, 2024 16:21
@LukasTy
Copy link
Member

LukasTy commented Nov 13, 2024

WDYT, @JCQuintas, should we cherry-pick this to v7.x as we'll be doing a lot of PRs for that branch? 🤔

@JCQuintas
Copy link
Member Author

probably, yeah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is not a bug, nor a new feature scope: code-infra Specific to the core-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants