1+ import type { PlaywrightTestConfig } from "@playwright/test" ;
2+ import { devices } from "@playwright/test" ;
3+ /**
4+ * Read environment variables from file.
5+ */
6+ require ( "dotenv" ) . config ( ) ;
7+
8+ /**
9+ * See https://playwright.dev/docs/test-configuration.
10+ */
11+ const config : PlaywrightTestConfig = {
12+ testMatch : / .* .t s / ,
13+ /**
14+ * globalSetup & teardown of test data
15+ * globalTeardown: require.resolve("./tests/global-teardown"),
16+ */
17+ globalSetup : require . resolve ( "./tests/global-setup" ) ,
18+
19+
20+ testDir : "./tests/e2e" ,
21+ /* Maximum time one test can run for. */
22+ timeout : 10 * 10000 ,
23+ expect : {
24+ /**
25+ * Maximum time expect() should wait for the condition to be met.
26+ * For example in `await expect(locator).toHaveText();`
27+ */
28+ timeout : 10 * 10000 ,
29+ } ,
30+ /* Fail the build on CI if you accidentally left test.only in the source code. */
31+ forbidOnly : ! ! process . env . CI ,
32+ /* Retry on CI only */
33+ retries : 2 ,
34+ /* Opt out of parallel tests on CI. */
35+ workers : process . env . CI ? 1 : undefined ,
36+ /* Reporter to use. See https://playwright.dev/docs/test-reporters */
37+ reporter : [ [ "html" , { open : "never" } ] ] ,
38+ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
39+ use : {
40+ storageState : "storageState.json" ,
41+ /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
42+ actionTimeout : 0 ,
43+ screenshot : "off" ,
44+ video : "off" ,
45+ viewport : { width : 1200 , height : 720 } ,
46+ trace : "on-first-retry" ,
47+ baseURL : process . env . APP_HOST_URL ,
48+ launchOptions : {
49+ logger : {
50+ isEnabled : ( ) => {
51+ return false ;
52+ } ,
53+ log : ( name , severity , message , args ) => console . log ( `${ name } : ${ message } ` ) ,
54+ } ,
55+ } ,
56+ } ,
57+ /* Configure projects for major browsers */
58+ projects : [
59+ {
60+ name : "Chromium" ,
61+ use : {
62+ browserName : "chromium" ,
63+ } ,
64+ } ,
65+ {
66+ name : 'safari' ,
67+ use : { ...devices [ 'Desktop Safari' ] } ,
68+ } ,
69+ {
70+ name : "firefox" ,
71+ use : {
72+ browserName : "firefox" ,
73+ } ,
74+ } ,
75+ ] ,
76+ } ;
77+
78+ export default config ;
0 commit comments