Skip to content

Commit

Permalink
Open document settings before each test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Dec 16, 2022
1 parent 1a6a31a commit 85b03c7
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions test/e2e/specs/editor/various/font-size-picker.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ test.describe( 'Font Size Picker', () => {
editor,
page,
} ) => {
await editor.openDocumentSettingsSidebar();
await page.click( 'role=button[name="Add default block"i]' );
await page.keyboard.type( 'Paragraph to be made "small"' );
await page.click(
Expand All @@ -33,6 +34,7 @@ test.describe( 'Font Size Picker', () => {
editor,
page,
} ) => {
await editor.openDocumentSettingsSidebar();
await page.click( 'role=button[name="Add default block"i]' );
await page.keyboard.type( 'Paragraph to be made "small"' );
await page.click(
Expand All @@ -53,6 +55,7 @@ test.describe( 'Font Size Picker', () => {
page,
pageUtils,
} ) => {
await editor.openDocumentSettingsSidebar();
await page.click( 'role=button[name="Add default block"i]' );
await page.keyboard.type( 'Paragraph reset - custom size' );
await page.click(
Expand Down Expand Up @@ -140,13 +143,16 @@ test.describe( 'Font Size Picker', () => {
test( 'should apply a named font size using the font size buttons', async ( {
editor,
page,
pageUtils,
} ) => {
await editor.openDocumentSettingsSidebar();
await page.click( 'role=button[name="Add default block"i]' );
await page.keyboard.type( 'Paragraph to be made "large"' );

await page.click(
'role=radiogroup[name="Font size"i] >> role=radio[name="Large"i]'
'role=group[name="Font size"i] >> role=button[name="Font size"i]'
);
await pageUtils.pressKeyTimes( 'ArrowDown', 4 );
await page.keyboard.press( 'Enter' );

await expect.poll( editor.getEditedPostContent )
.toBe( `<!-- wp:paragraph {"fontSize":"large"} -->
Expand All @@ -159,6 +165,7 @@ test.describe( 'Font Size Picker', () => {
page,
pageUtils,
} ) => {
await editor.openDocumentSettingsSidebar();
await page.click( 'role=button[name="Add default block"i]' );
await page.keyboard.type(
'Paragraph with font size reset using tools panel menu'
Expand Down Expand Up @@ -188,6 +195,7 @@ test.describe( 'Font Size Picker', () => {
page,
pageUtils,
} ) => {
await editor.openDocumentSettingsSidebar();
await page.click( 'role=button[name="Add default block"i]' );
await page.keyboard.type(
'Paragraph with font size reset using input field'
Expand Down Expand Up @@ -222,15 +230,13 @@ test.describe( 'Font Size Picker', () => {
editor,
page,
} ) => {
await editor.openDocumentSettingsSidebar();
await page.click( 'role=button[name="Add default block"i]' );
await page.keyboard.type( 'Paragraph to be made "large"' );

const fontSizeLarge = page.locator(
await page.click(
'role=radiogroup[name="Font size"i] >> role=radio[name="Large"i]'
);
await fontSizeLarge.click();

await expect( fontSizeLarge ).toBeChecked();
await expect.poll( editor.getEditedPostContent )
.toBe( `<!-- wp:paragraph {"fontSize":"large"} -->
<p class="has-large-font-size">Paragraph to be made "large"</p>
Expand All @@ -241,6 +247,7 @@ test.describe( 'Font Size Picker', () => {
editor,
page,
} ) => {
await editor.openDocumentSettingsSidebar();
await page.click( 'role=button[name="Add default block"i]' );
await page.keyboard.type(
'Paragraph with font size reset using tools panel menu'
Expand Down Expand Up @@ -268,6 +275,7 @@ test.describe( 'Font Size Picker', () => {
page,
pageUtils,
} ) => {
await editor.openDocumentSettingsSidebar();
await page.click( 'role=button[name="Add default block"i]' );
await page.keyboard.type(
'Paragraph with font size reset using input field'
Expand Down

1 comment on commit 85b03c7

@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.
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/3711410221
📝 Reported issues:

Please sign in to comment.