Skip to content

Commit

Permalink
Gutenberg Google Drawings
Browse files Browse the repository at this point in the history
  • Loading branch information
nahidthenh committed Jan 13, 2025
1 parent a34bab5 commit 6edf5fe
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/gutenberg/google-drawings.spec.js
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);
});
});

0 comments on commit 6edf5fe

Please sign in to comment.