graphdb-workbench-tests 2.8.5 → 2.8.6-RC2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cypress.config.js CHANGED
@@ -9,6 +9,10 @@ module.exports = defineConfig({
9
9
  defaultCommandTimeout: 25000,
10
10
  numTestsKeptInMemory: 10,
11
11
  e2e: {
12
+ retries: {
13
+ runMode: 2,
14
+ openMode: 0
15
+ },
12
16
  // We've imported your old cypress plugins here.
13
17
  // You may want to clean this up later by importing these.
14
18
  setupNodeEvents(on, config) {
@@ -2,6 +2,7 @@ import HomeSteps from '../../steps/home-steps';
2
2
  import {EnvironmentStubs} from "../../stubs/environment-stubs";
3
3
  import {SecurityStubs} from "../../stubs/security-stubs";
4
4
  import {SettingsSteps} from "../../steps/setup/settings-steps";
5
+ import {LicenseStubs} from "../../stubs/license-stubs";
5
6
 
6
7
  Cypress.env('set_default_user_data', false);
7
8
 
@@ -9,6 +10,7 @@ describe('Cookie policy', () => {
9
10
  beforeEach(() => {
10
11
  cy.setDefaultUserData(false);
11
12
  cy.viewport(1280, 1000);
13
+ LicenseStubs.stubFreeLicense();
12
14
  });
13
15
 
14
16
  afterEach(() => cy.setDefaultUserData());
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "2.8.5",
3
+ "version": "2.8.6-RC2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "graphdb-workbench-tests",
9
- "version": "2.8.5",
9
+ "version": "2.8.6-RC2",
10
10
  "license": "Apache-2.0",
11
11
  "devDependencies": {
12
12
  "cypress": "^13.3.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "2.8.5",
3
+ "version": "2.8.6-RC2",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "scripts": {
6
6
  "prepack": "npm shrinkwrap",
package/plugins/index.js CHANGED
@@ -12,6 +12,7 @@
12
12
  // the project's config changing)
13
13
 
14
14
  const del = require('del');
15
+ const retryTracker = {};
15
16
 
16
17
  module.exports = (on, config) => {
17
18
  // `on` is used to hook into various events Cypress emits
@@ -29,17 +30,69 @@ module.exports = (on, config) => {
29
30
  }
30
31
  });
31
32
 
32
- // keep only the videos for the failed specs
33
33
  on('after:spec', (spec, results) => {
34
+ // Retry tracking
35
+ if (!retryTracker.flaky) {
36
+ retryTracker.flaky = {};
37
+ }
38
+
39
+ if (!retryTracker.broken) {
40
+ retryTracker.broken = {};
41
+ }
42
+
43
+ results.tests.forEach((test) => {
44
+ const title = test.title.join(' ');
45
+ const attempts = test.attempts.length;
46
+ const retries = attempts - 1;
47
+
48
+ if (retries < 1) {
49
+ return;
50
+ }
51
+
52
+ if (test.state === 'passed') {
53
+ retryTracker.flaky[title] = retries;
54
+ }
55
+
56
+ if (test.state === 'failed') {
57
+ retryTracker.broken[title] = retries;
58
+ }
59
+ });
60
+
61
+ // Video cleanup
34
62
  if (results && results.video) {
35
- // Do we have failures for any retry attempts?
36
- const failures = results.tests.some((test) => {
37
- return test.attempts.some((attempt) => attempt.state === 'failed');
38
- });
63
+ const failures = results.tests.some((test) =>
64
+ test.attempts.some((attempt) => attempt.state === 'failed')
65
+ );
39
66
  if (!failures) {
40
- // delete the video if the spec passed and no tests retried
41
67
  return del(results.video);
42
68
  }
43
69
  }
44
70
  });
71
+
72
+ on('after:run', () => {
73
+ const { flaky = {}, broken = {} } = retryTracker;
74
+
75
+ const printGroup = (label, group) => {
76
+ const entries = Object.entries(group);
77
+ if (entries.length === 0) {
78
+ return;
79
+ }
80
+
81
+ console.log(`\n ${label} (${entries.length}):`);
82
+ entries.forEach(([name, retry]) => {
83
+ console.log(` * ${name}`);
84
+ console.log(` ↪ retried ${retry} time(s), total runs: ${retry + 1}`);
85
+ });
86
+ };
87
+
88
+ if (Object.keys(flaky).length === 0 && Object.keys(broken).length === 0) {
89
+ console.log('\n======================================== Retry Summary ========================================\n️ [PASS] No retried tests!\n====================================================================================================\n');
90
+ return;
91
+ }
92
+
93
+ console.log('\n======================================== Retry Summary ========================================');
94
+ printGroup('[WARNING] Flaky tests', flaky);
95
+ printGroup('[FAIL] Broken tests', broken);
96
+ console.log('====================================================================================================\n');
97
+ });
45
98
  };