Skip to content

Commit

Permalink
Update test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta committed Jul 8, 2024
1 parent 918e815 commit b0bf100
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ test.describe( 'Dataviews List Layout', () => {
page.getByRole( 'button', { name: 'Reset' } )
).toBeFocused();

await page.keyboard.press( 'Tab' );
await expect(
page.getByRole( 'button', { name: 'Layout' } )
).toBeFocused();

await page.keyboard.press( 'Tab' );
await expect(
page.getByRole( 'button', { name: 'View options' } )
Expand All @@ -69,6 +74,7 @@ test.describe( 'Dataviews List Layout', () => {
await page.keyboard.press( 'Tab' );
await page.keyboard.press( 'Tab' );
await page.keyboard.press( 'Tab' );
await page.keyboard.press( 'Tab' );

// Make sure the items have loaded before reaching for the 1st item in the list.
await expect( page.getByRole( 'grid' ) ).toBeVisible();
Expand Down Expand Up @@ -98,6 +104,7 @@ test.describe( 'Dataviews List Layout', () => {
await page.keyboard.press( 'Tab' );
await page.keyboard.press( 'Tab' );
await page.keyboard.press( 'Tab' );
await page.keyboard.press( 'Tab' );

// Make sure the items have loaded before reaching for the 1st item in the list.
await expect( page.getByRole( 'grid' ) ).toBeVisible();
Expand All @@ -121,6 +128,7 @@ test.describe( 'Dataviews List Layout', () => {
await page.keyboard.press( 'Tab' );
await page.keyboard.press( 'Tab' );
await page.keyboard.press( 'Tab' );
await page.keyboard.press( 'Tab' );

// Make sure the items have loaded before reaching for the 1st item in the list.
await expect( page.getByRole( 'grid' ) ).toBeVisible();
Expand Down Expand Up @@ -162,6 +170,7 @@ test.describe( 'Dataviews List Layout', () => {
await page.keyboard.press( 'Tab' );
await page.keyboard.press( 'Tab' );
await page.keyboard.press( 'Tab' );
await page.keyboard.press( 'Tab' );

// Make sure the items have loaded before reaching for the 1st item in the list.
await expect( page.getByRole( 'grid' ) ).toBeVisible();
Expand Down
3 changes: 1 addition & 2 deletions test/e2e/specs/site-editor/new-templates-list.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ test.describe( 'Templates', () => {
test( 'Field visibility', async ( { admin, page } ) => {
await admin.visitSiteEditor( { postType: 'wp_template' } );

await page.getByRole( 'button', { name: 'View options' } ).click();
await page.getByRole( 'menuitem', { name: 'Layout' } ).click();
await page.getByRole( 'button', { name: 'Layout' } ).click();
await page.getByRole( 'menuitemradio', { name: 'Table' } ).click();

await page.getByRole( 'button', { name: 'Description' } ).click();
Expand Down
8 changes: 2 additions & 6 deletions test/performance/specs/site-editor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,11 @@ test.describe( 'Site Editor Performance', () => {
// If it's there, switch to the list layout before running the test.
// See https://github.com/WordPress/gutenberg/pull/59792
const isDataViewsUI = await page
.getByRole( 'button', { name: 'View options' } )
.getByRole( 'button', { name: 'Layout' } )
.isVisible();
if ( isDataViewsUI ) {
await page
.getByRole( 'button', { name: 'View options' } )
.click();
await page
.getByRole( 'menuitem' )
.filter( { has: page.getByText( 'Layout' ) } )
.getByRole( 'button', { name: 'Layout' } )
.click();
await page
.getByRole( 'menuitemradio' )
Expand Down

0 comments on commit b0bf100

Please sign in to comment.