Skip to content

Commit 59e31b3

Browse files
authored
Fix CI-nightly tests and refactoring cypress config (#7908)
1 parent f7b47fe commit 59e31b3

File tree

5 files changed

+40
-48
lines changed

5 files changed

+40
-48
lines changed

.github/workflows/schedule.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,13 @@ jobs:
313313
name: cypress_screenshots
314314
path: ${{ github.workspace }}/tests/cypress/screenshots
315315

316+
- name: Uploading cypress videos as an artifact
317+
if: failure()
318+
uses: actions/[email protected]
319+
with:
320+
name: cypress_videos_${{ matrix.specs }}
321+
path: ${{ github.workspace }}/tests/cypress/videos
322+
316323
- name: Uploading "cvat" container logs as an artifact
317324
if: failure()
318325
uses: actions/[email protected]

tests/cypress.base.config.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright (C) 2024 CVAT.ai Corporation
2+
//
3+
// SPDX-License-Identifier: MIT
4+
const plugins = require('./cypress/plugins/index');
5+
6+
module.exports = {
7+
video: true,
8+
viewportWidth: 1300,
9+
viewportHeight: 960,
10+
defaultCommandTimeout: 25000,
11+
downloadsFolder: 'cypress/fixtures',
12+
env: {
13+
user: 'admin',
14+
15+
password: '12qwaszx',
16+
},
17+
e2e: {
18+
setupNodeEvents(on, config) {
19+
return plugins(on, config);
20+
},
21+
testIsolation: false,
22+
baseUrl: 'http://localhost:8080',
23+
},
24+
};

tests/cypress.config.js

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
11
const { defineConfig } = require('cypress');
2-
const plugins = require('./cypress/plugins/index');
2+
const baseConfig = require('./cypress.base.config');
33

44
module.exports = defineConfig({
5-
video: true,
6-
viewportWidth: 1300,
7-
viewportHeight: 960,
8-
defaultCommandTimeout: 25000,
5+
...baseConfig,
96
numTestsKeptInMemory: 30, // reduce because out of memory issues
10-
downloadsFolder: 'cypress/fixtures',
11-
env: {
12-
user: 'admin',
13-
14-
password: '12qwaszx',
15-
},
167
e2e: {
17-
setupNodeEvents(on, config) {
18-
return plugins(on, config);
19-
},
20-
testIsolation: false,
21-
baseUrl: 'http://localhost:8080',
8+
...baseConfig.e2e,
229
specPattern: [
2310
'cypress/e2e/auth_page.js',
2411
'cypress/e2e/features/*.js',

tests/cypress_canvas3d.config.js

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,10 @@
11
const { defineConfig } = require('cypress');
2-
const plugins = require('./cypress/plugins/index');
2+
const baseConfig = require('./cypress.base.config');
33

44
module.exports = defineConfig({
5-
video: false,
6-
viewportWidth: 1300,
7-
viewportHeight: 960,
8-
defaultCommandTimeout: 25000,
9-
downloadsFolder: 'cypress/fixtures',
10-
env: {
11-
user: 'admin',
12-
13-
password: '12qwaszx',
14-
},
5+
...baseConfig,
156
e2e: {
16-
setupNodeEvents(on, config) {
17-
return plugins(on, config);
18-
},
19-
testIsolation: false,
20-
baseUrl: 'http://localhost:8080',
7+
...baseConfig.e2e,
218
specPattern: [
229
'cypress/e2e/auth_page.js',
2310
'cypress/e2e/canvas3d_functionality/*.js',

tests/nightly_cypress.config.js

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,10 @@
11
const { defineConfig } = require('cypress');
2-
const plugins = require('./cypress/plugins/index');
2+
const baseConfig = require('./cypress.base.config');
33

44
module.exports = defineConfig({
5-
video: false,
6-
viewportWidth: 1300,
7-
viewportHeight: 960,
8-
defaultCommandTimeout: 25000,
9-
downloadsFolder: 'cypress/fixtures',
10-
env: {
11-
user: 'admin',
12-
13-
password: '12qwaszx',
14-
},
5+
...baseConfig,
156
e2e: {
16-
setupNodeEvents(on, config) {
17-
return plugins(on, config);
18-
},
19-
testIsolation: false,
20-
baseUrl: 'http://localhost:8080',
7+
...baseConfig.e2e,
218
specPattern: [
229
'cypress/e2e/auth_page.js',
2310
'cypress/e2e/features/*.js',

0 commit comments

Comments
 (0)