graphdb-workbench-tests 3.0.1-TR1 → 3.0.1

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: 40000,
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) {
@@ -217,7 +217,12 @@ describe('Graphs config', () => {
217
217
  VisualGraphSteps.getGraphConfigSearchPanelName().should('contain', graphConfigName);
218
218
  });
219
219
 
220
- it('Should create graph config with fixed node', () => {
220
+ it('Should create graph config with fixed node', {
221
+ retries: {
222
+ runMode: 1,
223
+ openMode: 0
224
+ }
225
+ }, () => {
221
226
  cy.enableAutocomplete(repositoryId);
222
227
  // Given I have started a create config wizard
223
228
  startCreateConfigWizard();
@@ -147,7 +147,12 @@ describe('Visual graph screen validation', () => {
147
147
  });
148
148
  });
149
149
 
150
- it('Test search for a valid resource with links', () => {
150
+ it('Test search for a valid resource with links', {
151
+ retries: {
152
+ runMode: 1,
153
+ openMode: 0
154
+ }
155
+ }, () => {
151
156
  VisualGraphSteps.openUSRegionUri();
152
157
  // Check include inferred
153
158
  VisualGraphSteps.toggleInferredStatements(true);
@@ -106,7 +106,7 @@ describe('Graphql: edit endpoint settings', () => {
106
106
  "includeInferred": true,
107
107
  "expandOwlSameAs": true,
108
108
  "enableMutations": null,
109
- "defaultRole": "defaultRole",
109
+ "defaultRole": "Default",
110
110
  "enableGraphQLExplain": true,
111
111
  "exposeSomlInGraphQL": false,
112
112
  "disabledChecks": null,
@@ -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());
@@ -39,7 +41,12 @@ describe('Cookie policy', () => {
39
41
  HomeSteps.getCookieConsentPopup().should('not.exist');
40
42
  });
41
43
 
42
- it('Should NOT show cookie policy to user when tracking is not applicable', () => {
44
+ it('Should NOT show cookie policy to user when tracking is not applicable', {
45
+ retries: {
46
+ runMode: 1,
47
+ openMode: 0
48
+ }
49
+ }, () => {
43
50
  SettingsSteps.visit();
44
51
  SettingsSteps.getCookiePolicyButton().should('not.exist');
45
52
  });
@@ -248,40 +248,6 @@ describe('User and Access', () => {
248
248
  }
249
249
  });
250
250
  });
251
- });
252
-
253
- context('GraphQL only and Free Access', () => {
254
- let repositoryId1;
255
- let repositoryId2;
256
- let repositoryId3;
257
- const graphqlUser = 'graphqlUser';
258
-
259
- beforeEach(() => {
260
- cy.viewport(1280, 1000);
261
- RepositoriesStubs.spyGetRepositories();
262
- repositoryId1 = 'user-access-repo1-' + Date.now();
263
- repositoryId2 = 'user-access-repo2-' + Date.now();
264
- repositoryId3 = 'user-access-repo3-' + Date.now();
265
- cy.createRepository({id: repositoryId1});
266
- cy.createRepository({id: repositoryId2});
267
- cy.createRepository({id: repositoryId3});
268
- cy.presetRepository(repositoryId1);
269
- UserAndAccessSteps.visit();
270
- // Users table should be visible
271
- UserAndAccessSteps.getUsersTable().should('be.visible');
272
- });
273
-
274
- afterEach(() => {
275
- cy.loginAsAdmin().then(()=> {
276
- cy.deleteRepository(repositoryId1, true);
277
- cy.deleteRepository(repositoryId2, true);
278
- cy.deleteRepository(repositoryId3, true);
279
- cy.deleteUser(graphqlUser, true);
280
- cy.switchOffFreeAccess(true);
281
- cy.switchOffSecurity(true);
282
- });
283
-
284
- });
285
251
 
286
252
  it('Can have Free Access and GraphQL working together', () => {
287
253
  cy.wait('@getRepositories');
@@ -318,6 +284,10 @@ describe('User and Access', () => {
318
284
  runChecks(checks);
319
285
  }
320
286
  });
287
+ // Turn free access off
288
+ cy.loginAsAdmin().then(()=> {
289
+ cy.switchOffFreeAccess(true);
290
+ });
321
291
  });
322
292
  });
323
293
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "3.0.1-TR1",
3
+ "version": "3.0.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "graphdb-workbench-tests",
9
- "version": "3.0.1-TR1",
9
+ "version": "3.0.1",
10
10
  "license": "Apache-2.0",
11
11
  "devDependencies": {
12
12
  "cypress": "^14.0.3",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "3.0.1-TR1",
3
+ "version": "3.0.1",
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
  };
@@ -13,7 +13,7 @@ Cypress.Commands.add('uploadGraphqlSchema', (repositoryId, schemaPath, schemaId
13
13
  url: `${REPOSITORIES_URL}${repositoryId}/graphql/manage/endpoints/import`,
14
14
  headers: {'Content-type': 'text/yaml'},
15
15
  body: schema
16
- }).should((response) => expect(response.status).to.equal(200));
16
+ }).should((response) => expect(response.status).to.equal(201));
17
17
  waitForGraphqlSchema(repositoryId, schemaId);
18
18
  });
19
19
  });