2021-11-29 16:34:47 -08:00
/* eslint-disable no-undef */
// playwright.config.js
// @ts-check
2022-05-19 16:09:22 -07:00
// eslint-disable-next-line no-unused-vars
2022-01-14 14:47:35 -08:00
const { devices } = require ( '@playwright/test' ) ;
2022-07-12 11:29:38 -07:00
const MAX _FAILURES = 5 ;
const NUM _WORKERS = 2 ;
2022-01-14 14:47:35 -08:00
2021-11-29 16:34:47 -08:00
/** @type {import('@playwright/test').PlaywrightTestConfig} */
const config = {
2022-07-05 17:12:45 -07:00
retries : 3 , //Retries 3 times for a total of 4. When running sharded and with maxFailures = 5, this should ensure that flake is managed without failing the full suite
2021-11-29 16:34:47 -08:00
testDir : 'tests' ,
2022-05-25 15:45:11 -07:00
testIgnore : '**/*.perf.spec.js' , //Ignore performance tests and define in playwright-perfromance.config.js
2022-05-04 09:15:39 -07:00
timeout : 60 * 1000 ,
2021-11-29 16:34:47 -08:00
webServer : {
2022-07-12 11:29:38 -07:00
command : 'cross-env NODE_ENV=test npm run start' ,
2022-07-05 17:12:45 -07:00
url : 'http://localhost:8080/#' ,
2021-11-29 16:34:47 -08:00
timeout : 200 * 1000 ,
2022-07-12 11:29:38 -07:00
reuseExistingServer : false
2021-11-29 16:34:47 -08:00
} ,
2022-07-12 11:29:38 -07:00
maxFailures : MAX _FAILURES , //Limits failures to 5 to reduce CI Waste
workers : NUM _WORKERS , //Limit to 2 for CircleCI Agent
2021-11-29 16:34:47 -08:00
use : {
baseURL : 'http://localhost:8080/' ,
headless : true ,
ignoreHTTPSErrors : true ,
2022-05-25 15:45:11 -07:00
screenshot : 'only-on-failure' ,
trace : 'on-first-retry' ,
2022-07-12 11:29:38 -07:00
video : 'off'
2021-11-29 16:34:47 -08:00
} ,
2022-01-14 14:47:35 -08:00
projects : [
{
name : 'chrome' ,
use : {
2022-05-09 13:25:21 -07:00
browserName : 'chromium'
2022-01-14 14:47:35 -08:00
}
} ,
{
name : 'MMOC' ,
2022-07-05 17:12:45 -07:00
testMatch : '**/*.e2e.spec.js' , // only run e2e tests
2022-05-09 13:25:21 -07:00
grepInvert : /@snapshot/ ,
2022-01-14 14:47:35 -08:00
use : {
browserName : 'chromium' ,
viewport : {
width : 2560 ,
height : 1440
}
}
2022-07-05 17:12:45 -07:00
} ,
{
name : 'firefox' ,
testMatch : '**/*.e2e.spec.js' , // only run e2e tests
grepInvert : /@snapshot/ ,
2022-01-14 14:47:35 -08:00
use : {
2022-07-05 17:12:45 -07:00
browserName : 'firefox'
2022-01-14 14:47:35 -08:00
}
2022-07-05 17:12:45 -07:00
} ,
{
name : 'chrome-beta' , //Only Chrome Beta is available on ubuntu -- not chrome canary
testMatch : '**/*.e2e.spec.js' , // only run e2e tests
grepInvert : /@snapshot/ ,
use : {
browserName : 'chromium' ,
channel : 'chrome-beta'
}
}
2022-01-14 14:47:35 -08:00
] ,
2021-11-29 16:34:47 -08:00
reporter : [
[ 'list' ] ,
2022-05-25 15:45:11 -07:00
[ 'html' , {
open : 'never' ,
2022-07-05 17:12:45 -07:00
outputFolder : '../html-test-results' //Must be in different location due to https://github.com/microsoft/playwright/issues/12840
2022-05-25 15:45:11 -07:00
} ] ,
2021-11-29 16:34:47 -08:00
[ 'junit' , { outputFile : 'test-results/results.xml' } ] ,
2022-01-14 14:47:35 -08:00
[ 'github' ]
2021-11-29 16:34:47 -08:00
]
} ;
module . exports = config ;