forked from rancher/dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcypress.config.ts
45 lines (42 loc) · 1.35 KB
/
cypress.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { defineConfig } from 'cypress';
require('dotenv').config();
/**
* Filter test spec paths based on env var configuration
* @returns
*/
const getSpecPattern = (): string[] => {
const optionalPaths = [
{
path: 'cypress/e2e/tests/setup/**/*.spec.ts',
active: process.env.TEST_SKIP_SETUP !== 'true'
}
];
const activePaths = optionalPaths.filter(({ active }) => Boolean(active)).map(({ path }) => path);
return [
...activePaths,
'cypress/e2e/tests/pages/**/*.spec.ts',
'cypress/e2e/tests/navigation/**/*.spec.ts'
];
};
const baseUrl = (process.env.TEST_BASE_URL || 'https://localhost:8005').replace(/\/$/, '');
export default defineConfig({
projectId: process.env.TEST_PROJECT_ID,
defaultCommandTimeout: 60000,
trashAssetsBeforeRuns: true,
env: {
baseUrl,
username: process.env.TEST_USERNAME,
password: process.env.TEST_PASSWORD,
bootstrapPassword: process.env.CATTLE_BOOTSTRAP_PASSWORD,
},
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.ts')(on, config);
},
experimentalSessionAndOrigin: true,
specPattern: getSpecPattern(),
baseUrl
},
});