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

Migrate Navigable toolbar test to Playwright #51514

Merged

Conversation

pooja-muchandikar
Copy link
Contributor

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

@pooja-muchandikar
Copy link
Contributor Author

Hi @Mamaduka @jeryj

I have created another PR with feedbacks being addressed, but somehow the CI is failing. Test case is passing in my local though. Please share your suggestions on same.

image

@Mamaduka Mamaduka requested a review from jeryj June 15, 2023 05:01
Comment on lines 13 to 22
while (
await page.evaluate( () => {
const scrollable = window.wp.dom.getScrollContainer(
document.activeElement
);
return ! scrollable || scrollable.scrollTop === 0;
} )
) {
await page.keyboard.press( 'Enter' );
}
Copy link
Contributor

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.

Copy link
Contributor

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?

Comment on lines -23 to -24
const { activeElement } =
document.activeElement?.contentDocument ?? document;
Copy link
Contributor

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

@pooja-muchandikar
Copy link
Contributor Author

Hi @jeryj,

I have addressed the feedbacks and the CI also passed successfully!

Do let me know if there are any further suggestions..

Thanks!

@pooja-muchandikar
Copy link
Contributor Author

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.

image

Copy link
Contributor

@jeryj jeryj left a 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! 🚢

@jeryj jeryj merged commit 1d9c4fa into WordPress:trunk Jun 16, 2023
48 checks passed
@github-actions github-actions bot added this to the Gutenberg 16.1 milestone Jun 16, 2023
@pooja-muchandikar pooja-muchandikar deleted the migrate/navigable-toolbar-tests branch June 16, 2023 16:02
sethrubenstein pushed a commit to pewresearch/gutenberg that referenced this pull request Jul 13, 2023
Removed tests related to the alt + 10 shortcut as they are covered elsewhere.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants