Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zoom out: e2e for vertical toolbar appearance #65980

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions test/e2e/specs/site-editor/zoom-out.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,36 @@
expect( htmlRect.y + paddingTop ).toBeGreaterThan( iframeRect.y );
expect( htmlRect.x ).toBeGreaterThan( iframeRect.x );
} );

test( 'When in zoom out, a vertical toolbar appears for sections', async ( {
page,
editor,
} ) => {
await page.getByLabel( 'Zoom Out' ).click();

const firstPattern = editor.canvas
.locator( 'div' )
.filter( { hasText: 'A commitment to innovation' } )
.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();

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( Math.round( toolbarRect.y ) ).toEqual(

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 Error: expect(received).toEqual(expected) // deep equality Expected: 60 Received: 61 70 | 71 | //Check that the toolbar is vertically aligned to the pattern and to the left > 72 | expect( Math.round( toolbarRect.y ) ).toEqual( | ^ 73 | Math.round( firstPatternRect.y ) 74 | ); 75 | expect( at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/zoom-out.spec.js:72:41

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: 60 Received: 61 70 | 71 | //Check that the toolbar is vertically aligned to the pattern and to the left > 72 | expect( Math.round( toolbarRect.y ) ).toEqual( | ^ 73 | Math.round( firstPatternRect.y ) 74 | ); 75 | expect( at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/zoom-out.spec.js:72:41

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: 60 Received: 61 70 | 71 | //Check that the toolbar is vertically aligned to the pattern and to the left > 72 | expect( Math.round( toolbarRect.y ) ).toEqual( | ^ 73 | Math.round( firstPatternRect.y ) 74 | ); 75 | expect( at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/zoom-out.spec.js:72:41
Math.round( firstPatternRect.y )
);
expect(
Math.round( toolbarRect.x ) + Math.round( toolbarRect.width )
).toEqual( Math.round( firstPatternRect.x ) );
} );
} );
Loading