Skip to content

Commit 342381b

Browse files
committed
Use screenshot test instead
1 parent f35ab2b commit 342381b

File tree

4 files changed

+4
-14
lines changed

4 files changed

+4
-14
lines changed

tests/integration/playwright/playwright.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { defineConfig, devices } from '@playwright/test';
1212
export default defineConfig({
1313
/* Look for test files in the "tests" directory, relative to this configuration file. */
1414
testDir: "./tests",
15+
snapshotPathTemplate: "{testDir}/__screenshots__/{testFilePath}/{arg}{ext}",
1516
/* Maximum time one test can run for. */
1617
timeout: 30 * 1000,
1718
expect: {
1.47 KB
Loading
5.26 KB
Loading
Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
import { test, expect } from '@playwright/test';
22

3-
test('Markdown tables are styled correct', async ({ page }) => {
3+
test('Markdown tables are styled correctly', async ({ page }) => {
44
await page.goto('html/markdown-tables.html');
5-
await expect(page.getByRole('figure', { name: 'Table 1: My Caption' })).toBeVisible();
6-
await expect(page.getByRole('figure', { name: 'Table 1: My Caption' }).locator('table')).toHaveCSS('border-top-style', 'solid')
7-
await expect(page.getByRole('figure', { name: 'Table 1: My Caption' }).locator('table')).toHaveCSS('border-top-width', '1px')
8-
await expect(page.getByRole('figure', { name: 'Table 1: My Caption' }).locator('table')).toHaveCSS('border-bottom-style', 'solid')
9-
await expect(page.getByRole('figure', { name: 'Table 1: My Caption' }).locator('table')).toHaveCSS('border-bottom-width', '1px')
10-
await expect(page.getByRole('figure', { name: 'Table 1: My Caption' }).locator('table tr').nth(1)).toHaveCSS('border-style', 'solid')
5+
await expect(page.getByRole('figure', { name: 'Table 1: My Caption' }).locator('table')).toHaveScreenshot()
116
await expect(page.locator('a.quarto-xref[href="#tbl-letters"]')).toContainText('Table 1');
127

13-
await expect(page.locator('#computational-table table')).toBeVisible();
14-
await expect(page.locator('#computational-table table')).toHaveCSS('border-top-style', 'solid')
15-
await expect(page.locator('#computational-table table')).toHaveCSS('border-top-width', '1px')
16-
await expect(page.locator('#computational-table table')).toHaveCSS('border-bottom-style', 'solid')
17-
await expect(page.locator('#computational-table table')).toHaveCSS('border-bottom-width', '1px')
18-
await expect(page.locator('#computational-table table')).toHaveCSS('border-style', /solid/)
19-
await expect(page.locator('#computational-table table').locator('td').nth(1)).toHaveCSS('box-shadow', /rgba\(0, 0, 0, 0\.05/)
8+
await expect(page.locator('#computational-table table')).toHaveScreenshot()
209

2110
});

0 commit comments

Comments
 (0)