blob: 5d2ec1c3f684e9c7d4e8462ff0aa4ea60a016c5b [file] [log] [blame]
Philipp Schraderba072d92024-02-21 17:00:37 -08001import {defineConfig} from 'cypress';
Philipp Schrader175a93c2023-02-19 13:13:40 -08002
Philipp Schraderba072d92024-02-21 17:00:37 -08003export default defineConfig({
Philipp Schrader175a93c2023-02-19 13:13:40 -08004 e2e: {
5 specPattern: ['*.cy.js'],
6 supportFile: false,
7 setupNodeEvents(on, config) {
8 on('before:browser:launch', (browser = {}, launchOptions) => {
9 launchOptions.args.push('--disable-gpu-shader-disk-cache');
Philipp Schrader54cae032023-02-26 15:08:31 -080010 launchOptions.args.push('--enable-logging');
11 launchOptions.args.push('--v=stderr');
Philipp Schradere2e27ff2024-02-25 22:08:55 -080012
13 // Point the browser at a video file to use as a webcam. This lets us
14 // validate things like QR code scanning.
15 launchOptions.args.push('--use-fake-ui-for-media-stream');
16 launchOptions.args.push('--use-fake-device-for-media-stream');
17 const fakeCameraVideo = `${process.env.TEST_UNDECLARED_OUTPUTS_DIR}/fake_camera.mjpeg`;
18 launchOptions.args.push(`--use-file-for-fake-video-capture=${fakeCameraVideo}`);
19
Philipp Schrader54cae032023-02-26 15:08:31 -080020 return launchOptions;
Philipp Schrader175a93c2023-02-19 13:13:40 -080021 });
22
23 // Lets users print to the console:
24 // cy.task('log', 'message here');
25 on('task', {
26 log(message) {
27 console.log(message);
28 return null;
29 },
30 });
31 },
32 },
33});