forked from commercetools/merchant-center-application-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.ts
41 lines (38 loc) · 1.18 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
import path from 'path';
import { defineConfig } from 'cypress';
import {
customViewConfig,
customApplicationConfig,
} from '@commercetools-frontend/cypress/task';
export default defineConfig({
retries: 1,
video: false,
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
async setupNodeEvents(on, cypressConfig) {
// Load the config
if (!process.env.CI) {
const envPath = path.join(__dirname, 'cypress/.env');
console.log('Loading environment variables from', envPath);
const dotenv = await import('dotenv');
dotenv.config({ path: envPath });
}
on('task', {
customApplicationConfig,
});
on('task', {
customViewConfig,
});
return Object.assign({}, cypressConfig, {
env: Object.assign({}, cypressConfig.env, {
LOGIN_USER: process.env.CYPRESS_LOGIN_USER,
LOGIN_PASSWORD: process.env.CYPRESS_LOGIN_PASSWORD,
PROJECT_KEY: process.env.CYPRESS_PROJECT_KEY,
PACKAGE_NAME: process.env.CYPRESS_PACKAGE_NAME,
}),
});
},
baseUrl: 'http://localhost:3001',
},
});