graphdb-workbench-tests 2.2.1-TR3 → 2.2.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.
@@ -6,7 +6,7 @@
6
6
 
7
7
  const path = require('path');
8
8
  const cypress = require('cypress');
9
- const cypressConfig = require('../cypress.json');
9
+ const cypressConfig = require('../cypress.config.js');
10
10
 
11
11
  const originalWorkingDir = process.cwd();
12
12
 
@@ -0,0 +1,21 @@
1
+ const {defineConfig} = require('cypress');
2
+
3
+ module.exports = defineConfig({
4
+ projectId: 'v35btb',
5
+ fixturesFolder: 'fixtures',
6
+ screenshotsFolder: 'report/screenshots',
7
+ videosFolder: 'report/videos',
8
+ video: false,
9
+ defaultCommandTimeout: 15000,
10
+ numTestsKeptInMemory: 10,
11
+ e2e: {
12
+ // We've imported your old cypress plugins here.
13
+ // You may want to clean this up later by importing these.
14
+ setupNodeEvents(on, config) {
15
+ return require('./plugins/index.js')(on, config);
16
+ },
17
+ baseUrl: 'http://localhost:9000',
18
+ specPattern: 'integration-flaky/**/*.{js,jsx,ts,tsx}',
19
+ supportFile: 'support/index.js'
20
+ }
21
+ });
@@ -0,0 +1,21 @@
1
+ const {defineConfig} = require('cypress');
2
+
3
+ module.exports = defineConfig({
4
+ projectId: 'v35btb',
5
+ fixturesFolder: 'fixtures',
6
+ screenshotsFolder: 'report/screenshots',
7
+ videosFolder: 'report/videos',
8
+ video: false,
9
+ defaultCommandTimeout: 15000,
10
+ numTestsKeptInMemory: 10,
11
+ e2e: {
12
+ // We've imported your old cypress plugins here.
13
+ // You may want to clean this up later by importing these.
14
+ setupNodeEvents(on, config) {
15
+ return require('./plugins/index.js')(on, config);
16
+ },
17
+ baseUrl: 'http://localhost:9000',
18
+ specPattern: 'integration/**/*.{js,jsx,ts,tsx}',
19
+ supportFile: 'support/index.js'
20
+ }
21
+ });
@@ -238,6 +238,7 @@
238
238
  "ontop.repos.translate.data": "Ontop repositories translate data stored in an SQL database to a virtual SPARQL endpoint.",
239
239
  "fedex.virtual.sparql": "FedX Virtual SPARQL",
240
240
  "fedex.multi.sparql.endpoints": "FedX repositories provide transparent federation of multiple SPARQL endpoints under a single virtual endpoint.",
241
+ "fedex.experimental.feature.warning": "GraphDB FedX federation is currently an experimental feature. Not recommended to be used in a production environment.",
241
242
  "connector.label": "connector",
242
243
  "eta.label": "ETA:",
243
244
  "processed.entities": "Processed entities:",
@@ -1,5 +1,3 @@
1
- import VisualGraphSteps from "../../steps/visual-graph-steps";
2
-
3
1
  const FILE_TO_IMPORT = 'wine.rdf';
4
2
  const DRY_GRAPH = "http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Dry";
5
3
 
@@ -48,12 +46,6 @@ describe('Visual graph screen validation', () => {
48
46
  cy.window();
49
47
  });
50
48
 
