Skip to content

Commit

Permalink
Updated texts in automated test code
Browse files Browse the repository at this point in the history
  • Loading branch information
benazeer-ben committed Dec 6, 2024
1 parent d63db7f commit daea9d5
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions test/e2e/specs/editor/various/nux.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,36 @@ test.describe( 'New User Experience (NUX)', () => {
await admin.createNewPost( { showWelcomeGuide: true } );

const welcomeGuide = page.getByRole( 'dialog', {
name: 'Welcome to the block editor',
name: 'Welcome to the editor',
} );
const guideHeading = welcomeGuide.getByRole( 'heading', { level: 1 } );
const nextButton = welcomeGuide.getByRole( 'button', { name: 'Next' } );
const prevButton = welcomeGuide.getByRole( 'button', {
name: 'Previous',
} );

await expect( guideHeading ).toHaveText(
'Welcome to the block editor'
);
await expect( guideHeading ).toHaveText( 'Welcome to the editor' );

await nextButton.click();
await expect( guideHeading ).toHaveText( 'Make each block your own' );
await expect( guideHeading ).toHaveText( 'Customize each block' );

await prevButton.click();
// Guide should be on page 1 of 4
await expect( guideHeading ).toHaveText(
'Welcome to the block editor'
);
await expect( guideHeading ).toHaveText( 'Welcome to the editor' );

// Press the button for Page 2.
await welcomeGuide
.getByRole( 'button', { name: 'Page 2 of 4' } )
.click();
await expect( guideHeading ).toHaveText( 'Make each block your own' );
await expect( guideHeading ).toHaveText( 'Customize each block' );

// Press the right arrow key for Page 3.
await page.keyboard.press( 'ArrowRight' );
await expect( guideHeading ).toHaveText(
'Get to know the block library'
);
await expect( guideHeading ).toHaveText( 'Explore all blocks' );

// Press the right arrow key for Page 4.
await page.keyboard.press( 'ArrowRight' );
await expect( guideHeading ).toHaveText(
'Learn how to use the block editor'
);
await expect( guideHeading ).toHaveText( 'Learn more' );

// Click on the *visible* 'Get started' button.
await welcomeGuide
Expand Down Expand Up @@ -77,7 +69,7 @@ test.describe( 'New User Experience (NUX)', () => {
await admin.createNewPost( { showWelcomeGuide: true } );

const welcomeGuide = page.getByRole( 'dialog', {
name: 'Welcome to the block editor',
name: 'Welcome to the editor',
} );

await expect( welcomeGuide ).toBeVisible();
Expand All @@ -100,7 +92,7 @@ test.describe( 'New User Experience (NUX)', () => {
await admin.createNewPost( { showWelcomeGuide: true } );

const welcomeGuide = page.getByRole( 'dialog', {
name: 'Welcome to the block editor',
name: 'Welcome to the editor',
} );

await expect( welcomeGuide ).toBeVisible();
Expand All @@ -117,7 +109,7 @@ test.describe( 'New User Experience (NUX)', () => {
} ) => {
await admin.createNewPost();
const welcomeGuide = page.getByRole( 'dialog', {
name: 'Welcome to the block editor',
name: 'Welcome to the editor',
} );

await expect( welcomeGuide ).toBeHidden();
Expand Down

0 comments on commit daea9d5

Please sign in to comment.