Skip to content

Commit

Permalink
check toolbar alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
MaggieCabrera committed Oct 11, 2024
1 parent a6035c9 commit 45c3cc7
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions test/e2e/specs/site-editor/zoom-out.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,27 @@ test.describe( 'Zoom Out', () => {
} ) => {
await page.getByLabel( 'Zoom Out' ).click();

//Click on the first pattern of the theme
await editor.canvas
const firstPattern = editor.canvas
.locator( 'div' )
.filter( { hasText: 'A commitment to innovation' } )
.nth( 1 )
.click();
.nth( 1 );

//Click on the first pattern of the theme
await firstPattern.click();

const toolbar = page.getByRole( 'toolbar', {
name: 'Block tools',
} );

await expect( toolbar ).toBeVisible();

Check failure on line 66 in test/e2e/specs/site-editor/zoom-out.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 6

[chromium] › site-editor/zoom-out.spec.js:48:2 › Zoom Out › When in zoom out

1) [chromium] › site-editor/zoom-out.spec.js:48:2 › Zoom Out › When in zoom out, a vertical toolbar appears for sections Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByRole('toolbar', { name: 'Block tools' }) Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByRole('toolbar', { name: 'Block tools' }) 64 | } ); 65 | > 66 | await expect( toolbar ).toBeVisible(); | ^ 67 | 68 | const toolbarRect = await toolbar.boundingBox(); 69 | const firstPatternRect = await firstPattern.boundingBox(); at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/zoom-out.spec.js:66:27

await expect(
page.getByRole( 'toolbar', { name: 'Block tools' } )
).toBeVisible();
const toolbarRect = await toolbar.boundingBox();
const firstPatternRect = await firstPattern.boundingBox();

//Check that the toolbar is vertically aligned to the pattern and to the left
expect( toolbarRect.y ).toEqual( firstPatternRect.y );

Check failure on line 72 in test/e2e/specs/site-editor/zoom-out.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 6

[chromium] › site-editor/zoom-out.spec.js:48:2 › Zoom Out › When in zoom out

1) [chromium] › site-editor/zoom-out.spec.js:48:2 › Zoom Out › When in zoom out, a vertical toolbar appears for sections Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toEqual(expected) // deep equality Expected: 156.953125 Received: 157 70 | 71 | //Check that the toolbar is vertically aligned to the pattern and to the left > 72 | expect( toolbarRect.y ).toEqual( firstPatternRect.y ); | ^ 73 | expect( toolbarRect.x + toolbarRect.width ).toEqual( 74 | firstPatternRect.x 75 | ); at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/zoom-out.spec.js:72:27

Check failure on line 72 in test/e2e/specs/site-editor/zoom-out.spec.js

View workflow job for this annotation

GitHub Actions / Playwright - 6

[chromium] › site-editor/zoom-out.spec.js:48:2 › Zoom Out › When in zoom out

1) [chromium] › site-editor/zoom-out.spec.js:48:2 › Zoom Out › When in zoom out, a vertical toolbar appears for sections Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toEqual(expected) // deep equality Expected: 156.953125 Received: 157 70 | 71 | //Check that the toolbar is vertically aligned to the pattern and to the left > 72 | expect( toolbarRect.y ).toEqual( firstPatternRect.y ); | ^ 73 | expect( toolbarRect.x + toolbarRect.width ).toEqual( 74 | firstPatternRect.x 75 | ); at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/zoom-out.spec.js:72:27
expect( toolbarRect.x + toolbarRect.width ).toEqual(
firstPatternRect.x
);
} );
} );

0 comments on commit 45c3cc7

Please sign in to comment.