21720:
[arvados.git] / services / workbench2 / cypress.config.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { defineConfig } from "cypress";
6 import baseWebpackConfig from "./config/webpack.config";
7 import path from "path";
8
9 const webpackConfig = baseWebpackConfig("development");
10
11 export default defineConfig({
12   chromeWebSecurity: false,
13   viewportWidth: 1920,
14   viewportHeight: 1080,
15   downloadsFolder: "cypress/downloads",
16   videoCompression: false,
17
18   // projectId is for use with Cypress Cloud/CI, which we are currently not using
19   // projectId: "pzrqer",
20
21   e2e: {
22     // We've imported your old cypress plugins here.
23     // You may want to clean this up later by importing these.
24     setupNodeEvents(on, config) {
25       return require("./cypress/plugins/index.js")(on, config);
26     },
27     baseUrl: "https://localhost:3000/",
28     experimentalRunAllSpecs: true,
29     // The 2 options below make Electron crash a lot less and Firefox behave better
30     experimentalMemoryManagement: true,
31     numTestsKeptInMemory: 0,
32   },
33
34   component: {
35     devServer: {
36       framework: "react",
37       bundler: "webpack",
38       webpackConfig: {
39         ...webpackConfig,
40         resolve: {
41           ...webpackConfig.resolve,
42           alias: {
43             ...webpackConfig.resolve.alias,
44             // redirect imported modules to the mock files for the cypress tests
45             "common/service-provider": path.resolve("src/cypress/mocks/common/service-provider.ts"),
46           },
47         },
48       },
49     },
50   },
51 });