|
17 | 17 | /// <reference types="node" /> |
18 | 18 |
|
19 | 19 | import { defineConfig } from 'cypress'; |
| 20 | +import * as dotenv from 'dotenv'; |
| 21 | +import * as fs from 'fs'; |
20 | 22 | import path from 'path'; |
21 | 23 |
|
22 | 24 | const PROJECT_ROOT = path.resolve(__dirname); |
23 | 25 |
|
| 26 | +// Load local environment file if it exists |
| 27 | +const envPath = path.join(PROJECT_ROOT, '.env.local'); |
| 28 | +if (fs.existsSync(envPath)) { |
| 29 | + dotenv.config({ path: envPath }); |
| 30 | +} |
| 31 | + |
24 | 32 | export default defineConfig({ |
25 | 33 | video: true, // turn on video recording |
26 | 34 | videoCompression: true, |
27 | 35 | videosFolder: `${PROJECT_ROOT}/videos/e2e`, // where to save .mp4 files |
28 | 36 | screenshotOnRunFailure: true, // auto‑snap on any test failure |
29 | 37 | screenshotsFolder: `${PROJECT_ROOT}/screenshots/e2e`, |
30 | 38 | trashAssetsBeforeRuns: true, // wipe out old videos/screenshots |
| 39 | + defaultCommandTimeout: 30000, // 30 seconds for real API calls |
| 40 | + requestTimeout: 30000, // 30 seconds for API requests |
| 41 | + responseTimeout: 30000, // 30 seconds for API responses |
| 42 | + chromeWebSecurity: false, // Disable web security to allow cross-origin requests |
31 | 43 | e2e: { |
32 | 44 | specPattern: `${PROJECT_ROOT}/src/e2e/specs/**/*.e2e.spec.ts`, |
33 | 45 | supportFile: `${PROJECT_ROOT}/src/e2e/support/index.ts`, |
34 | | - experimentalStudio: true, |
35 | 46 | fixturesFolder: `${PROJECT_ROOT}/src/e2e/fixtures`, |
36 | 47 | setupNodeEvents () { |
37 | 48 | }, |
38 | | - baseUrl: 'https://5bma74uv9c.execute-api.us-east-1.amazonaws.com/dev', |
| 49 | + baseUrl: process.env.BASE_URL || 'https://chat.dev.lisa.aiml-adc.aws.dev', |
39 | 50 | env: { |
40 | | - TEST_ACCOUNT_PASSWORD: process.env.TEST_ACCOUNT_PASSWORD, |
| 51 | + ADMIN_USER_NAME: process.env.ADMIN_USER_NAME, |
| 52 | + ADMIN_PASSWORD: process.env.ADMIN_PASSWORD, |
| 53 | + USER_NAME: process.env.USER_NAME, |
| 54 | + USER_PASSWORD: process.env.USER_PASSWORD, |
41 | 55 | }, |
42 | 56 | }, |
43 | 57 | }); |
0 commit comments