-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a34bab5
commit 6edf5fe
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const { test, expect } = require('@playwright/test'); | ||
|
||
const slug = 'playwright-gutenberg/gutenberg-google-drawings/'; | ||
|
||
test.describe("Gutenberg Google Drawings", () => { | ||
test.beforeEach(async ({ page }) => { | ||
await page.goto(slug); | ||
await page.waitForLoadState('networkidle'); | ||
}); | ||
|
||
test('Default Gutenberg Google Drawings', async ({ page }) => { | ||
// Check iframe visibility | ||
await expect(page.getByRole('heading', { name: 'Gutenberg Google Drawings 1140×' })).toBeVisible(); | ||
|
||
// Check iframe visibility | ||
const iframe = page.getByRole('img') | ||
|
||
await expect(iframe).toBeVisible(); | ||
|
||
// Check dimensions height & width | ||
const { height, width } = await iframe.evaluate(iframe => iframe.getBoundingClientRect()); | ||
expect(height).toBeCloseTo(855, 1); | ||
expect(width).toBeCloseTo(1140, 1); | ||
}); | ||
}); |