graphdb-workbench-tests 2.2.1-TR2 → 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.
- package/bin/graphdb-workbench-cypress +1 -1
- package/cypress-flaky.config.js +21 -0
- package/cypress.config.js +21 -0
- package/fixtures/locale-en.json +1 -0
- package/integration/explore/visual.graph.spec.js +0 -73
- package/integration/help/rest-api.spec.js +1 -1
- package/integration/monitor/monitor.resources.spec.js +89 -15
- package/integration/repository/repositories.spec.js +13 -12
- package/integration/setup/user-and-access.spec.js +1 -1
- package/integration/sparql/sparql-language-change.spec.js +2 -28
- package/integration/sparql/sparql.menu.spec.js +24 -46
- package/integration-flaky/explore/visual.graph.spec.js +118 -0
- package/integration-flaky/sparql/sparql-language-change.spec.js +45 -0
- package/integration-flaky/sparql/sparql.menu.spec.js +75 -0
- package/package.json +4 -2
- package/cypress.json +0 -13
|
@@ -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
|
+
});
|
package/fixtures/locale-en.json
CHANGED
|
@@ -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
|
}
|
|
@@ -14,11 +14,10 @@ describe('Monitor Resources', () => {
|
|
|
14
14
|
cy.window();
|
|
15
15
|
|
|
16
16
|
// Wait for loaders to disappear
|
|
17
|
-
|
|
18
|
-
cy.get('.ot-loader').should('not.be.visible');
|
|
17
|
+
getTabsPanel().should('be.visible');
|
|
19
18
|
|
|
20
19
|
// Ensure the chart on the default active tab is rendered
|
|
21
|
-
getActiveTabContent().
|
|
20
|
+
getActiveTabContent().should('be.visible');
|
|
22
21
|
});
|
|
23
22
|
|
|
24
23
|
after(() => {
|
|
@@ -29,33 +28,108 @@ describe('Monitor Resources', () => {
|
|
|
29
28
|
return cy.get('.graphics');
|
|
30
29
|
}
|
|
31
30
|
|
|
31
|
+
function getTabButtons() {
|
|
32
|
+
return getTabsPanel().find('.nav-item');
|
|
33
|
+
}
|
|
34
|
+
|
|
32
35
|
function getActiveTab() {
|
|
33
|
-
return
|
|
36
|
+
return getTabButtons().find('.nav-link.active');
|
|
34
37
|
}
|
|
35
38
|
|
|
36
39
|
function getTabContent() {
|
|
37
|
-
return cy.get('.
|
|
40
|
+
return cy.get('.tabs');
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
function getActiveTabContent() {
|
|
41
|
-
return getTabContent().find('.tab-pane
|
|
44
|
+
return getTabContent().find('.tab-pane');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function getChart(id) {
|
|
48
|
+
return getTabContent().find(`#${id}`);
|
|
42
49
|
}
|
|
43
50
|
|
|
44
|
-
function
|
|
45
|
-
return
|
|
51
|
+
function getErrorsPane() {
|
|
52
|
+
return cy.get('.errors');
|
|
46
53
|
}
|
|
47
54
|
|
|
48
|
-
|
|
55
|
+
function getErrors() {
|
|
56
|
+
return getErrorsPane().find('.error');
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function getError(index) {
|
|
60
|
+
return getErrors().eq(index);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function verifyCharts(charts) {
|
|
64
|
+
charts.forEach((chart) => {
|
|
65
|
+
getChart(chart.id).scrollIntoView().find('.title').should('contain', chart.label);
|
|
66
|
+
getChart(chart.id).scrollIntoView().find(`.${chart.type}`).should('be.visible');
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
it('Should display monitor tabs ', () => {
|
|
71
|
+
const tabs = ['Resource monitoring', 'Performance', 'Cluster health'];
|
|
72
|
+
|
|
49
73
|
// Graphics container should be present
|
|
50
74
|
getTabsPanel().should('be.visible');
|
|
51
75
|
// All tabs should be visible
|
|
52
|
-
|
|
53
|
-
getTabsPanel().find('.nav-item').should('have.length', 4).each(($tab, index) => {
|
|
76
|
+
getTabButtons().should('have.length', tabs.length).each(($tab, index) => {
|
|
54
77
|
cy.wrap($tab).should('be.visible').contains(tabs[index]);
|
|
55
78
|
});
|
|
56
|
-
//
|
|
57
|
-
getActiveTab().
|
|
58
|
-
|
|
59
|
-
|
|
79
|
+
// Default tap should be Resource monitoring
|
|
80
|
+
getActiveTab().should('contain', 'Resource monitoring');
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('Resource monitoring tab should show cpu, file, storage and memory charts', () => {
|
|
84
|
+
const charts = [{
|
|
85
|
+
id: 'CPUUsageGraphic',
|
|
86
|
+
label: 'System CPU load',
|
|
87
|
+
type: 'nv-lineChart'
|
|
88
|
+
}, {
|
|
89
|
+
id: 'openFileDescriptors',
|
|
90
|
+
label: 'File descriptors',
|
|
91
|
+
type: 'nv-lineChart'
|
|
92
|
+
}, {
|
|
93
|
+
id: 'heapMemoryGraphic',
|
|
94
|
+
label: 'Heap memory usage',
|
|
95
|
+
type: 'nv-lineChart'
|
|
96
|
+
}, {
|
|
97
|
+
id: 'offHeapMemoryGraphic',
|
|
98
|
+
label: 'Off-heap memory usage',
|
|
99
|
+
type: 'nv-lineChart'
|
|
100
|
+
}, {
|
|
101
|
+
id: 'diskStorage',
|
|
102
|
+
label: 'Disk storage',
|
|
103
|
+
type: 'nv-multiBarHorizontalChart'
|
|
104
|
+
}];
|
|
105
|
+
verifyCharts(charts);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it('Performance monitoring tab should show charts', () => {
|
|
109
|
+
getTabButtons().eq(1).click();
|
|
110
|
+
const charts = [{
|
|
111
|
+
id: 'activeQueries',
|
|
112
|
+
label: 'Queries',
|
|
113
|
+
type: 'nv-lineChart'
|
|
114
|
+
}, {
|
|
115
|
+
id: 'globalCache',
|
|
116
|
+
label: 'Global cache',
|
|
117
|
+
type: 'nv-lineChart'
|
|
118
|
+
}, {
|
|
119
|
+
id: 'epool',
|
|
120
|
+
label: 'Entity pool',
|
|
121
|
+
type: 'multiChart'
|
|
122
|
+
}, {
|
|
123
|
+
id: 'connections',
|
|
124
|
+
label: 'Transactions and Connections',
|
|
125
|
+
type: 'nv-lineChart'
|
|
126
|
+
}];
|
|
127
|
+
verifyCharts(charts);
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it('Should show info and no error for non existing cluster', () => {
|
|
131
|
+
getErrorsPane().should('not.be.visible');
|
|
132
|
+
getTabButtons().eq(2).click();
|
|
133
|
+
cy.get('.alert-info').should('be.visible').and('contain', 'Charts are not available because GraphDB is not in cluster configuration');
|
|
60
134
|
});
|
|
61
135
|
});
|
|
@@ -41,7 +41,8 @@ describe('Repositories', () => {
|
|
|
41
41
|
|
|
42
42
|
beforeEach(() => {
|
|
43
43
|
repositoryId = 'repo-' + Date.now();
|
|
44
|
-
cy.intercept('/rest/locations').as('getLocations');
|
|
44
|
+
cy.intercept('/rest/locations?filterClusterLocations=true').as('getLocations');
|
|
45
|
+
cy.intercept('/rest/repositories/all').as('getRepositories');
|
|
45
46
|
|
|
46
47
|
cy.visit('/repository');
|
|
47
48
|
waitLoader();
|
|
@@ -89,7 +90,7 @@ describe('Repositories', () => {
|
|
|
89
90
|
cy.url().should('include', '/repository/create/');
|
|
90
91
|
|
|
91
92
|
// Create a repository by supplying only an identifier
|
|
92
|
-
getRepositoryCreateForm()
|
|
93
|
+
getRepositoryCreateForm();
|
|
93
94
|
getRepositoryIdField()
|
|
94
95
|
.should('have.value', '')
|
|
95
96
|
.type(repositoryId)
|
|
@@ -160,7 +161,7 @@ describe('Repositories', () => {
|
|
|
160
161
|
|
|
161
162
|
saveRepository();
|
|
162
163
|
|
|
163
|
-
getRepositoryCreateForm()
|
|
164
|
+
getRepositoryCreateForm();
|
|
164
165
|
getRepositoryIdField().should('have.attr', 'placeholder', 'This field is required');
|
|
165
166
|
|
|
166
167
|
getToast()
|
|
@@ -208,7 +209,7 @@ describe('Repositories', () => {
|
|
|
208
209
|
|
|
209
210
|
cy.url().should('include', '/repository/edit/' + repositoryId);
|
|
210
211
|
|
|
211
|
-
getRepositoryCreateForm()
|
|
212
|
+
getRepositoryCreateForm();
|
|
212
213
|
getRepositoryIdField().should('have.value', repositoryId);
|
|
213
214
|
getRepositoryTitleField().should('have.value', repoTitle);
|
|
214
215
|
// OWL-Horst (Optimized) has become 4
|
|
@@ -228,7 +229,6 @@ describe('Repositories', () => {
|
|
|
228
229
|
|
|
229
230
|
typeRepositoryId(repositoryId);
|
|
230
231
|
saveRepository();
|
|
231
|
-
cy.wait('@getLocations');
|
|
232
232
|
|
|
233
233
|
createRepository();
|
|
234
234
|
chooseRepositoryType(GDB_REPOSITORY_TYPE);
|
|
@@ -236,6 +236,11 @@ describe('Repositories', () => {
|
|
|
236
236
|
|
|
237
237
|
typeRepositoryId(secondRepoId);
|
|
238
238
|
saveRepository();
|
|
239
|
+
cy.wait('@getRepositories');
|
|
240
|
+
|
|
241
|
+
// Wait for redirection to previous '/repository'
|
|
242
|
+
cy.waitUntil(() =>
|
|
243
|
+
cy.url().then(url => url === (Cypress.config('baseUrl') + '/repository')));
|
|
239
244
|
|
|
240
245
|
// Connect to the first repo via the connection icon
|
|
241
246
|
// Note: Not using within() because the whole row will be re-rendered & detached
|
|
@@ -304,7 +309,6 @@ describe('Repositories', () => {
|
|
|
304
309
|
typeRepositoryId(repositoryId);
|
|
305
310
|
typeRepositoryTitle('Title');
|
|
306
311
|
saveRepository();
|
|
307
|
-
cy.wait('@getLocations');
|
|
308
312
|
editRepository(repositoryId);
|
|
309
313
|
|
|
310
314
|
// Some fields should be disabled
|
|
@@ -344,7 +348,6 @@ describe('Repositories', () => {
|
|
|
344
348
|
|
|
345
349
|
typeRepositoryId(repositoryId);
|
|
346
350
|
saveRepository();
|
|
347
|
-
cy.wait('@getLocations');
|
|
348
351
|
selectRepoFromDropdown(repositoryId);
|
|
349
352
|
|
|
350
353
|
getRepositoryFromList(repositoryId)
|
|
@@ -356,8 +359,6 @@ describe('Repositories', () => {
|
|
|
356
359
|
|
|
357
360
|
confirmModal();
|
|
358
361
|
|
|
359
|
-
getRepositoriesList().should('not.exist');
|
|
360
|
-
|
|
361
362
|
// Check the repo has been deselected and is not present in the repo dropdown menu
|
|
362
363
|
getRepositoriesDropdown().click().within(() => {
|
|
363
364
|
cy.get('#btnReposGroup').should('not.contain', repositoryId);
|
|
@@ -519,7 +520,7 @@ describe('Repositories', () => {
|
|
|
519
520
|
cy.url().should('include', '/repository/create/ontop');
|
|
520
521
|
|
|
521
522
|
// Create a repository by supplying only an identifier
|
|
522
|
-
getRepositoryCreateForm()
|
|
523
|
+
getRepositoryCreateForm();
|
|
523
524
|
getRepositoryIdField()
|
|
524
525
|
.should('have.value', '')
|
|
525
526
|
.type(repositoryId)
|
|
@@ -629,7 +630,7 @@ describe('Repositories', () => {
|
|
|
629
630
|
cy.url().should('include', '/repository/create');
|
|
630
631
|
|
|
631
632
|
// Create a repository by supplying only an identifier
|
|
632
|
-
getRepositoryCreateForm()
|
|
633
|
+
getRepositoryCreateForm();
|
|
633
634
|
getRepositoryIdField()
|
|
634
635
|
.should('have.value', '')
|
|
635
636
|
.type(repositoryId)
|
|
@@ -807,7 +808,7 @@ describe('Repositories', () => {
|
|
|
807
808
|
}
|
|
808
809
|
|
|
809
810
|
function getRepositoryCreateForm() {
|
|
810
|
-
return cy.get('#newRepoForm');
|
|
811
|
+
return cy.get('#newRepoForm').should('be.visible');
|
|
811
812
|
}
|
|
812
813
|
|
|
813
814
|
function getRepositoryIdField() {
|
|
@@ -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
|
-
|
|
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(() =>
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
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(() =>
|
|
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(() =>
|
|
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
|
|
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": "^
|
|
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
|
-
}
|