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

Fix navigation timeout errors in E2E tests #7669

Merged
merged 8 commits into from
Nov 3, 2023
Merged

Conversation

thelovekesh
Copy link
Collaborator

@thelovekesh thelovekesh commented Nov 2, 2023

Summary

Most of the time, E2E tests fail due to navigation timeout errors. Since we rely on wp-scripts for running E2E tests, the package does not use the latest chromium for running the test suite hence causing so much flakiness in tests.

Changes:

  • Determine executable path from the executablePath() puppeteer helper function in E2E tests.
  • Remove assignMenuToLocation() and update createTestMenu() e2e util for adding menu locations.

Checklist

  • My code is tested and passes existing tests.
  • My code follows the Engineering Guidelines (updates are often made to the guidelines, check it out periodically).

package.json Show resolved Hide resolved
Comment on lines 9 to 20
module.exports = {
launch: {
devtools: process.env.PUPPETEER_DEVTOOLS === 'true',
headless: process.env.PUPPETEER_HEADLESS !== 'false',
slowMo: parseInt(process.env.PUPPETEER_SLOWMO) || 0,
args: [
'--enable-blink-features=ComputedAccessibilityInfo',
'--disable-web-security',
],
executablePath: executablePath(),
},
};
Copy link
Member

Choose a reason for hiding this comment

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

Where did you get this config from? If copied from somewhere, please include the link to the specific version of the config so it can be updated to reflect upstream changes.

Copy link
Collaborator Author

@thelovekesh thelovekesh Nov 3, 2023

Choose a reason for hiding this comment

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

Now it will be automatically in sync with upstream - ee18f0a

await deleteAllMenus();
await createMenu(
{
name: 'Test Menu 1',
locations: [menuLocation],
Copy link
Member

Choose a reason for hiding this comment

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

So this makes the assignMenuToLocation function obsolete? It was doing additional work that wasn't needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, that's correct.

@thelovekesh thelovekesh marked this pull request as ready for review November 3, 2023 09:40
Copy link
Contributor

github-actions bot commented Nov 3, 2023

Plugin builds for ee18f0a are ready 🛎️!

Checksums
# Development build checksums
42c3e4796a1a0c82292030c8c336c7d86683125a9c4fb175d460250f98114668 *amp.zip

# Production build checksums
2088e71b354bdb926ac5b24f606abeb535cf1436f1858c404b3923659f01af1b *amp.zip

Warning

These builds are for testing purposes only and should not be used in production.

@thelovekesh thelovekesh force-pushed the fix/e2e-tests branch 2 times, most recently from 4d59ace to ee18f0a Compare November 3, 2023 12:58
Copy link
Member

@westonruter westonruter left a comment

Choose a reason for hiding this comment

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

Great work!

@westonruter westonruter added this to the v2.5.0 milestone Nov 3, 2023
@westonruter westonruter merged commit 7ddff31 into develop Nov 3, 2023
56 checks passed
@westonruter westonruter deleted the fix/e2e-tests branch November 3, 2023 16:44
@westonruter westonruter added the Changelogged Whether the issue/PR has been added to release notes. label Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelogged Whether the issue/PR has been added to release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants