chore: use import instead of require in generated JS examples (#131)
This commit is contained in:
Родитель
4cf6c05e28
Коммит
34403ed486
|
@ -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');
|
||||
|
|
|
@ -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/');
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// @ts-check
|
||||
const { defineConfig, devices } = require('{{ctPackageName}}');
|
||||
import { defineConfig, devices } from '{{ctPackageName}}';
|
||||
|
||||
/**
|
||||
* @see https://playwright.dev/docs/test-configuration
|
||||
|
|
|
@ -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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче