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 #50900

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

@juanfra juanfra added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label May 24, 2023
@pooja-muchandikar
Copy link
Contributor Author

Hi @kevin940726,

I hope you are going great!..

Could you please help me in reviewing this PR?

Thanks!!

@kevin940726
Copy link
Member

Hi @pooja-muchandikar! Just want to note that this is still on my backlog, and I'm just a little busy with something else recently. I'll get back to it eventually! 🙇

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.

Thanks for the PR! I think this is really close. Only a few minor things to do. Let me know if you have any questions or need any help with it!

Comment on lines 74 to 78
test.describe( 'Unified Toolbar', () => {
test( 'navigates into the toolbar by keyboard (Alt+F10)', async ( {
page,
pageUtils,
} ) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This whole test has coverage in Playwright already, so we can remove this Unified Toolbar section.

pageUtils,
navigableToolbar,
} ) => {
const wp = '';
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this related to a wp is undefined kind of linting error? If so, I think it's that the places that use wp need to be window.wp and you can remove this const wp line.

} );
} );
} );

class navigableToolbar {
Copy link
Contributor

Choose a reason for hiding this comment

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

Classes in the other e2e tests capitalize the class names, so that's best to use that format here too for consistency: NavigableToolbar.

Copy link
Member

@Mamaduka Mamaduka Jun 14, 2023

Choose a reason for hiding this comment

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

I think we can drop the whole utility class here and replace isInBlockToolbar with this assertion, as it's more descriptive.

await expect(
  page
	  .getByRole( 'toolbar', { name: 'Block Tools' } )
	  .getByRole( 'button', { name: 'Paragraph' } )
).toBeFocused();

@pooja-muchandikar
Copy link
Contributor Author

Hi @jeryj @Mamaduka,

Thanks for sharing the feedbacks, I will work on those and push the changes shortly...

expect( scrollTopBefore ).toBe( scrollTopAfter );
} );

test( 'navigates into the toolbar by keyboard (Alt+F10)', async ( {
Copy link
Member

Choose a reason for hiding this comment

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

@jeryj mentioned that this is already covered in another test. We can remove it and leave only should not scroll page.

test.describe( 'Focus toolbar shortcut (alt + F10)', () => {

P.S. There's also a merge conflict that needs to be resolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Mamaduka

Yes I am working on that, but unfortunately these conflicts are not visible in my local so I am unable to fix it.. 😕

Copy link
Member

Choose a reason for hiding this comment

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

I see conflicts when I try to rebase this branch on top of the trunk, but I can't push on this branch.

Creating a new PR with all the feedback applied might be easier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure I will do that...

Copy link
Contributor

Choose a reason for hiding this comment

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

When the rebase is sorted (or a new PR), feel free to ping me for a review!

@pooja-muchandikar
Copy link
Contributor Author

Closing this PR as the conflicts are not visible in local because of which unable to fix it..

Created new PR with the feedbacks addressed here - #51514

@pooja-muchandikar pooja-muchandikar deleted the migrate/navigable-toolbar-test branch June 15, 2023 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants