Skip to content

Commit

Permalink
Command center: Enable e2e tests (#50833)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored May 22, 2023
1 parent 801681b commit 1939eae
Showing 1 changed file with 17 additions and 21 deletions.
38 changes: 17 additions & 21 deletions test/e2e/specs/site-editor/command-center.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,32 @@ test.describe( 'Site editor command center', () => {
await admin.visitSiteEditor();
} );

test.skip( 'Open the command center and navigate to the page create page', async ( {
test( 'Open the command center and navigate to the page create page', async ( {
page,
} ) => {
await page
.getByRole( 'button', { name: 'Open command center' } )
.focus();
await page.keyboard.press( 'Meta+k' );
const newPageButton = page.locator(
'role=option[name="Create a new page"i]'
);
await expect( newPageButton ).toBeVisible();

// Type a random post title
await page.keyboard.type( 'E2E Test Post' );
await page.click(
'role=option[name="Create a new post \\"E2E Test Post\\""i]'
);

await page.keyboard.type( 'new page' );
await page.getByRole( 'option', { name: 'Add new page' } ).click();
await page.waitForSelector( 'iframe[name="editor-canvas"]' );
const frame = page.frame( 'editor-canvas' );
const postTitleInput = frame.locator(
'role=textbox[name=/Add title/i]'
);
await expect( postTitleInput ).toHaveText( 'E2E Test Post' );
await expect(
frame.getByRole( 'textbox', { name: 'Add title' } )
).toBeVisible();
} );

test.skip( 'Open the command center and navigate to a template', async ( {
test( 'Open the command center and navigate to a template', async ( {
page,
} ) => {
await page.keyboard.press( 'Meta+k' );

await page
.getByRole( 'button', { name: 'Open command center' } )
.click();
await page.keyboard.type( 'index' );
await page.click( 'role=option[name="index"i]' );
await expect( page.locator( 'h2' ) ).toHaveText( 'Index' );
await page.getByRole( 'option', { name: 'index' } ).click();
await expect( page.getByRole( 'heading', { level: 2 } ) ).toHaveText(
'Index'
);
} );
} );

1 comment on commit 1939eae

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in 1939eae.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5044729580
📝 Reported issues:

Please sign in to comment.