Skip to content

Commit 6448e01

Browse files
committed
fix index e2e test to pass type checks
1 parent ad2c2d3 commit 6448e01

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

e2e/{{app_name}}/tests/index.spec.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
1-
const { test, expect } = require('@playwright/test');
1+
import { Page, expect, test } from '@playwright/test';
22

33
import AxeBuilder from '@axe-core/playwright';
44

5+
type PlaywrightTestParams = {
6+
page: Page;
7+
};
8+
59
test.describe('Generic Webpage Tests', () => {
6-
test('should load the webpage successfully', async ({ page }) => {
10+
test('should load the webpage successfully', async ({ page }: PlaywrightTestParams) => {
711
const response = await page.goto('/');
12+
if (!response) {
13+
throw new Error('Failed to navigate');
14+
}
15+
816
const title = await page.title();
917
await expect(response.status()).toBe(200);
1018
});
1119

12-
test('should take a screenshot of the webpage', async ({ page }) => {
20+
test('should take a screenshot of the webpage', async ({ page }: PlaywrightTestParams) => {
1321
await page.goto('/');
1422
await page.screenshot({ path: 'example-screenshot.png', fullPage: true });
1523
});

0 commit comments

Comments
 (0)