Skip to content

Commit

Permalink
Update playwright e2es to match tab changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Jan 27, 2023
1 parent 030c7cb commit f5f793b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
12 changes: 3 additions & 9 deletions test/e2e/specs/editor/blocks/table.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ test.describe( 'Table', () => {
} ) => {
await editor.insertBlock( { name: 'core/table' } );
await editor.openDocumentSettingsSidebar();
await page.click(
`role=region[name="Editor settings"i] >> role=tab[name="Settings"i]`
);

const headerSwitch = page.locator(
'role=checkbox[name="Header section"i]'
Expand Down Expand Up @@ -135,9 +132,6 @@ test.describe( 'Table', () => {
} ) => {
await editor.insertBlock( { name: 'core/table' } );
await editor.openDocumentSettingsSidebar();
await page.click(
`role=region[name="Editor settings"i] >> role=tab[name="Settings"i]`
);

// Create the table.
await page.click( 'role=button[name="Create Table"i]' );
Expand Down Expand Up @@ -211,14 +205,14 @@ test.describe( 'Table', () => {
} ) => {
await editor.insertBlock( { name: 'core/table' } );
await editor.openDocumentSettingsSidebar();
await page.click(
`role=region[name="Editor settings"i] >> role=tab[name="Settings"i]`
);

// Create the table.
await page.click( 'role=button[name="Create Table"i]' );

// Enable fixed width as it exacerbates the amount of empty space around the RichText.
await page.click(
`role=region[name="Editor settings"i] >> role=tab[name="Settings"i]`
);
await page
.locator( 'role=checkbox[name="Fixed width table cells"i]' )
.check();
Expand Down
10 changes: 1 addition & 9 deletions test/e2e/specs/site-editor/push-to-global-styles.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ test.describe( 'Push to Global Styles button', () => {
page.getByRole( 'button', { name: 'Uppercase' } )
).toHaveAttribute( 'aria-pressed', 'false' );

// Go to block settings, select inner tab, and open the Advanced panel
// Go to block settings and open the Advanced panel
await page.getByRole( 'button', { name: 'Settings' } ).click();
await page.getByRole( 'tab', { name: 'Settings' } ).click();
await page.getByRole( 'button', { name: 'Advanced' } ).click();

// Push button should be disabled
Expand All @@ -54,16 +53,9 @@ test.describe( 'Push to Global Styles button', () => {
} )
).toBeDisabled();

// Switch back to the Styles inspector tab to check typography style
await page.getByRole( 'tab', { name: 'Styles' } ).click();

// Make the Heading block uppercase
await page.getByRole( 'button', { name: 'Uppercase' } ).click();

// Switch back to the Settings inspector tab to check for enabled button
await page.getByRole( 'tab', { name: 'Settings' } ).click();
await page.getByRole( 'button', { name: 'Advanced' } ).click();

// Push button should now be enabled
await expect(
page.getByRole( 'button', {
Expand Down

0 comments on commit f5f793b

Please sign in to comment.