51
- it('Test search for a resource - suggestions', () => {
52
- getSearchField().should('be.visible').type(VALID_RESOURCE);
53
- // Verify that a list of suggested resources is displayed as you type.
54
- cy.get('#auto-complete-results-wrapper .result-item').should('have.length', 1);
55
- });
56
-
57
49
  it('Test search for an invalid resource', () => {
58
50
  getSearchField().should('be.visible').type('.invalid_resource');
59
51
  // There are two buttons rendered in the DOM where one of them is hidden. We need the visible one.
@@ -532,66 +524,6 @@ describe('Visual graph screen validation', () => {
532
524
  .and('contain', 'No graph configs');
533
525
  });
534
526
 
535
- it('CRUD on saved graph', () => {
536
- const graphConfigName = 'MyGraphConfig_' + Date.now();
537
- const namedGraph = 'myGraph_' + Date.now();
538
- const renamedGraph = 'myRenamedGraph_' + Date.now();
539
-
540
- //Creates saved graph
541
- cy.visit('graphs-visualizations');
542
- getCreateCustomGraphLink().click();
543
- cy.url().should('include', '/config/save');
544
- getGraphConfigName().type(graphConfigName);
545
- cy.get('[data-cy="graph-config-by-graph-query-checkbox"]').check();
546
- cy.pasteQuery('CONSTRUCT WHERE {?s ?p ?o} LIMIT 10').then( () => {
547
- getSaveConfig().click();
548
- }
549
- );
550
- getSaveConfig().click();
551
- cy.url().should('include', 'graphs-visualizations');
552
- cy.contains('td', graphConfigName).should('be.visible').parent().within(() => {
553
- cy.get('td a')
554
- .get('[data-cy="graph-config-starting-point-query-results"]').should('be.visible').click();
555
- });
556
- VisualGraphSteps
557
- .updateGraphConfiguration(namedGraph);
558
-
559
- //Visualize saved graph
560
- cy.visit('graphs-visualizations');
561
- cy.contains('td', namedGraph).parent().within(() => {
562
- cy.get('td a').contains(namedGraph).click();
563
- });
564
- cy.get('[data-cy="save-or-update-graph"]').should('be.visible');
565
-
566
- //Finds the button "Get URL to Graph" and opens the modal form "Copy URL to clipboard"
567
- cy.visit('graphs-visualizations');
568
- cy.contains('td', namedGraph).parent().within( () => {
569
- cy.get('td a')
570
- .get('[data-cy="copy-to-clipboard-saved-graph"]').click();
571
- });
572
- cy.get( '[id="copyToClipboardForm"]').contains('Copy URL to clipboard');
573
-
574
- //Renames saved graph
575
- cy.visit('graphs-visualizations');
576
- cy.contains('td', namedGraph).parent().within( () => {
577
- cy.get('td a')
578
- .get('[data-cy="rename-saved-graph"]').click();
579
- });
580
- cy.get('[id="saveGraphForm"]')
581
- .get('[id="wb-graphviz-savegraph-name"]').clear().type(renamedGraph)
582
- .get('[id="wb-graphviz-savegraph-submit"]').click();
583
- cy.get('.toast').contains('Saved graph ' + renamedGraph + ' was edited.');
584
- cy.hideToastContainer();
585
-
586
- //Deletes saved graph
587
- VisualGraphSteps
588
- .deleteSavedGraph(renamedGraph);
589
-
590
- //Deletes graph config
591
- VisualGraphSteps
592
- .deleteGraphConfig(graphConfigName);
593
- });
594
-
595
527
  // Visual graph home view access
596
528
 
597
529
  function getSearchField() {
@@ -765,11 +697,6 @@ describe('Visual graph screen validation', () => {
765
697
  .find('.return-home-btn').should('be.visible').click();
766
698
  }
767
699
 
768
- function confirmDelete() {
769
- cy.get('.modal-footer .confirm-btn').click();
770
- cy.get('.modal').should('not.exist');
771
- }
772
-
773
700
  function updateLinksLimitField(value) {
774
701
  return getLinksNumberField().invoke('val', value).trigger('change', {force: true});
775
702
  }
@@ -1,4 +1,4 @@
1
- describe('Help / REST API', () => {
1
+ describe.skip('Help / REST API', () => {
2
2
 
3
3
  before(() => {
4
4
  // Disables the security (only for this spec) to be able to interact with Swagger's iframe
@@ -1,6 +1,4 @@
1
- // Skipped because cluster health throws an error as there is no cluster.
2
- // TODO Unskip this either when cluster is available for cypress tests or when proper error handling in the monitor view is implemented
3
- describe.skip('Monitor Resources', () => {
1
+ describe('Monitor Resources', () => {
4
2
 
5
3
  let repositoryId;
6
4
 
@@ -16,8 +14,7 @@ describe.skip('Monitor Resources', () => {
16
14
  cy.window();
17
15
 
18
16
  // Wait for loaders to disappear
19
- cy.get('.ot-splash').should('not.be.visible');
20
- cy.get('.ot-loader').should('not.be.visible');
17
+ getTabsPanel().should('be.visible');
21
18
 
22
19
  // Ensure the chart on the default active tab is rendered
23
20
  getActiveTabContent().should('be.visible');
@@ -51,9 +48,21 @@ describe.skip('Monitor Resources', () => {
51
48
  return getTabContent().find(`#${id}`);
52
49
  }
53
50
 
51
+ function getErrorsPane() {
52
+ return cy.get('.errors');
53
+ }
54
+
55
+ function getErrors() {
56
+ return getErrorsPane().find('.error');
57
+ }
58
+
59
+ function getError(index) {
60
+ return getErrors().eq(index);
61
+ }
62
+
54
63
  function verifyCharts(charts) {
55
64
  charts.forEach((chart) => {
56
- getChart(chart.id).scrollIntoView().find('.chart-header').should('contain', chart.label);
65
+ getChart(chart.id).scrollIntoView().find('.title').should('contain', chart.label);
57
66
  getChart(chart.id).scrollIntoView().find(`.${chart.type}`).should('be.visible');
58
67
  });
59
68
  }
@@ -74,7 +83,7 @@ describe.skip('Monitor Resources', () => {
74
83
  it('Resource monitoring tab should show cpu, file, storage and memory charts', () => {
75
84
  const charts = [{
76
85
  id: 'CPUUsageGraphic',
77
- label: 'System CPU Load',
86
+ label: 'System CPU load',
78
87
  type: 'nv-lineChart'
79
88
  }, {
80
89
  id: 'openFileDescriptors',
@@ -90,7 +99,7 @@ describe.skip('Monitor Resources', () => {
90
99
  type: 'nv-lineChart'
91
100
  }, {
92
101
  id: 'diskStorage',
93
- label: 'Disk Storage',
102
+ label: 'Disk storage',
94
103
  type: 'nv-multiBarHorizontalChart'
95
104
  }];
96
105
  verifyCharts(charts);
@@ -118,13 +127,9 @@ describe.skip('Monitor Resources', () => {
118
127
  verifyCharts(charts);
119
128
  });
120
129
 
121
- it('Cluster health monitoring tab should show charts', () => {
130
+ it('Should show info and no error for non existing cluster', () => {
131
+ getErrorsPane().should('not.be.visible');
122
132
  getTabButtons().eq(2).click();
123
- const charts = [{
124
- id: 'clusterHealth',
125
- label: 'Cluster health',
126
- type: 'nv-stackedarea'
127
- }];
128
- verifyCharts(charts);
133
+ cy.get('.alert-info').should('be.visible').and('contain', 'Charts are not available because GraphDB is not in cluster configuration');
129
134
  });
130
135
  });
@@ -155,7 +155,7 @@ describe('User and Access', () => {
155
155
  getConfirmPasswordField().type(password);
156
156
  getRoleRadioButton(role).click();
157
157
  if (role === "#roleUser") {
158
- getRepoitoryRightsList().contains('Any data repository').nextUntil('.write').within(() => {
158
+ getRepoitoryRightsList().contains('Any data repository').nextUntil('.write').eq(1).within(() => {
159
159
  cy.get('.write').click();
160
160
  });
161
161
  getConfirmUserCreateButton().click();
@@ -13,7 +13,7 @@ describe('YASQE and YASR language change validation', () => {
13
13
  SparqlSteps.changeLanguage('en');
14
14
 
15
15
  cy.deleteRepository(repositoryId);
16
- })
16
+ });
17
17
 
18
18
  context('Default language should be active and language change should affect labels', () => {
19
19
  it('should change labels in SPARQL view', () => {
@@ -32,31 +32,5 @@ describe('YASQE and YASR language change validation', () => {
32
32
  SparqlSteps.getEditorAndResultsBtn().should('contain', 'Éditeur et résultats');
33
33
  SparqlSteps.getResultsOnlyBtn().should('contain', 'Résultats seulement');
34
34
  });
35
-
36
- it('should change labels in SPARQL results view', function () {
37
- SparqlSteps.selectSavedQuery('Add statements');
38
- SparqlSteps.executeQuery();
39
- SparqlSteps.selectSavedQuery('SPARQL Select template');
40
- SparqlSteps.executeQuery();
41
-
42
- // Go to Results only view
43
- SparqlSteps.getResultsOnlyBtn().click();
44
-
45
- // Check some labels are in default language
46
- SparqlSteps.getTabWithTableText().should('contain', 'Table');
47
- SparqlSteps.getTabWithRawResponseText().should('contain', 'Raw Response');
48
- SparqlSteps.getTabWithPivotTableText().should('contain', 'Pivot Table');
49
- SparqlSteps.getTabWithGoogleChartText().should('contain', 'Google Chart');
50
- SparqlSteps.getResultsDescription().should('contain', 'Showing results from');
51
-
52
- SparqlSteps.changeLanguage('fr');
53
-
54
- // The text in the labels should change
55
- SparqlSteps.getTabWithTableText().should('contain', 'Tableau');
56
- SparqlSteps.getTabWithRawResponseText().should('contain', 'Réponse brute');
57
- SparqlSteps.getTabWithPivotTableText().should('contain', 'Table de pivotement');
58
- SparqlSteps.getTabWithGoogleChartText().should('contain', 'Graphique Google');
59
- SparqlSteps.getResultsDescription().should('contain', 'Liste de résultats de');
60
- });
61
35
  });
62
- })
36
+ });
@@ -344,7 +344,8 @@ describe('SPARQL screen validation', () => {
344
344
  getBooleanResult().should('be.visible').and('contain', 'NO');
345
345
  });
346
346
 
347
- it('Test execute (CONSTRUCT) query', () => {
347
+ // This test depends on external service http://factforge.net/repositories/ff-news which can occasionally fail.
348
+ it.skip('Test execute (CONSTRUCT) query', () => {
348
349
  cy.fixture('queries/construct-query.sparql').then(constructQuery => {
349
350
  cy.pasteQuery(constructQuery);
350
351
  });
@@ -365,40 +366,6 @@ describe('SPARQL screen validation', () => {
365
366
  getResultsDownloadButton().should('be.visible').and('not.be.disabled');
366
367
  });
367
368
 
368
- it('Test execute query with and without "Including inferred" selected', () => {
369
- let insertQuery = 'INSERT DATA { <urn:a> <http://a/b> <urn:b> . <urn:b> <http://a/b> <urn:c> . }';
370
-
371
- cy.pasteQuery(insertQuery);
372
- SparqlSteps.executeQuery();
373
-
374
- getUpdateMessage().should('be.visible');
375
- getResultsWrapper().should('not.be.visible');
376
-
377
- // Should be enabled by default
378
- getInferenceButton()
379
- .find('.icon-inferred-on')
380
- .should('be.visible');
381
-
382
- cy.pasteQuery(DEFAULT_QUERY);
383
- SparqlSteps.executeQuery();
384
-
385
- // Confirm that all statements are available (70 from ruleset, 2 explicit and 2 inferred)
386
- getResultsWrapper().should('be.visible');
387
-
388
- verifyResultsPageLength(74);
389
-
390
- // Uncheck ‘Include inferred’
391
- cy.waitUntil(() =>
392
- getInferenceButton().find('.icon-inferred-on')
393
- .then(infBtn => infBtn && cy.wrap(infBtn).click()))
394
- .then(() =>
395
- cy.get('.icon-inferred-off').should('be.visible'));
396
-
397
- // Confirm that only inferred statements (only 2) are available
398
- SparqlSteps.executeQuery();
399
- verifyResultsPageLength(2);
400
- });
401
-
402
369
  it('should test text mining plugin', () => {
403
370
  cy.pasteQuery(GATE_CLIENT_CREATE_QUERY);
404
371
  cy.executeQuery();
@@ -424,16 +391,19 @@ describe('SPARQL screen validation', () => {
424
391
  });
425
392
 
426
393
  context('SPARQL queries with OWL-Horst Optimized', () => {
427
- beforeEach(() => SparqlSteps.createRepoAndVisit(repositoryId, {
428
- params: {
429
- ruleset: {
430
- value: 'owl-horst-optimized'
431
- },
432
- disableSameAs: {
433
- value: false
394
+ beforeEach(() => {
395
+ repositoryId = 'sparql-' + Date.now();
396
+ SparqlSteps.createRepoAndVisit(repositoryId, {
397
+ params: {
398
+ ruleset: {
399
+ value: 'owl-horst-optimized'
400
+ },
401
+ disableSameAs: {
402
+ value: false
403
+ }
434
404
  }
435
- }
436
- }));
405
+ })
406
+ });
437
407
 
438
408
  it('Test execute query including inferred with ruleset "OWL-Horst (Optimized)"', () => {
439
409
  cy.importServerFile(repositoryId, FILE_TO_IMPORT);
@@ -502,7 +472,10 @@ describe('SPARQL screen validation', () => {
502
472
  });
503
473
 
504
474
  context('SPARQL view & download', () => {
505
- beforeEach(() => SparqlSteps.createRepoAndVisit(repositoryId));
475
+ beforeEach(() => {
476
+ repositoryId = 'sparql-' + Date.now();
477
+ SparqlSteps.createRepoAndVisit(repositoryId)
478
+ });
506
479
 
507
480
  it('Test open a new tab', () => {
508
481
  getNewTabButton().click();
@@ -688,7 +661,10 @@ describe('SPARQL screen validation', () => {
688
661
  });
689
662
 
690
663
  context('Saved queries & links', () => {
691
- beforeEach(() => SparqlSteps.createRepoAndVisit(repositoryId));
664
+ beforeEach(() => {
665
+ repositoryId = 'sparql-' + Date.now();
666
+ SparqlSteps.createRepoAndVisit(repositoryId)
667
+ });
692
668
 
693
669
  const QUERY_FOR_SAVING = 'select (count (*) as ?cnt)\n' +
694
670
  'where {\n' +
@@ -943,6 +919,7 @@ describe('SPARQL screen validation', () => {
943
919
  const wineUri = '<http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#CorbansDryWhiteRiesling>';
944
920
 
945
921
  it('should suggest resources in the "SPARQL" editor when autocomplete is enabled', () => {
922
+ repositoryId = 'sparql-' + Date.now();
946
923
  SparqlSteps.createRepository(repositoryId);
947
924
 
948
925
  cy.importServerFile(repositoryId, FILE_TO_IMPORT);
@@ -977,6 +954,7 @@ describe('SPARQL screen validation', () => {
977
954
  });
978
955
 
979
956
  it('should not suggests resources in the "SPARQL" editor if the autocomplete is NOT enabled', () => {
957
+ repositoryId = 'sparql-' + Date.now();
980
958
  SparqlSteps.createRepoAndVisit(repositoryId);
981
959
 
982
960
  clearQuery();
@@ -0,0 +1,118 @@
1
+ import VisualGraphSteps from "../../steps/visual-graph-steps";
2
+
3
+ const FILE_TO_IMPORT = 'wine.rdf';
4
+ const VALID_RESOURCE = 'USRegion';
5
+
6
+ describe('Visual graph screen validation', () => {
7
+
8
+ let repositoryId = 'graphRepo' + Date.now();
9
+
10
+ before(() => {
11
+ cy.clearLocalStorage('ls.graphs-viz');
12
+ repositoryId = 'repo' + Date.now();
13
+ cy.createRepository({id: repositoryId});
14
+ cy.importServerFile(repositoryId, FILE_TO_IMPORT);
15
+ });
16
+
17
+ after(() => {
18
+ cy.clearLocalStorage('ls.graphs-viz');
19
+ cy.setDefaultUserData();
20
+ cy.deleteRepository(repositoryId);
21
+ });
22
+
23
+ beforeEach(() => {
24
+ cy.presetRepository(repositoryId);
25
+ });
26
+
27
+ it('CRUD on saved graph', () => {
28
+ const graphConfigName = 'MyGraphConfig_' + Date.now();
29
+ const namedGraph = 'myGraph_' + Date.now();
30
+ const renamedGraph = 'myRenamedGraph_' + Date.now();
31
+
32
+ //Creates saved graph
33
+ cy.visit('graphs-visualizations');
34
+ getCreateCustomGraphLink().click();
35
+ cy.url().should('include', '/config/save');
36
+ getGraphConfigName().type(graphConfigName);
37
+ cy.get('[data-cy="graph-config-by-graph-query-checkbox"]').check();
38
+ cy.pasteQuery('CONSTRUCT WHERE {?s ?p ?o} LIMIT 10').then( () => {
39
+ getSaveConfig().click();
40
+ }
41
+ );
42
+ getSaveConfig().click();
43
+ cy.url().should('include', 'graphs-visualizations');
44
+ cy.contains('td', graphConfigName).should('be.visible').parent().within(() => {
45
+ cy.get('td a [data-cy="graph-config-starting-point-query-results"]').click();
46
+ });
47
+ VisualGraphSteps
48
+ .updateGraphConfiguration(namedGraph);
49
+
50
+ //Visualize saved graph
51
+ cy.visit('graphs-visualizations');
52
+ cy.contains('td', namedGraph).parent().within(() => {
53
+ cy.get('td a').contains(namedGraph).click();
54
+ });
55
+ cy.get('[data-cy="save-or-update-graph"]').should('be.visible');
56
+
57
+ //Finds the button "Get URL to Graph" and opens the modal form "Copy URL to clipboard"
58
+ cy.visit('graphs-visualizations');
59
+ cy.contains('td', namedGraph).parent().within( () => {
60
+ cy.get('td a')
61
+ .get('[data-cy="copy-to-clipboard-saved-graph"]').click();
62
+ });
63
+ cy.get( '[id="copyToClipboardForm"]').contains('Copy URL to clipboard');
64
+
65
+ //Renames saved graph
66
+ cy.visit('graphs-visualizations');
67
+ cy.contains('td', namedGraph).parent().within( () => {
68
+ cy.get('td a')
69
+ .get('[data-cy="rename-saved-graph"]').click();
70
+ });
71
+ cy.get('[id="saveGraphForm"]')
72
+ .get('[id="wb-graphviz-savegraph-name"]').clear().type(renamedGraph)
73
+ .get('[id="wb-graphviz-savegraph-submit"]').click();
74
+ cy.get('.toast').contains('Saved graph ' + renamedGraph + ' was edited.');
75
+ cy.hideToastContainer();
76
+
77
+ //Deletes saved graph
78
+ VisualGraphSteps
79
+ .deleteSavedGraph(renamedGraph);
80
+
81
+ //Deletes graph config
82
+ VisualGraphSteps
83
+ .deleteGraphConfig(graphConfigName);
84
+ });
85
+
86
+ context('When autocomplete is enabled', () => {
87
+ before(() => {
88
+ cy.enableAutocomplete(repositoryId);
89
+ });
90
+
91
+ beforeEach(() => {
92
+ cy.visit('graphs-visualizations');
93
+ cy.window();
94
+ });
95
+
96
+ it('Test search for a resource - suggestions', () => {
97
+ getSearchField().should('be.visible').type(VALID_RESOURCE);
98
+ // Verify that a list of suggested resources is displayed as you type.
99
+ cy.get('#auto-complete-results-wrapper .result-item').should('have.length', 1);
100
+ });
101
+ });
102
+ });
103
+
104
+ function getSearchField() {
105
+ return cy.get('.search-rdf-resources input:visible');
106
+ }
107
+
108
+ function getCreateCustomGraphLink() {
109
+ return cy.get('.create-graph-config').should('be.visible');
110
+ }
111
+
112
+ function getGraphConfigName() {
113
+ return cy.get('.graph-config-name').should('be.visible');
114
+ }
115
+
116
+ function getSaveConfig() {
117
+ return cy.get('.btn-save-config').should('be.visible');
118
+ }
@@ -0,0 +1,45 @@
1
+ import SparqlSteps from '../../steps/sparql-steps';
2
+
3
+ describe('YASQE and YASR language change validation', () => {
4
+ let repositoryId;
5
+
6
+ beforeEach(() => {
7
+ repositoryId = 'sparql-' + Date.now();
8
+ SparqlSteps.createRepoAndVisit(repositoryId);
9
+ });
10
+
11
+ afterEach(() => {
12
+ // Change the language back to English
13
+ SparqlSteps.changeLanguage('en');
14
+
15
+ cy.deleteRepository(repositoryId);
16
+ });
17
+
18
+ context('Default language should be active and language change should affect labels', () => {
19
+ it('should change labels in SPARQL results view', function () {
20
+ SparqlSteps.selectSavedQuery('Add statements');
21
+ SparqlSteps.executeQuery();
22
+ SparqlSteps.selectSavedQuery('SPARQL Select template');
23
+ SparqlSteps.executeQuery();
24
+
25
+ // Go to Results only view
26
+ SparqlSteps.getResultsOnlyBtn().click();
27
+
28
+ // Check some labels are in default language
29
+ SparqlSteps.getTabWithTableText().should('contain', 'Table');
30
+ SparqlSteps.getTabWithRawResponseText().should('contain', 'Raw Response');
31
+ SparqlSteps.getTabWithPivotTableText().should('contain', 'Pivot Table');
32
+ SparqlSteps.getTabWithGoogleChartText().should('contain', 'Google Chart');
33
+ SparqlSteps.getResultsDescription().should('contain', 'Showing results from');
34
+
35
+ SparqlSteps.changeLanguage('fr');
36
+
37
+ // The text in the labels should change
38
+ SparqlSteps.getTabWithTableText().should('contain', 'Tableau');
39
+ SparqlSteps.getTabWithRawResponseText().should('contain', 'Réponse brute');
40
+ SparqlSteps.getTabWithPivotTableText().should('contain', 'Table de pivotement');
41
+ SparqlSteps.getTabWithGoogleChartText().should('contain', 'Graphique Google');
42
+ SparqlSteps.getResultsDescription().should('contain', 'Liste de résultats de');
43
+ });
44
+ });
45
+ })
@@ -0,0 +1,75 @@
1
+ import SparqlSteps from '../../steps/sparql-steps';
2
+
3
+ describe('SPARQL screen validation', () => {
4
+ let repositoryId;
5
+
6
+ const DEFAULT_QUERY = 'select * where { \n' +
7
+ '\t?s ?p ?o .\n' +
8
+ '} limit 100';
9
+
10
+ afterEach(() => {
11
+ cy.deleteRepository(repositoryId);
12
+ });
13
+
14
+ context('SPARQL queries & filtering', () => {
15
+ beforeEach(() => {
16
+ repositoryId = 'sparql-' + Date.now();
17
+ SparqlSteps.createRepoAndVisit(repositoryId)
18
+ });
19
+
20
+ it('Test execute query with and without "Including inferred" selected', () => {
21
+ let insertQuery = 'INSERT DATA { <urn:a> <http://a/b> <urn:b> . <urn:b> <http://a/b> <urn:c> . }';
22
+
23
+ cy.pasteQuery(insertQuery);
24
+ SparqlSteps.executeQuery();
25
+
26
+ getUpdateMessage().should('be.visible');
27
+ getResultsWrapper().should('not.be.visible');
28
+
29
+ // Should be enabled by default
30
+ getInferenceButton()
31
+ .find('.icon-inferred-on')
32
+ .should('be.visible');
33
+
34
+ cy.pasteQuery(DEFAULT_QUERY);
35
+ SparqlSteps.executeQuery();
36
+
37
+ // Confirm that all statements are available (70 from ruleset, 2 explicit and 2 inferred)
38
+ getResultsWrapper().should('be.visible');
39
+
40
+ verifyResultsPageLength(74);
41
+
42
+ // Uncheck ‘Include inferred’
43
+ cy.waitUntil(() =>
44
+ getInferenceButton().find('.icon-inferred-on')
45
+ .then(infBtn => infBtn && cy.wrap(infBtn).click()))
46
+ .then(() =>
47
+ cy.get('.icon-inferred-off').should('be.visible'));
48
+
49
+ // Confirm that only inferred statements (only 2) are available
50
+ SparqlSteps.executeQuery();
51
+ verifyResultsPageLength(2);
52
+ });
53
+ });
54
+
55
+ function getTableResultRows() {
56
+ return getResultsWrapper().find('.resultsTable tbody tr');
57
+ }
58
+
59
+ function verifyResultsPageLength(resultLength) {
60
+ getTableResultRows()
61
+ .should('have.length', resultLength);
62
+ }
63
+
64
+ function getUpdateMessage() {
65
+ return cy.get('#yasr-inner .alert-info.update-info');
66
+ }
67
+
68
+ function getResultsWrapper() {
69
+ return cy.get('#yasr-inner .yasr_results');
70
+ }
71
+
72
+ function getInferenceButton() {
73
+ return cy.get('#inference').scrollIntoView();
74
+ }
75
+ });
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "2.2.1-TR3",
3
+ "version": "2.2.1",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "scripts": {
6
6
  "start": "cypress open",
7
+ "start:flaky": "cypress open --config-file cypress-flaky.config.js",
7
8
  "test": "cypress run",
9
+ "test:flaky": "cypress run --config-file cypress-flaky.config.js",
8
10
  "test:partial": "cypress run --spec \"integration/repository/**\""
9
11
  },
10
12
  "author": {
@@ -21,7 +23,7 @@
21
23
  "url": "git+https://github.com/Ontotext-AD/graphdb-workbench.git"
22
24
  },
23
25
  "dependencies": {
24
- "cypress": "^7.3.0",
26
+ "cypress": "^12.5.1",
25
27
  "cypress-failed-log": "^2.5.1",
26
28
  "cypress-localstorage-commands": "^1.4.4",
27
29
  "cypress-terminal-report": "^4.0.1",
package/cypress.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "projectId": "v35btb",
3
- "baseUrl": "http://localhost:9000",
4
- "fixturesFolder": "fixtures",
5
- "integrationFolder": "integration",
6
- "pluginsFile": "plugins/index.js",
7
- "screenshotsFolder": "report/screenshots",
8
- "supportFile": "support/index.js",
9
- "videosFolder": "report/videos",
10
- "video": false,
11
- "defaultCommandTimeout": 30000,
12
- "numTestsKeptInMemory": 10
13
- }