21842: set getSuggestions to trigger on input focus
[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 import EventEmitter from "events";
9
10 // Increase the default max listeners to avoid warnings
11 // this doesn't matter when running the entire suite,
12 // but necessary when running a single test repeatedly
13 EventEmitter.defaultMaxListeners = 100;
14
15 const webpackConfig = baseWebpackConfig("development");
16
17 export default defineConfig({
18   chromeWebSecurity: false,
19   viewportWidth: 1920,
20   viewportHeight: 1080,
21   downloadsFolder: "cypress/downloads",
22   videoCompression: false,
23
24   // projectId is for use with Cypress Cloud/CI, which we are currently not using
25   // projectId: "pzrqer",
26
27   e2e: {
28     // We've imported your old cypress plugins here.
29     // You may want to clean this up later by importing these.
30       setupNodeEvents(on, config) {
31           require("cypress-fail-fast/plugin")(on, config);
32           require('./cypress/plugins/index.js')(on, config)
33           return config;
34       },
35       baseUrl: 'https://localhost:3000/',
36       experimentalRunAllSpecs: true,
37       // The 2 options below make Electron crash a lot less and Firefox behave better
38       experimentalMemoryManagement: true,
39       numTestsKeptInMemory: 2,
40   },
41
42   component: {
43     devServer: {
44       framework: "react",
45       bundler: "webpack",
46       webpackConfig: {
47         ...webpackConfig,
48         resolve: {
49           ...webpackConfig.resolve,
50           alias: {
51             ...webpackConfig.resolve.alias,
52             // redirect imported modules to the mock files for the cypress tests
53             "common/service-provider": path.resolve("src/cypress/mocks/service-provider.ts"),
54           },
55         },
56       },
57     },
58   },
59 });