graphdb-workbench-tests 2.8.0-Test → 2.8.0
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 +3 -0
- package/fixtures/cluster/2-nodes-cluster-group-status-deleted.json +30 -0
- package/fixtures/cluster/2-nodes-cluster-group-status.json +30 -0
- package/fixtures/cluster/3-nodes-cluster-group-status-after-replace.json +44 -0
- package/fixtures/cluster/3-nodes-cluster-group-status-building-snapshot.json +4 -1
- package/fixtures/cluster/3-nodes-cluster-group-status-receiving-snapshot.json +4 -1
- package/fixtures/cluster/3-nodes-cluster-group-status-sending-snapshot.json +4 -1
- package/fixtures/cluster/3-nodes-cluster-group-status-waiting-for-snapshot.json +4 -1
- package/fixtures/cluster/3-nodes-cluster-group-status-with-tag.json +47 -0
- package/fixtures/cluster/3-nodes-cluster-group-status.json +12 -3
- package/fixtures/cluster/4-nodes-cluster-group-status.json +58 -0
- package/fixtures/cluster/cluster-config.json +1 -0
- package/fixtures/cluster/cluster-node-status.json +4 -1
- package/fixtures/cluster/no-cluster-group-status.json +2 -1
- package/fixtures/cluster/no-cluster-node-status.json +2 -1
- package/fixtures/cluster/save-cluster-configuration-response.json +10 -0
- package/fixtures/connectors/get-retrieval-connector.json +1 -1
- package/fixtures/connectors/get-ttyg-chatgpt-connectors.json +188 -0
- package/fixtures/locale-en.json +382 -101
- package/fixtures/remote-location/get-0-remote-locations.json +1 -2
- package/fixtures/remote-location/get-1-remote-locations.json +2 -4
- package/fixtures/remote-location/get-2-remote-locations.json +3 -6
- package/fixtures/remote-location/get-3-remote-locations.json +4 -8
- package/fixtures/remote-location/get-4-remote-locations.json +54 -0
- package/fixtures/remote-location/remote-location-status-in-cluster.json +1 -2
- package/fixtures/remote-location/remote-location-status-not-in-cluster.json +1 -2
- package/fixtures/remote-location/remote-locations-filter.json +1 -2
- package/fixtures/repositories/get-locations.json +5 -10
- package/fixtures/repositories/get-ttyg-repositories.json +28 -0
- package/fixtures/security/get-admin-user.json +22 -0
- package/fixtures/similarity/get-ttyg-similarity-connectors.json +46 -0
- package/fixtures/ttyg/agent/create-agent.json +2 -1
- package/fixtures/ttyg/agent/get-agent-defaults.json +42 -0
- package/fixtures/ttyg/agent/get-agent-list-after-deleted.json +1 -1
- package/fixtures/ttyg/agent/get-agent-list-new-agent.json +2 -73
- package/fixtures/ttyg/agent/get-agent-list.json +1 -1
- package/fixtures/ttyg/agent/get-agent.json +25 -0
- package/fixtures/ttyg/chats/ask-question.json +25 -0
- package/fixtures/ttyg/chats/create/create-chat-response.json +16 -0
- package/fixtures/ttyg/chats/create/get-chats-after-create.json +12 -0
- package/fixtures/ttyg/chats/create/get-chats-before-create.json +7 -0
- package/fixtures/ttyg/chats/explain-response-1.json +59 -0
- package/fixtures/ttyg/chats/explain-response-2.json +59 -0
- package/fixtures/ttyg/chats/get-chat.json +199 -0
- package/integration/cluster/cluster-configuration/cluster-configuration-multi-region.spec.js +97 -0
- package/integration/cluster/cluster-configuration/cluster-configuration-nodes.spec.js +70 -0
- package/integration/cluster/cluster-configuration/cluster-configuration-properties.spec.js +95 -0
- package/integration/cluster/cluster-configuration/cluster-configuration.spec.js +38 -0
- package/integration/cluster/cluster-legend.spec.js +1 -0
- package/integration/cluster/edit-cluster-nodes-modal.spec.js +425 -0
- package/integration/explore/graphs.overview.spec.js +4 -0
- package/integration/explore/similariti-index-create.spec.js +1 -1
- package/integration/explore/similarity-index.spec.js +1 -1
- package/integration/explore/visual-graph/visual.graph.spec.js +31 -35
- package/integration/home/cookie-policy.spec.js +83 -0
- package/integration/home/create-repository.spec.js +35 -0
- package/integration/home/documentation-link.spec.js +60 -0
- package/integration/home/google-analytics.spec.js +60 -0
- package/integration/home/language-selector.spec.js +19 -0
- package/integration/home/rdf-resource-search.spec.js +192 -0
- package/integration/home/view-resource-autocomplete.spec.js +52 -0
- package/integration/home/workbench.home.spec.js +1 -277
- package/integration/import/import-user-data-file-upload.spec.js +13 -0
- package/integration/import/import-user-data.spec.js +6 -1
- package/integration/import/import-view.spec.js +6 -1
- package/integration/license/license.spec.js +26 -0
- package/integration/repository/attach-remote-location.spec.js +94 -40
- package/integration/repository/repositories.spec.js +1 -7
- package/integration/setup/my-settings.spec.js +13 -21
- package/integration/ttyg/agent-list.spec.js +27 -25
- package/integration/ttyg/agent-select-menu.spec.js +18 -16
- package/integration/ttyg/chat-list.spec.js +72 -9
- package/integration/ttyg/chat-panel.spec.js +106 -10
- package/integration/ttyg/clone-agent.spec.js +8 -4
- package/integration/ttyg/create-agent.spec.js +303 -51
- package/integration/ttyg/create-chat.spec.js +68 -0
- package/integration/ttyg/delete-agent.spec.js +6 -5
- package/integration/ttyg/edit-agent.spec.js +16 -5
- package/integration/ttyg/ttyg-permission.spec.js +66 -0
- package/integration/ttyg/ttyg-view.spec.js +8 -4
- package/npm-shrinkwrap.json +215 -220
- package/package.json +5 -6
- package/steps/alert-dialog-steps.js +25 -0
- package/steps/cluster/cluster-configuration-steps.js +173 -5
- package/steps/cluster/cluster-page-steps.js +8 -0
- package/steps/cluster/custer-nodes-configuration-steps.js +107 -0
- package/steps/home-steps.js +48 -5
- package/steps/import/import-steps.js +11 -7
- package/steps/license-steps.js +25 -0
- package/steps/repositories/attach-repository-steps.js +33 -0
- package/steps/repository-steps.js +26 -11
- package/steps/setup/settings-steps.js +17 -0
- package/steps/ttyg/chat-panel-steps.js +31 -6
- package/steps/ttyg/ttyg-agent-settings-modal.steps.js +82 -4
- package/steps/ttyg/ttyg-view-steps.js +77 -3
- package/steps/visual-graph-steps.js +29 -1
- package/stubs/cluster/cluster-stubs.js +162 -7
- package/stubs/cluster/remote-location-stubs.js +46 -0
- package/stubs/connector-stubs.js +24 -0
- package/stubs/environment-stubs.js +27 -0
- package/stubs/license-stubs.js +108 -0
- package/stubs/repositories/repositories-stubs.js +11 -8
- package/stubs/repositories-stub.js +15 -0
- package/stubs/security-stubs.js +29 -0
- package/stubs/similarity-index-stubs.js +25 -0
- package/stubs/stubs.js +4 -0
- package/stubs/ttyg/ttyg-stubs.js +79 -40
- package/support/commands.js +2 -0
- package/support/index.js +18 -0
- package/support/security-command.js +25 -0
- package/support/settings-commands.js +4 -5
- package/support/user-commands.js +31 -0
- package/fixtures/ttyg/chats/get-chat-1.json +0 -43
- package/integration/cluster/cluster-management.spec.js +0 -220
- package/steps/cluster/add-remote-location-dialog-steps.js +0 -11
- package/steps/cluster/create-cluster-dialog-steps.js +0 -39
- package/steps/cluster/replace-nodes-dialog-steps.js +0 -39
|
@@ -1,30 +1,26 @@
|
|
|
1
1
|
import {VisualGraphSteps} from "../../../steps/visual-graph-steps";
|
|
2
|
+
import {ApplicationSteps} from "../../../steps/application-steps";
|
|
2
3
|
|
|
3
4
|
const FILE_TO_IMPORT = 'wine.rdf';
|
|
4
|
-
const
|
|
5
|
+
const VALID_RESOURCE = 'USRegion';
|
|
5
6
|
|
|
6
7
|
describe('Visual graph screen validation', () => {
|
|
7
8
|
|
|
8
|
-
let repositoryId
|
|
9
|
-
const VALID_RESOURCE = 'USRegion';
|
|
9
|
+
let repositoryId;
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
beforeEach(() => {
|
|
12
12
|
cy.clearLocalStorage('ls.graphs-viz');
|
|
13
|
-
repositoryId = '
|
|
13
|
+
repositoryId = 'graphRepo-' + Date.now();
|
|
14
14
|
cy.createRepository({id: repositoryId});
|
|
15
|
+
cy.presetRepository(repositoryId);
|
|
15
16
|
cy.importServerFile(repositoryId, FILE_TO_IMPORT);
|
|
16
17
|
});
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
afterEach(() => {
|
|
19
20
|
cy.clearLocalStorage('ls.graphs-viz');
|
|
20
|
-
cy.setDefaultUserData();
|
|
21
21
|
cy.deleteRepository(repositoryId);
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
beforeEach(() => {
|
|
25
|
-
cy.presetRepository(repositoryId);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
24
|
context('When autocomplete is disabled', () => {
|
|
29
25
|
it('Test notification when autocomplete is disabled', () => {
|
|
30
26
|
cy.visit('graphs-visualizations');
|
|
@@ -40,30 +36,30 @@ describe('Visual graph screen validation', () => {
|
|
|
40
36
|
});
|
|
41
37
|
|
|
42
38
|
context('When autocomplete is enabled', () => {
|
|
43
|
-
before(() => {
|
|
44
|
-
cy.enableAutocomplete(repositoryId);
|
|
45
|
-
});
|
|
46
39
|
beforeEach(() => {
|
|
47
|
-
cy.
|
|
40
|
+
cy.enableAutocomplete(repositoryId);
|
|
41
|
+
//http://localhost:9000/graphs-visualizations?uri=http:%2F%2Fwww.w3.org%2FTR%2F2003%2FPR-owl-guide-20031209%2Fwine%23USRegion
|
|
48
42
|
cy.window();
|
|
49
43
|
});
|
|
50
44
|
|
|
51
45
|
it('Test search for an invalid resource', () => {
|
|
46
|
+
VisualGraphSteps.visit();
|
|
52
47
|
VisualGraphSteps.getSearchField().should('be.visible').type('.invalid_resource');
|
|
53
48
|
// There are two buttons rendered in the DOM where one of them is hidden. We need the visible one.
|
|
54
49
|
cy.get('.autocomplete-visual-btn:visible').click();
|
|
55
50
|
// Verify that an "Invalid IRI" message is displayed
|
|
56
|
-
|
|
51
|
+
ApplicationSteps.getErrorNotifications().should('be.visible').and('contain', 'Invalid IRI');
|
|
57
52
|
});
|
|
58
53
|
|
|
59
54
|
it('Test search for a valid resource', () => {
|
|
60
|
-
VisualGraphSteps.
|
|
55
|
+
VisualGraphSteps.visit();
|
|
56
|
+
VisualGraphSteps.searchForResourceAndOpen(VALID_RESOURCE, VALID_RESOURCE);
|
|
61
57
|
// Verify redirection to existing visual graph
|
|
62
58
|
cy.url().should('match', /USRegion$/);
|
|
63
59
|
});
|
|
64
60
|
|
|
65
61
|
it('Test default graph state', () => {
|
|
66
|
-
VisualGraphSteps.
|
|
62
|
+
VisualGraphSteps.openUSRegionUri();
|
|
67
63
|
VisualGraphSteps.openVisualGraphSettings();
|
|
68
64
|
|
|
69
65
|
cy.get('.filter-sidepanel').as('sidepanel').should('be.visible').within(() => {
|
|
@@ -105,7 +101,7 @@ describe('Visual graph screen validation', () => {
|
|
|
105
101
|
});
|
|
106
102
|
|
|
107
103
|
it('Test invalid links limit should show error to user ', () => {
|
|
108
|
-
VisualGraphSteps.
|
|
104
|
+
VisualGraphSteps.openUSRegionUri();
|
|
109
105
|
VisualGraphSteps.openVisualGraphSettings();
|
|
110
106
|
|
|
111
107
|
cy.get('.filter-sidepanel').as('sidepanel').should('be.visible').within(() => {
|
|
@@ -135,13 +131,13 @@ describe('Visual graph screen validation', () => {
|
|
|
135
131
|
});
|
|
136
132
|
|
|
137
133
|
it('Test search for a valid resource with links', () => {
|
|
138
|
-
VisualGraphSteps.
|
|
134
|
+
VisualGraphSteps.openUSRegionUri();
|
|
139
135
|
// Check include inferred
|
|
140
136
|
VisualGraphSteps.toggleInferredStatements(true);
|
|
141
137
|
// Navigate to Visual graph menu
|
|
142
138
|
VisualGraphSteps.openVisualGraphHome();
|
|
143
139
|
// Search for "USRegion" again
|
|
144
|
-
VisualGraphSteps.
|
|
140
|
+
VisualGraphSteps.searchForResourceAndOpen(VALID_RESOURCE, VALID_RESOURCE);
|
|
145
141
|
// Verify that 20 links (nodes) are displayed
|
|
146
142
|
VisualGraphSteps.getPredicates().should('have.length', 20);
|
|
147
143
|
// Verify that links are counted by nodes and not by triples (predicates)
|
|
@@ -149,7 +145,7 @@ describe('Visual graph screen validation', () => {
|
|
|
149
145
|
});
|
|
150
146
|
|
|
151
147
|
it('Test collapse and expand a node', () => {
|
|
152
|
-
VisualGraphSteps.
|
|
148
|
+
VisualGraphSteps.openUSRegionUri();
|
|
153
149
|
VisualGraphSteps.toggleInferredStatements(false);
|
|
154
150
|
|
|
155
151
|
// Hover over node with the mouse and collapse it through the menu
|
|
@@ -172,7 +168,7 @@ describe('Visual graph screen validation', () => {
|
|
|
172
168
|
});
|
|
173
169
|
|
|
174
170
|
it('Test expand and collapse node info panel with single click', () => {
|
|
175
|
-
VisualGraphSteps.
|
|
171
|
+
VisualGraphSteps.openUSRegionUri();
|
|
176
172
|
|
|
177
173
|
// Click once on the node with the mouse to open node's info panel
|
|
178
174
|
VisualGraphSteps.getTargetNode().click();
|
|
@@ -188,7 +184,7 @@ describe('Visual graph screen validation', () => {
|
|
|
188
184
|
});
|
|
189
185
|
|
|
190
186
|
it('Test remove child node', () => {
|
|
191
|
-
VisualGraphSteps.
|
|
187
|
+
VisualGraphSteps.openUSRegionUri();
|
|
192
188
|
VisualGraphSteps.toggleInferredStatements(false);
|
|
193
189
|
// Verify that before given node is removed there are 4 of them
|
|
194
190
|
VisualGraphSteps.getNodes().and('have.length', 4);
|
|
@@ -207,7 +203,7 @@ describe('Visual graph screen validation', () => {
|
|
|
207
203
|
});
|
|
208
204
|
|
|
209
205
|
it('Test remove parent node', () => {
|
|
210
|
-
VisualGraphSteps.
|
|
206
|
+
VisualGraphSteps.openUSRegionUri();
|
|
211
207
|
|
|
212
208
|
// Verify that search bar isn't visible
|
|
213
209
|
VisualGraphSteps.getSearchField().should('not.exist');
|
|
@@ -221,7 +217,7 @@ describe('Visual graph screen validation', () => {
|
|
|
221
217
|
});
|
|
222
218
|
|
|
223
219
|
it('Test expand collapsed node which has connections with double click', () => {
|
|
224
|
-
VisualGraphSteps.
|
|
220
|
+
VisualGraphSteps.openUSRegionUri();
|
|
225
221
|
VisualGraphSteps.toggleInferredStatements(false);
|
|
226
222
|
|
|
227
223
|
VisualGraphSteps.getTargetNode().trigger('mouseover');
|
|
@@ -273,7 +269,7 @@ describe('Visual graph screen validation', () => {
|
|
|
273
269
|
'Right arrow\n \n ' +
|
|
274
270
|
'Rotate the graph to the right\n';
|
|
275
271
|
|
|
276
|
-
VisualGraphSteps.
|
|
272
|
+
VisualGraphSteps.openUSRegionUri();
|
|
277
273
|
// Click on "mouse and keyboard actions" in the lower right corner of the screen
|
|
278
274
|
cy.get('#keyboardShortcuts').click();
|
|
279
275
|
// Verify all mouse and actions
|
|
@@ -289,7 +285,7 @@ describe('Visual graph screen validation', () => {
|
|
|
289
285
|
});
|
|
290
286
|
|
|
291
287
|
it('Test maximum links to show', () => {
|
|
292
|
-
VisualGraphSteps.
|
|
288
|
+
VisualGraphSteps.openUSRegionUri();
|
|
293
289
|
|
|
294
290
|
// Verify that 20 links (nodes) are displayed
|
|
295
291
|
VisualGraphSteps.getPredicates().should('have.length', 20);
|
|
@@ -310,7 +306,7 @@ describe('Visual graph screen validation', () => {
|
|
|
310
306
|
});
|
|
311
307
|
|
|
312
308
|
it('Test include inferred Statements', () => {
|
|
313
|
-
VisualGraphSteps.
|
|
309
|
+
VisualGraphSteps.openUSRegionUri();
|
|
314
310
|
// Check include inferred
|
|
315
311
|
VisualGraphSteps.toggleInferredStatements(true);
|
|
316
312
|
|
|
@@ -334,7 +330,7 @@ describe('Visual graph screen validation', () => {
|
|
|
334
330
|
});
|
|
335
331
|
|
|
336
332
|
it('Test preferred types', () => {
|
|
337
|
-
|
|
333
|
+
VisualGraphSteps.openDryWineUri();
|
|
338
334
|
|
|
339
335
|
VisualGraphSteps.openVisualGraphSettings();
|
|
340
336
|
// Set "vin:Chardonnay" as a preferred type
|
|
@@ -354,7 +350,7 @@ describe('Visual graph screen validation', () => {
|
|
|
354
350
|
});
|
|
355
351
|
|
|
356
352
|
it('Test ignored types', () => {
|
|
357
|
-
|
|
353
|
+
VisualGraphSteps.openDryWineUri();
|
|
358
354
|
|
|
359
355
|
// Pick a type that is displayed in the diagram for example "vin:Zinfandel"
|
|
360
356
|
VisualGraphSteps.getNodes().and('contain', 'Zinfandel');
|
|
@@ -371,7 +367,7 @@ describe('Visual graph screen validation', () => {
|
|
|
371
367
|
});
|
|
372
368
|
|
|
373
369
|
it('Test preferred predicates', () => {
|
|
374
|
-
|
|
370
|
+
VisualGraphSteps.openDryWineUri();
|
|
375
371
|
|
|
376
372
|
VisualGraphSteps.openVisualGraphSettings();
|
|
377
373
|
// Go to predicates tab
|
|
@@ -387,7 +383,7 @@ describe('Visual graph screen validation', () => {
|
|
|
387
383
|
});
|
|
388
384
|
|
|
389
385
|
it('Test ignored predicates', () => {
|
|
390
|
-
|
|
386
|
+
VisualGraphSteps.openDryWineUri();
|
|
391
387
|
VisualGraphSteps.toggleInferredStatements(false);
|
|
392
388
|
|
|
393
389
|
// Pick a type that is displayed in the diagram for example "vin:Zinfandel"
|
|
@@ -409,7 +405,7 @@ describe('Visual graph screen validation', () => {
|
|
|
409
405
|
});
|
|
410
406
|
|
|
411
407
|
it('Test reset settings', () => {
|
|
412
|
-
|
|
408
|
+
VisualGraphSteps.openDryWineUri();
|
|
413
409
|
|
|
414
410
|
// Modify the settings first
|
|
415
411
|
VisualGraphSteps.openVisualGraphSettings();
|
|
@@ -487,7 +483,7 @@ describe('Visual graph screen validation', () => {
|
|
|
487
483
|
});
|
|
488
484
|
|
|
489
485
|
it('Test include schema statements', () => {
|
|
490
|
-
|
|
486
|
+
VisualGraphSteps.openDryWineUri();
|
|
491
487
|
VisualGraphSteps.getPredicates().should('contain', 'type');
|
|
492
488
|
VisualGraphSteps.openVisualGraphSettings();
|
|
493
489
|
VisualGraphSteps.getSettingsPanel().should('be.visible');
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import HomeSteps from '../../steps/home-steps';
|
|
2
|
+
import {EnvironmentStubs} from "../../stubs/environment-stubs";
|
|
3
|
+
import {SecurityStubs} from "../../stubs/security-stubs";
|
|
4
|
+
import {SettingsSteps} from "../../steps/setup/settings-steps";
|
|
5
|
+
|
|
6
|
+
Cypress.env('set_default_user_data', false);
|
|
7
|
+
|
|
8
|
+
describe('Cookie policy', () => {
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
cy.setDefaultUserData(false);
|
|
11
|
+
cy.viewport(1280, 1000);
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
afterEach(() => cy.setDefaultUserData());
|
|
15
|
+
|
|
16
|
+
it('Should show consent popup to user', () => {
|
|
17
|
+
HomeSteps.visit();
|
|
18
|
+
EnvironmentStubs.stubWbProdMode();
|
|
19
|
+
HomeSteps.getCookieConsentPopup().should('exist').and('be.visible');
|
|
20
|
+
// When I click on the link
|
|
21
|
+
HomeSteps.clickCookiePolicyLink();
|
|
22
|
+
// Then I see the cookie policy
|
|
23
|
+
HomeSteps.getCookiePolicyModal().should('exist').and('be.visible');
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('Should show cookie policy to user in user settings', () => {
|
|
27
|
+
SettingsSteps.visit();
|
|
28
|
+
EnvironmentStubs.stubWbProdMode();
|
|
29
|
+
SettingsSteps.getCookiePolicyButton().should('exist').and('be.visible');
|
|
30
|
+
|
|
31
|
+
// When I click on the link
|
|
32
|
+
SettingsSteps.clickCookiePolicyLink();
|
|
33
|
+
// Then I see the cookie policy
|
|
34
|
+
SettingsSteps.getCookiePolicyModal().should('exist').and('be.visible');
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('Should NOT show consent popup to user when tracking is not applicable', () => {
|
|
38
|
+
HomeSteps.visit();
|
|
39
|
+
HomeSteps.getCookieConsentPopup().should('not.exist');
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('Should NOT show cookie policy to user when tracking is not applicable', () => {
|
|
43
|
+
SettingsSteps.visit();
|
|
44
|
+
SettingsSteps.getCookiePolicyButton().should('not.exist');
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('Should save consent in user settings', () => {
|
|
48
|
+
HomeSteps.visit();
|
|
49
|
+
EnvironmentStubs.stubWbProdMode();
|
|
50
|
+
SecurityStubs.stubUpdateUserData('admin');
|
|
51
|
+
|
|
52
|
+
// When I click Agree button
|
|
53
|
+
HomeSteps.clickAgreeButton();
|
|
54
|
+
|
|
55
|
+
// I expect to save cookie consent in user settings
|
|
56
|
+
cy.wait('@updateUser').then((xhr) => {
|
|
57
|
+
expect(xhr.request.body.appSettings).to.include({
|
|
58
|
+
DEFAULT_INFERENCE: true,
|
|
59
|
+
DEFAULT_VIS_GRAPH_SCHEMA: true,
|
|
60
|
+
DEFAULT_SAMEAS: true,
|
|
61
|
+
IGNORE_SHARED_QUERIES: false,
|
|
62
|
+
EXECUTE_COUNT: true
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// Assert COOKIE_CONSENT properties, excluding updatedAt
|
|
66
|
+
expect(xhr.request.body.appSettings.COOKIE_CONSENT).to.include({
|
|
67
|
+
policyAccepted: true,
|
|
68
|
+
statistic: true,
|
|
69
|
+
thirdParty: true
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// Assert that updatedAt is present, is a number, and is a reasonable timestamp
|
|
73
|
+
const updatedAt = xhr.request.body.appSettings.COOKIE_CONSENT.updatedAt;
|
|
74
|
+
expect(updatedAt).to.exist;
|
|
75
|
+
expect(updatedAt).to.be.a('number');
|
|
76
|
+
|
|
77
|
+
// Check that updatedAt is within 1 hour of the current time
|
|
78
|
+
const oneHourInMilliseconds = 60 * 60 * 1000;
|
|
79
|
+
const now = Date.now();
|
|
80
|
+
expect(updatedAt).to.be.within(now - oneHourInMilliseconds, now + oneHourInMilliseconds);
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import HomeSteps from '../../steps/home-steps';
|
|
2
|
+
|
|
3
|
+
describe('Create repository', () => {
|
|
4
|
+
|
|
5
|
+
beforeEach(() => {
|
|
6
|
+
cy.viewport(1280, 1000);
|
|
7
|
+
HomeSteps.visitAndWaitLoader();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('Test create and select new repository via home page', () => {
|
|
11
|
+
HomeSteps.verifyCreateRepositoryLink();
|
|
12
|
+
|
|
13
|
+
const repositoryId = HomeSteps.createRepo();
|
|
14
|
+
// Initializing the repository to speed up retrieving repository info
|
|
15
|
+
cy.initializeRepository(repositoryId);
|
|
16
|
+
|
|
17
|
+
HomeSteps.selectRepo(repositoryId);
|
|
18
|
+
HomeSteps.verifyRepositoryIsSelected(repositoryId);
|
|
19
|
+
HomeSteps.hasRepositoryInfo(repositoryId);
|
|
20
|
+
|
|
21
|
+
cy.deleteRepository(repositoryId);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('Test saved SPARQL queries links on home page and confirm dialog appearance', () => {
|
|
25
|
+
const repositoryId = HomeSteps.createRepo();
|
|
26
|
+
HomeSteps.selectRepo(repositoryId);
|
|
27
|
+
|
|
28
|
+
HomeSteps.verifyQueryLink('Add statements', true);
|
|
29
|
+
HomeSteps.verifyQueryLink('Clear graph', true);
|
|
30
|
+
HomeSteps.verifyQueryLink('Remove statements', true);
|
|
31
|
+
HomeSteps.verifyQueryLink('SPARQL Select template', false);
|
|
32
|
+
|
|
33
|
+
cy.deleteRepository(repositoryId);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import HomeSteps from '../../steps/home-steps';
|
|
2
|
+
import {EnvironmentStubs} from "../../stubs/environment-stubs";
|
|
3
|
+
|
|
4
|
+
describe('Documentation links resolver', () => {
|
|
5
|
+
|
|
6
|
+
beforeEach(() => {
|
|
7
|
+
cy.viewport(1280, 1000);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('Should link to master version when in dev mode', () => {
|
|
11
|
+
HomeSteps.visit();
|
|
12
|
+
EnvironmentStubs.stubWbDevMode();
|
|
13
|
+
HomeSteps.clickHelpMenu();
|
|
14
|
+
// Assert that links point to the master version
|
|
15
|
+
assertDocumentationLinks('master');
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('Should link to master version when in prod mode and unofficial version', () => {
|
|
19
|
+
EnvironmentStubs.stubProductInfo('10.8-TR1-test');
|
|
20
|
+
HomeSteps.visit();
|
|
21
|
+
EnvironmentStubs.stubWbProdMode();
|
|
22
|
+
HomeSteps.clickHelpMenu();
|
|
23
|
+
// Assert that links point to the master version
|
|
24
|
+
assertDocumentationLinks('master');
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('Should link to GDB version when in prod mode and official version', () => {
|
|
28
|
+
EnvironmentStubs.stubProductInfo('10.8');
|
|
29
|
+
HomeSteps.visit();
|
|
30
|
+
EnvironmentStubs.stubWbProdMode();
|
|
31
|
+
HomeSteps.clickHelpMenu();
|
|
32
|
+
// Assert that links point to the specific GDB version
|
|
33
|
+
assertDocumentationLinks('10.8');
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
function assertDocumentationLinks(version) {
|
|
38
|
+
const baseUrl = `https://graphdb.ontotext.com/documentation/${version}`;
|
|
39
|
+
|
|
40
|
+
HomeSteps.getDocumentationLink()
|
|
41
|
+
.should('exist')
|
|
42
|
+
.and('be.visible')
|
|
43
|
+
.find('a')
|
|
44
|
+
.should('have.attr', 'href', `${baseUrl}/index.html`)
|
|
45
|
+
.and('contain.text', 'Documentation');
|
|
46
|
+
|
|
47
|
+
HomeSteps.getTutorialsLink()
|
|
48
|
+
.should('exist')
|
|
49
|
+
.and('be.visible')
|
|
50
|
+
.find('a')
|
|
51
|
+
.should('have.attr', 'href', `${baseUrl}/tutorials.html`)
|
|
52
|
+
.and('contain.text', 'Tutorials');
|
|
53
|
+
|
|
54
|
+
HomeSteps.getSupportLink()
|
|
55
|
+
.should('exist')
|
|
56
|
+
.and('be.visible')
|
|
57
|
+
.find('a')
|
|
58
|
+
.should('have.attr', 'href', `${baseUrl}/support.html`)
|
|
59
|
+
.and('contain.text', 'Support');
|
|
60
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import HomeSteps from '../../steps/home-steps';
|
|
2
|
+
import {LicenseStubs} from "../../stubs/license-stubs";
|
|
3
|
+
import {EnvironmentStubs} from "../../stubs/environment-stubs";
|
|
4
|
+
|
|
5
|
+
describe('Google analytics', () => {
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
cy.viewport(1280, 1000);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
// Note: Google API calls are stubbed for all specs in support/index.js
|
|
12
|
+
it('Should set GA tracking code in header and a cookie when free license and prodMode', () => {
|
|
13
|
+
LicenseStubs.stubFreeLicense();
|
|
14
|
+
HomeSteps.visit();
|
|
15
|
+
EnvironmentStubs.stubWbProdMode();
|
|
16
|
+
|
|
17
|
+
cy.document()
|
|
18
|
+
.get('head script')
|
|
19
|
+
.should("have.attr", "src")
|
|
20
|
+
.should('include', 'https://www.googletagmanager.com/gtm.js?id=GTM-WBP6C6Z4');
|
|
21
|
+
|
|
22
|
+
// Check if the installation ID cookie is set correctly
|
|
23
|
+
cy.getCookie('_wb').then((cookie) => {
|
|
24
|
+
expect(cookie).to.exist;
|
|
25
|
+
expect(cookie.value).to.match(/^WB1\.[a-zA-Z0-9\-]+\.\d+$/); // Check the cookie structure: WB1.<installationId>.<timestamp>
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('Should set GA tracking code in header and cookie when evaluation enterprise license and prodMode', () => {
|
|
30
|
+
LicenseStubs.stubEvaluationLicense();
|
|
31
|
+
HomeSteps.visit();
|
|
32
|
+
EnvironmentStubs.stubWbProdMode();
|
|
33
|
+
|
|
34
|
+
cy.document()
|
|
35
|
+
.get('head script')
|
|
36
|
+
.should("have.attr", "src")
|
|
37
|
+
.should('include', 'https://www.googletagmanager.com/gtm.js?id=GTM-WBP6C6Z4');
|
|
38
|
+
|
|
39
|
+
// Check if the installation ID cookie is set correctly
|
|
40
|
+
cy.getCookie('_wb').then((cookie) => {
|
|
41
|
+
expect(cookie).to.exist;
|
|
42
|
+
expect(cookie.value).to.match(/^WB1\.[a-zA-Z0-9\-]+\.\d+$/); // Check the cookie structure: WB1.<installationId>.<timestamp>
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('Should NOT set GA tracking code in header and cookie when enterprise license in prodMode', () => {
|
|
47
|
+
LicenseStubs.stubEnterpriseLicense();
|
|
48
|
+
HomeSteps.visit();
|
|
49
|
+
EnvironmentStubs.stubWbProdMode();
|
|
50
|
+
|
|
51
|
+
cy.document()
|
|
52
|
+
.get('head script')
|
|
53
|
+
.should("not.have.attr", "src");
|
|
54
|
+
|
|
55
|
+
// Check if the installation ID cookie is set correctly
|
|
56
|
+
cy.getCookie('_wb').then((cookie) => {
|
|
57
|
+
expect(cookie).to.not.exist;
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import HomeSteps from '../../steps/home-steps';
|
|
2
|
+
|
|
3
|
+
describe('Language selector', () => {
|
|
4
|
+
|
|
5
|
+
beforeEach(() => {
|
|
6
|
+
cy.viewport(1280, 1000);
|
|
7
|
+
HomeSteps.visitAndWaitLoader();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('Should be able to change the language', () => {
|
|
11
|
+
cy.get('#languageGroupDrop')
|
|
12
|
+
.should('be.visible')
|
|
13
|
+
.click()
|
|
14
|
+
.then(() => {
|
|
15
|
+
cy.get('.dropdown-menu .dropdown-item')
|
|
16
|
+
.should('have.length.at.least', 1);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
});
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import HomeSteps from '../../steps/home-steps';
|
|
2
|
+
|
|
3
|
+
const FILE_TO_IMPORT = 'wine.rdf';
|
|
4
|
+
|
|
5
|
+
describe('RDF resource search', () => {
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
cy.viewport(1280, 1000);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('Search button should not be present when no repo is selected', () => {
|
|
12
|
+
HomeSteps.visitAndWaitLoader();
|
|
13
|
+
cy.get('.search-rdf-btn').should('not.exist');
|
|
14
|
+
cy.get('.search-rdf-input').should('not.exist');
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('Search should be made from home page search when repo is set and on home page', () => {
|
|
18
|
+
const repositoryId = '23repo' + Date.now();
|
|
19
|
+
cy.createRepository({id: repositoryId});
|
|
20
|
+
cy.initializeRepository(repositoryId);
|
|
21
|
+
cy.enableAutocomplete(repositoryId);
|
|
22
|
+
cy.presetRepository(repositoryId);
|
|
23
|
+
|
|
24
|
+
// When I visit home page with selected repository
|
|
25
|
+
HomeSteps.visitAndWaitLoader();
|
|
26
|
+
// Search rdf button should be visible
|
|
27
|
+
cy.get('.search-rdf-btn').should('be.visible');
|
|
28
|
+
// When I click the button
|
|
29
|
+
HomeSteps.doNotOpenRdfSearchBoxButFocusResourceSearch();
|
|
30
|
+
// I should be able to type some text in the input on home page
|
|
31
|
+
cy.get('#search-resource-input-home > #search-resource-box > input').type('hasPos');
|
|
32
|
+
// And the autocomplete dropdown should become visible
|
|
33
|
+
cy.get('#search-resource-input-home > #auto-complete-results-wrapper').should('be.visible');
|
|
34
|
+
// // When I click the close button
|
|
35
|
+
cy.get('#search-resource-input-home > #search-resource-box > .clear-icon').click();
|
|
36
|
+
// // The input should be cleared
|
|
37
|
+
cy.get('#search-resource-input-home > #search-resource-box > input').should('have.value', '');
|
|
38
|
+
|
|
39
|
+
cy.deleteRepository(repositoryId);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('Search should be present when repo is set', () => {
|
|
43
|
+
const repositoryId = '23repo' + Date.now();
|
|
44
|
+
cy.createRepository({id: repositoryId});
|
|
45
|
+
cy.initializeRepository(repositoryId);
|
|
46
|
+
cy.enableAutocomplete(repositoryId);
|
|
47
|
+
cy.presetRepository(repositoryId);
|
|
48
|
+
|
|
49
|
+
// When I visit not home page with selected repository
|
|
50
|
+
cy.visit('/graphs');
|
|
51
|
+
cy.get('.ot-splash').should('not.be.visible');
|
|
52
|
+
cy.get('.ot-loader-new-content').should('not.exist');
|
|
53
|
+
// Search rdf button should be visible
|
|
54
|
+
cy.get('.search-rdf-btn').should('be.visible');
|
|
55
|
+
// When I click the button
|
|
56
|
+
HomeSteps.openRdfSearchBox();
|
|
57
|
+
// I should be able to type some text in the input
|
|
58
|
+
cy.get('.search-rdf-input search-resource-input .view-res-input').type('hasPos');
|
|
59
|
+
// And the autocomplete dropdown should become visible
|
|
60
|
+
cy.get('.search-rdf-input #auto-complete-results-wrapper').should('be.visible');
|
|
61
|
+
// When I click the close button
|
|
62
|
+
cy.get('.close-rdf-search-btn').click();
|
|
63
|
+
// The input should not be cleared
|
|
64
|
+
cy.get('.search-rdf-input search-resource-input .view-res-input').should('have.value', 'hasPos');
|
|
65
|
+
// And the search bar should hide and not be visible
|
|
66
|
+
cy.get('.search-rdf-input').should('not.be.visible');
|
|
67
|
+
// And the suggestions list should not be visible
|
|
68
|
+
cy.get('.search-rdf-input #auto-complete-results-wrapper').should('not.be.visible');
|
|
69
|
+
// And the search button should be visible
|
|
70
|
+
cy.get('.search-rdf-btn').should('be.visible');
|
|
71
|
+
// When I open again the search box
|
|
72
|
+
HomeSteps.openRdfSearchBox();
|
|
73
|
+
// The input should have value 'hasPos'
|
|
74
|
+
cy.get('.search-rdf-input search-resource-input .view-res-input').should('have.value', 'hasPos');
|
|
75
|
+
// And dropdown should be visible
|
|
76
|
+
cy.get('.search-rdf-input #auto-complete-results-wrapper').should('be.visible');
|
|
77
|
+
// When I press 'escape'
|
|
78
|
+
cy.get('.search-rdf-input search-resource-input .view-res-input').type('{esc}');
|
|
79
|
+
// Search box should not be visible
|
|
80
|
+
cy.get('.search-rdf-input').should('not.be.visible');
|
|
81
|
+
|
|
82
|
+
cy.deleteRepository(repositoryId);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('Search should be persisted on page reload', () => {
|
|
86
|
+
const repositoryId = '23repo' + Date.now();
|
|
87
|
+
cy.createRepository({id: repositoryId});
|
|
88
|
+
cy.initializeRepository(repositoryId);
|
|
89
|
+
cy.enableAutocomplete(repositoryId);
|
|
90
|
+
cy.presetRepository(repositoryId);
|
|
91
|
+
|
|
92
|
+
cy.visit('/graphs', {
|
|
93
|
+
onBeforeLoad(win) {
|
|
94
|
+
cy.stub(win, 'open').as('window.open');
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
cy.get('.ot-splash').should('not.be.visible');
|
|
98
|
+
cy.get('.ot-loader-new-content').should('not.exist');
|
|
99
|
+
// Search rdf button should be visible
|
|
100
|
+
cy.get('.search-rdf-btn').should('be.visible');
|
|
101
|
+
// When I click the button
|
|
102
|
+
HomeSteps.openRdfSearchBox();
|
|
103
|
+
// I should be able to type some text in the input
|
|
104
|
+
cy.get('.search-rdf-input search-resource-input .view-res-input')
|
|
105
|
+
.type('hasPos').then(() => {
|
|
106
|
+
// When I select option from suggestions
|
|
107
|
+
cy.get(".search-rdf-input #auto-complete-results-wrapper p")
|
|
108
|
+
.contains('hasPos')
|
|
109
|
+
.click()
|
|
110
|
+
.then(() => {
|
|
111
|
+
// Search result should be opened in new window
|
|
112
|
+
cy.get('@window.open').should('be.calledWith', 'resource?uri=http%3A%2F%2Fwww.w3.org%2Fns%2Forg%23hasPost');
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// When I revisit the home page
|
|
117
|
+
cy.visit('/graphs');
|
|
118
|
+
// When I open again the search box
|
|
119
|
+
HomeSteps.openRdfSearchBox();
|
|
120
|
+
// The input should have value 'hasPos' from previous search
|
|
121
|
+
cy.get('.search-rdf-input search-resource-input .view-res-input').should('have.value', 'hasPos');
|
|
122
|
+
// And dropdown should be visible
|
|
123
|
+
cy.get('.search-rdf-input #auto-complete-results-wrapper').should('be.visible');
|
|
124
|
+
// When I press 'escape'
|
|
125
|
+
cy.get('.search-rdf-input search-resource-input .view-res-input')
|
|
126
|
+
.type('{esc}')
|
|
127
|
+
.then(() => {
|
|
128
|
+
// Search box should not be visible
|
|
129
|
+
cy.get('.search-rdf-input').should('not.be.visible');
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
cy.deleteRepository(repositoryId);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it('Should test RDF resource search box', () => {
|
|
136
|
+
//Prepare repository, autocomplete and import data.
|
|
137
|
+
const repositoryId = 'repository-' + Date.now();
|
|
138
|
+
cy.createRepository({id: repositoryId});
|
|
139
|
+
cy.initializeRepository(repositoryId);
|
|
140
|
+
cy.presetRepository(repositoryId);
|
|
141
|
+
cy.importServerFile(repositoryId, FILE_TO_IMPORT);
|
|
142
|
+
cy.enableAutocomplete(repositoryId);
|
|
143
|
+
HomeSteps.visitAndWaitLoader();
|
|
144
|
+
|
|
145
|
+
//Verify that the main resource search box is focused
|
|
146
|
+
getRDFResourceSearchBox().click();
|
|
147
|
+
cy.focused().should('have.attr', 'placeholder', 'Search RDF resources...');
|
|
148
|
+
|
|
149
|
+
//Navigate away from the Homepage, to be able to test the new resource search box
|
|
150
|
+
cy.visit('/graphs', {
|
|
151
|
+
onBeforeLoad(win) {
|
|
152
|
+
cy.stub(win, 'open').as('window.open');
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
cy.get('.ot-splash').should('not.be.visible');
|
|
157
|
+
cy.get('.ot-loader-new-content').should('not.exist');
|
|
158
|
+
|
|
159
|
+
getRDFResourceSearchBox().click();
|
|
160
|
+
//Verify that the new resource search box is focused
|
|
161
|
+
cy.focused().should('have.attr', 'placeholder', 'Search RDF resources...');
|
|
162
|
+
|
|
163
|
+
//Verify autocomplete suggestions count
|
|
164
|
+
cy.focused().then(() => {
|
|
165
|
+
cy.get('#search-resource-box input')
|
|
166
|
+
.should('be.visible')
|
|
167
|
+
.type('Dry');
|
|
168
|
+
cy.get('#auto-complete-results-wrapper')
|
|
169
|
+
.should('be.visible')
|
|
170
|
+
.children()
|
|
171
|
+
.should('have.length', 7);
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
//Test table and visual buttons.
|
|
175
|
+
cy.get("#auto_0").should('be.visible').click();
|
|
176
|
+
// Search result should be opened in new window
|
|
177
|
+
cy.get('@window.open').should('be.calledWith', 'resource?uri=http%3A%2F%2Fwww.w3.org%2FTR%2F2003%2FPR-owl-guide-20031209%2Fwine%23Dry');
|
|
178
|
+
|
|
179
|
+
getVisualButton().click();
|
|
180
|
+
cy.get("#auto_0").should('be.visible').click();
|
|
181
|
+
cy.get('@window.open').should('be.calledWith', 'graphs-visualizations?uri=http%3A%2F%2Fwww.w3.org%2FTR%2F2003%2FPR-owl-guide-20031209%2Fwine%23Dry');
|
|
182
|
+
cy.deleteRepository(repositoryId);
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
function getRDFResourceSearchBox() {
|
|
187
|
+
return cy.get('rdf-resource-search').should('be.visible');
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function getVisualButton() {
|
|
191
|
+
return cy.get('.display-type-visual-btn').should('be.visible');
|
|
192
|
+
}
|