-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Migrate Navigable toolbar test to Playwright #51514
Migrate Navigable toolbar test to Playwright #51514
Conversation
while ( | ||
await page.evaluate( () => { | ||
const scrollable = window.wp.dom.getScrollContainer( | ||
document.activeElement | ||
); | ||
return ! scrollable || scrollable.scrollTop === 0; | ||
} ) | ||
) { | ||
await page.keyboard.press( 'Enter' ); | ||
} |
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.
I'm not sure why yet, but when I run this test locally and watch it in the browser, it gets stuck in a cycle of pressing Enter over and over without moving on to the code after it.
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.
I think something got messed up during a copy/paste or search/replace. I copy/pasted the old test from [navigable-toolbar.test](https://raw.githubusercontent.com/WordPress/gutenberg/6c0f4a50324b7f09b4c13c8ce2b974b1e2243bd1/packages/e2e-tests/specs/editor/various/navigable-toolbar.test.js)
and replaced the expect( await isInBlockToolbar() ).toBe( true );
part, and the test passes.
Could you try copy/pasting it again and see if it works for you?
const { activeElement } = | ||
document.activeElement?.contentDocument ?? document; |
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.
I think this part needed to get moved over to the playwright test here and in scrollTopBefore
Hi @jeryj, I have addressed the feedbacks and the CI also passed successfully! Do let me know if there are any further suggestions.. Thanks! |
Hi @jeryj, I have addressed the feedbacks and pushed the code and CI had passed, but seems now the CI got executed automatically and it failed again. Though it is not related to the test case I worked on. |
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 for working on this! 🚢
Removed tests related to the alt + 10 shortcut as they are covered elsewhere.
What?
Part of #38851.
Migrate navigable-toolbar.test.js to its Playwright version.
Why?
Part of #38851.
How?
See MIGRATION.md for migration steps.
Testing Instructions
Run
npm run test:e2e:playwright test/e2e/specs/editor/various/navigable-toolbar.spec.js