chore: create-playwright config nits & test-runner intro docs (#10253)
This commit is contained in:
parent
ff0da94d6a
commit
24cfcf867e
|
|
@ -81,7 +81,8 @@ const { devices } = require('@playwright/test');
|
||||||
|
|
||||||
/** @type {import('@playwright/test').PlaywrightTestConfig} */
|
/** @type {import('@playwright/test').PlaywrightTestConfig} */
|
||||||
const config = {
|
const config = {
|
||||||
retries: 2,
|
forbidOnly: !!process.env.CI,
|
||||||
|
retries: process.env.CI ? 2 : 0,
|
||||||
use: {
|
use: {
|
||||||
trace: 'on-first-retry',
|
trace: 'on-first-retry',
|
||||||
},
|
},
|
||||||
|
|
@ -109,7 +110,8 @@ module.exports = config;
|
||||||
import { PlaywrightTestConfig, devices } from '@playwright/test';
|
import { PlaywrightTestConfig, devices } from '@playwright/test';
|
||||||
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
retries: 2,
|
forbidOnly: !!process.env.CI,
|
||||||
|
retries: process.env.CI ? 2 : 0,
|
||||||
use: {
|
use: {
|
||||||
trace: 'on-first-retry',
|
trace: 'on-first-retry',
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,9 @@ const path = require('path');
|
||||||
*/
|
*/
|
||||||
const config = {
|
const config = {
|
||||||
testDir: path.join(__dirname, '{{testDir}}'), /* Test directory */
|
testDir: path.join(__dirname, '{{testDir}}'), /* Test directory */
|
||||||
|
forbidOnly: !!process.env.CI, /* Whether to exit with an error if any tests or groups are marked as test.only() or test.describe.only(). Useful on CI. */
|
||||||
|
retries: process.env.CI ? 2 : 0, /* If a test fails on CI, retry it additional 2 times */
|
||||||
// timeout: 30 * 1000, /* Timeout per test */
|
// timeout: 30 * 1000, /* Timeout per test */
|
||||||
// retries: process.env.CI ? 2 : 0, /* If a test fails on CI, retry it additional 2 times */
|
|
||||||
// outputDir: 'test-results/', /* Artifacts folder where screenshots, videos, and traces are stored. */
|
// outputDir: 'test-results/', /* Artifacts folder where screenshots, videos, and traces are stored. */
|
||||||
|
|
||||||
// webServer: { /* Run your local dev server before starting the tests: */
|
// webServer: { /* Run your local dev server before starting the tests: */
|
||||||
|
|
@ -19,9 +20,9 @@ const config = {
|
||||||
|
|
||||||
use: {
|
use: {
|
||||||
trace: 'on-first-retry', /* Retry a test if its failing with enabled tracing. This allows you to analyse the DOM, console logs, network traffic etc. */
|
trace: 'on-first-retry', /* Retry a test if its failing with enabled tracing. This allows you to analyse the DOM, console logs, network traffic etc. */
|
||||||
contextOptions: { /* All available context options: https://playwright.dev/docs/api/class-browser#browser-new-context */
|
// contextOptions: { /* All available context options: https://playwright.dev/docs/api/class-browser#browser-new-context */
|
||||||
ignoreHTTPSErrors: true,
|
// ignoreHTTPSErrors: true,
|
||||||
},
|
// },
|
||||||
},
|
},
|
||||||
|
|
||||||
projects: [
|
projects: [
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,9 @@ import path from 'path';
|
||||||
// Reference: https://playwright.dev/docs/test-configuration
|
// Reference: https://playwright.dev/docs/test-configuration
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
testDir: path.join(__dirname, '{{testDir}}'), /* Test directory */
|
testDir: path.join(__dirname, '{{testDir}}'), /* Test directory */
|
||||||
|
forbidOnly: !!process.env.CI, /* Whether to exit with an error if any tests or groups are marked as test.only() or test.describe.only(). Useful on CI. */
|
||||||
|
retries: process.env.CI ? 2 : 0, /* If a test fails on CI, retry it additional 2 times */
|
||||||
// timeout: 30 * 1000, /* Timeout per test */
|
// timeout: 30 * 1000, /* Timeout per test */
|
||||||
// retries: process.env.CI ? 2 : 0, /* If a test fails on CI, retry it additional 2 times */
|
|
||||||
// outputDir: 'test-results/', /* Artifacts folder where screenshots, videos, and traces are stored. */
|
// outputDir: 'test-results/', /* Artifacts folder where screenshots, videos, and traces are stored. */
|
||||||
|
|
||||||
// webServer: { /* Run your local dev server before starting the tests: */
|
// webServer: { /* Run your local dev server before starting the tests: */
|
||||||
|
|
@ -15,9 +16,9 @@ const config: PlaywrightTestConfig = {
|
||||||
|
|
||||||
use: {
|
use: {
|
||||||
trace: 'on-first-retry', /* Retry a test if its failing with enabled tracing (analyse the DOM, console logs, network traffic): https://playwright.dev/docs/trace-viewer */
|
trace: 'on-first-retry', /* Retry a test if its failing with enabled tracing (analyse the DOM, console logs, network traffic): https://playwright.dev/docs/trace-viewer */
|
||||||
contextOptions: { /* All available context options: https://playwright.dev/docs/api/class-browser#browser-new-context */
|
// contextOptions: { /* All available context options: https://playwright.dev/docs/api/class-browser#browser-new-context */
|
||||||
ignoreHTTPSErrors: true,
|
// ignoreHTTPSErrors: true,
|
||||||
},
|
// },
|
||||||
},
|
},
|
||||||
|
|
||||||
projects: [
|
projects: [
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue