-
-
Notifications
You must be signed in to change notification settings - Fork 174
/
cypress.config.ts
31 lines (26 loc) · 956 Bytes
/
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
import { defineConfig } from 'cypress';
import ViteConfig from './vite.config';
import cypressDirs from './cypress-dirs.json' assert { type: 'json' };
export default defineConfig({
fixturesFolder: `${cypressDirs.base}/fixtures`,
screenshotsFolder: cypressDirs.screenshots,
video: true,
videosFolder: cypressDirs.videos,
e2e: {
baseUrl: `http://localhost:${getApplicationPort()}/`,
specPattern: `${cypressDirs.base}/**/*.cy.{js,jsx,ts,tsx}`, // Default: cypress/e2e/**/*.cy.{js,jsx,ts,tsx}
supportFile: `${cypressDirs.base}/support/e2e.ts`,
},
/*
Disabling Chrome's web security to allow for faster DOM queries to access DOM earlier than
`cy.get()`. It bypasses the usual same-origin policy constraints
*/
chromeWebSecurity: false,
});
function getApplicationPort(): number {
const port = ViteConfig.server?.port;
if (port === undefined) {
throw new Error('Unknown application port');
}
return port;
}