@pw-codeceptjs/test
Adding dependency.
- npm
- yarn
npm add -D "@pw-codeceptjs/test"
yarn add -D "@pw-codeceptjs/test"
Configuration
- TypeScript
- CommonJS
playwright.config.ts
import { PlaywrightTestConfig, devices } from '@playwright/test'
import { CodeceptFixtureConfig } from '@pw-codeceptjs/test'
const config: PlaywrightTestConfig<CodeceptFixtureConfig> = {
testMatch: './**/*.spec.ts',
reporter: [['html']],
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
},
},
],
}
export default config
playwright.config.js
const { devices } = require('@playwright/test')
const config = {
testMatch: './**/*.spec.js',
reporter: [['html']],
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
},
},
],
};
module.exports = config;
Using
- TypeScript
- CommonJS
*.spec.ts
import { test } from '@pw-codeceptjs/test'
test('Test name', async ({ I }) => {
await I.amOnPage('https://playwright.dev')
})
*.spec.js
const { test } = require('@pw-codeceptjs/test')
test('Test name', async ({ I }) => {
await I.amOnPage('https://playwright.dev')
})