Skip to content

Commit fdeba4a

Browse files
committed
chore: configure playwright
1 parent 4fbe538 commit fdeba4a

File tree

6 files changed

+11
-21
lines changed

6 files changed

+11
-21
lines changed

e2e/example.spec.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const createJestConfig = nextJest({
77
const config = {
88
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
99
testEnvironment: 'jest-environment-jsdom',
10+
testPathIgnorePatterns: ['<rootDir>/src/__tests__/e2e'],
1011
};
1112

1213
module.exports = createJestConfig(config);

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
"typecheck": "tsc --noEmit",
1313
"test": "jest",
1414
"test:watch": "jest --watchAll",
15+
"e2e": "playwright test",
16+
"e2e:ui": "playwright test --ui",
1517
"format:write": "prettier --write \"**/*.{ts,tsx,mdx}\" --cache",
1618
"format:check": "prettier --check \"**/*.{ts,tsx,mdx}\" --cache",
1719
"postbuild": "next-sitemap --config next-sitemap.config.js",

playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { defineConfig, devices } from '@playwright/test';
1010
* See https://playwright.dev/docs/test-configuration.
1111
*/
1212
export default defineConfig({
13-
testDir: './e2e',
13+
testDir: './src/__tests__/e2e',
1414
/* Run tests in files in parallel */
1515
fullyParallel: true,
1616
/* Fail the build on CI if you accidentally left test.only in the source code. */

src/__tests__/e2e/home.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { expect, test } from '@playwright/test';
2+
3+
test('has title', async ({ page }) => {
4+
await page.goto('http://localhost:3000/');
5+
6+
await expect(page).toHaveTitle(/Next.js Starter/);
7+
});
File renamed without changes.

0 commit comments

Comments
 (0)