-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 Site Editor 'settings sidebar' e2e tests to Playwright #57392
Conversation
const templateTitle = settingsSideber.locator( | ||
'.edit-site-sidebar-card__title' | ||
); | ||
const templateDescription = settingsSideber.locator( | ||
'.edit-site-sidebar-card__description' | ||
); |
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.
Had to use the class locator here.
await expect( | ||
page | ||
.getByRole( 'region', { name: 'Editor settings' } ) | ||
.getByRole( 'button', { name: 'Template (selected)' } ) | ||
).toHaveClass( /is-active/ ); |
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 we can improve active tab assertions after #56959 is merged.
Untested example:
await expect(
page
.getByRole( 'region', { name: 'Editor settings' } )
.getByRole( 'tab', { selected: true } )
).toHaveText( 'Template' );
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.
The active tab assertions work like a charm - https://github.com/WordPress/gutenberg/pull/57446/files.
Size Change: 0 B Total Size: 1.69 MB ℹ️ View Unchanged
|
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.
LGTM 👍In debug mode, I confirmed that all tests are working as intended.
Thank you, @t-hamano! |
What?
Part of #38851.
PR migrates
site-editor/settings-sidebar.test.js
e2e tests to Playwright.Why?
See #38851.
Testing Instructions