1
- import type { PluginOptions } from " @grafana/plugin-e2e" ;
2
- import { defineConfig , devices } from " @playwright/test" ;
3
- import { dirname } from " node:path" ;
1
+ import type { PluginOptions } from ' @grafana/plugin-e2e' ;
2
+ import { defineConfig , devices } from ' @playwright/test' ;
3
+ import { dirname } from ' node:path' ;
4
4
5
- const pluginE2eAuth = `${ dirname ( require . resolve ( " @grafana/plugin-e2e" ) ) } /auth` ;
5
+ const pluginE2eAuth = `${ dirname ( require . resolve ( ' @grafana/plugin-e2e' ) ) } /auth` ;
6
6
7
7
/**
8
8
* Read environment variables from file.
@@ -14,39 +14,39 @@ const pluginE2eAuth = `${dirname(require.resolve("@grafana/plugin-e2e"))}/auth`;
14
14
* See https://playwright.dev/docs/test-configuration.
15
15
*/
16
16
export default defineConfig < PluginOptions > ( {
17
- testDir : " ./tests" ,
17
+ testDir : ' ./tests' ,
18
18
/* Run tests in files in parallel */
19
19
fullyParallel : true ,
20
20
/* Fail the build on CI if you accidentally left test.only in the source code. */
21
21
forbidOnly : ! ! process . env . CI ,
22
22
/* Retry on CI only */
23
23
retries : process . env . CI ? 2 : 0 ,
24
24
/* Opt out of parallel tests on CI. */
25
- workers : process . env . CI ? 1 : undefined ,
25
+ workers : 1 ,
26
26
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
27
- reporter : " html" ,
27
+ reporter : ' html' ,
28
28
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
29
29
use : {
30
30
/* Base URL to use in actions like `await page.goto('/')`. */
31
- baseURL : " http://localhost:3000" ,
31
+ baseURL : ' http://localhost:3000' ,
32
32
33
33
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
34
- trace : " on-first-retry" ,
34
+ trace : ' on-first-retry' ,
35
35
} ,
36
36
37
37
/* Configure projects for major browsers */
38
38
projects : [
39
39
// 1. Login to Grafana and store the cookie on disk for use in other tests.
40
40
{
41
- name : " auth" ,
41
+ name : ' auth' ,
42
42
testDir : pluginE2eAuth ,
43
43
testMatch : [ / .* \. j s / ] ,
44
44
} ,
45
45
// 2. Run tests in Google Chrome. Every test will start authenticated as admin user.
46
46
{
47
- name : " chromium" ,
48
- use : { ...devices [ " Desktop Chrome" ] , storageState : " playwright/.auth/admin.json" } ,
49
- dependencies : [ " auth" ] ,
47
+ name : ' chromium' ,
48
+ use : { ...devices [ ' Desktop Chrome' ] , storageState : ' playwright/.auth/admin.json' } ,
49
+ dependencies : [ ' auth' ] ,
50
50
} ,
51
51
] ,
52
52
} ) ;
0 commit comments