diff --git a/assets/demo-todo-app.spec.js b/assets/demo-todo-app.spec.js index e2eb87c..4449561 100644 --- a/assets/demo-todo-app.spec.js +++ b/assets/demo-todo-app.spec.js @@ -1,5 +1,5 @@ // @ts-check -const { test, expect } = require('@playwright/test'); +import { test, expect } from '@playwright/test'; test.beforeEach(async ({ page }) => { await page.goto('https://demo.playwright.dev/todomvc'); diff --git a/assets/example.spec.js b/assets/example.spec.js index 40eddb8..26ed206 100644 --- a/assets/example.spec.js +++ b/assets/example.spec.js @@ -1,5 +1,5 @@ // @ts-check -const { test, expect } = require('@playwright/test'); +import { test, expect } from '@playwright/test'; test('has title', async ({ page }) => { await page.goto('https://playwright.dev/'); diff --git a/assets/playwright-ct.config.js b/assets/playwright-ct.config.js index eb13f62..17edd50 100644 --- a/assets/playwright-ct.config.js +++ b/assets/playwright-ct.config.js @@ -1,5 +1,5 @@ // @ts-check -const { defineConfig, devices } = require('{{ctPackageName}}'); +import { defineConfig, devices } from '{{ctPackageName}}'; /** * @see https://playwright.dev/docs/test-configuration diff --git a/assets/playwright.config.js b/assets/playwright.config.js index 259be7d..799008a 100644 --- a/assets/playwright.config.js +++ b/assets/playwright.config.js @@ -1,16 +1,18 @@ // @ts-check -const { defineConfig, devices } = require('@playwright/test'); +import { defineConfig, devices } from '@playwright/test'; /** * Read environment variables from file. * https://github.com/motdotla/dotenv */ -// require('dotenv').config({ path: path.resolve(__dirname, '.env') }); +// import dotenv from 'dotenv'; +// import path from 'path'; +// dotenv.config({ path: path.resolve(__dirname, '.env') }); /** * @see https://playwright.dev/docs/test-configuration */ -module.exports = defineConfig({ +export default defineConfig({ testDir: './{{testDir}}', /* Run tests in files in parallel */ fullyParallel: true,