graphdb-workbench-tests 4.0.0-TR2 → 4.0.0-TR21
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/e2e-flaky/import/import-server-files-operations.spec.js +8 -30
- package/e2e-flaky/import/import-user-data-batch-operations.spec.js +7 -7
- package/e2e-flaky/import/import-user-data-url.spec.js +1 -1
- package/e2e-flaky/sparql-editor/lucene-connector.spec.js +1 -1
- package/e2e-legacy/cluster/cluster-configuration/cluster-configuration-multi-region.spec.js +27 -0
- package/e2e-legacy/cluster/edit-cluster-nodes-modal.spec.js +1 -1
- package/e2e-legacy/explore/graphs-overview/graphs.overview.spec.js +31 -2
- package/e2e-legacy/explore/visual-graph/visual.graph.spec.js +35 -4
- package/e2e-legacy/graph-navigator/graph-navigator-restrictions.spec.js +216 -0
- package/e2e-legacy/graph-navigator/graph-navigator.spec.js +447 -0
- package/e2e-legacy/guides/import-rdf-file/confirm-duplicate-rdf-file.spec.js +1 -1
- package/e2e-legacy/guides/main-menu/main-menu-guide.spec.js +6 -14
- package/e2e-legacy/guides/ttyg/configure-agent/configure-agent-guide.spec.js +26 -30
- package/e2e-legacy/guides/ttyg/edit-agent/edit-ttyg-agent-guide.spec.js +12 -20
- package/e2e-legacy/home/home-page-without-repositories.spec.js +3 -1
- package/e2e-legacy/home/home-page-without-selected-repository.spec.js +2 -1
- package/e2e-legacy/import/import-server-files-batch-operations.spec.js +38 -5
- package/e2e-legacy/import/import-server-files.spec.js +39 -23
- package/e2e-legacy/import/import-user-data-file-upload.spec.js +47 -22
- package/e2e-legacy/import/import-user-data-settings-dialog.spec.js +81 -10
- package/e2e-legacy/import/import-user-data-text-snippet.spec.js +6 -45
- package/e2e-legacy/import/import-user-data-url.spec.js +9 -5
- package/e2e-legacy/import/import-view.spec.js +2 -2
- package/e2e-legacy/monitor/global-operation-statuses-component.spec.js +13 -17
- package/e2e-legacy/rdf-version/rdf-version-accept-header.spec.js +145 -0
- package/e2e-legacy/repository/attach-remote-location.spec.js +7 -15
- package/e2e-legacy/repository/fedx-deprecation.spec.js +178 -0
- package/e2e-legacy/repository/ontop-repository.spec.js +25 -34
- package/e2e-legacy/repository/rename-repository-restrictions.spec.js +5 -1
- package/e2e-legacy/repository/repositories.spec.js +3 -3
- package/e2e-legacy/repository/repository-picker-tooltip.spec.js +72 -0
- package/e2e-legacy/repository/repository-selector-tooltip.spec.js +55 -0
- package/e2e-legacy/resource/resource.spec.js +177 -40
- package/e2e-legacy/setup/aclmanagement/create-rule.spec.js +14 -25
- package/e2e-legacy/setup/aclmanagement/delete-rule.spec.js +6 -6
- package/e2e-legacy/setup/aclmanagement/edit-rule.spec.js +15 -15
- package/e2e-legacy/setup/aclmanagement/render-rules.spec.js +1 -1
- package/e2e-legacy/setup/aclmanagement/reorder-rules.spec.js +2 -2
- package/e2e-legacy/setup/aclmanagement/revert-rules.spec.js +2 -2
- package/e2e-legacy/setup/aclmanagement/update-rules.spec.js +3 -3
- package/e2e-legacy/setup/aclmanagement/validate-uri.spec.js +152 -0
- package/e2e-legacy/setup/connectors/connectors-initial-state-with-selected-repository.spec.js +1 -1
- package/e2e-legacy/setup/plugins/plugins-without-repository.spec.js +1 -1
- package/e2e-legacy/setup/settings/my-settings.spec.js +25 -15
- package/e2e-legacy/setup/users-and-access/user-and-access.spec.js +34 -25
- package/e2e-legacy/sparql-editor/saved-query/abort-query.spec.js +1 -1
- package/e2e-legacy/sparql-editor/sparql-editor-navigation.spec.js +219 -0
- package/e2e-legacy/sparql-editor/yasgui-tabs.spec.js +1 -1
- package/e2e-legacy/sparql-editor/yasr/download-as.spec.js +4 -7
- package/e2e-legacy/sparql-editor/yasr/toolbar/visual-graph-button.spec.js +8 -8
- package/e2e-legacy/ttyg/chat-list.spec.js +1 -1
- package/e2e-legacy/ttyg/create-agent.spec.js +6 -4
- package/e2e-legacy/ttyg/create-chat.spec.js +1 -1
- package/e2e-legacy/ttyg/edit-agent.spec.js +57 -0
- package/e2e-legacy/ttyg/ttyg-initial-state-with-configured-api-key.spec.js +1 -1
- package/e2e-legacy/ttyg/ttyg-initial-state-with-selected-repository.spec.js +1 -1
- package/e2e-legacy/ttyg/ttyg-initial-state-without-repositories.spec.js +1 -1
- package/e2e-security/explore/visual-graph/graph-config-owner-actions.spec.js +52 -0
- package/e2e-security/setup/home/cookie-policy.spec.js +4 -0
- package/e2e-security/setup/license/license-loading.spec.js +57 -0
- package/e2e-security/setup/license/license-logout.spec.js +38 -0
- package/e2e-security/setup/users-and-access/create-user-permissions.spec.js +1 -1
- package/e2e-security/setup/users-and-access/repo-admin-role.spec.js +1 -1
- package/e2e-security/setup/users-and-access/user-and-access.spec.js +0 -1
- package/fixtures/cluster/3-nodes-cluster-group-status-no-leader.json +41 -0
- package/fixtures/cluster/cluster-config-with-tag.json +17 -0
- package/fixtures/connectors/get-connectors.json +0 -1
- package/fixtures/graph-navigator/graph-navigator-settings-invalid.ttl +149 -0
- package/fixtures/graph-navigator/graph-navigator-settings.ttl +148 -0
- package/fixtures/graphdb-import/wine.rdf +279 -285
- package/npm-shrinkwrap.json +1283 -1643
- package/package.json +10 -1
- package/steps/base-steps.js +4 -0
- package/steps/cluster/cluster-configuration-steps.js +4 -0
- package/steps/cookie-policy/cookie-consent-banner-steps.js +2 -2
- package/steps/error-steps.js +2 -2
- package/steps/explore/graphs-overview-steps.js +44 -0
- package/steps/graph-navigator-steps.js +145 -0
- package/steps/header-steps.js +5 -1
- package/steps/home-steps.js +3 -6
- package/steps/import/import-server-files-steps.js +8 -0
- package/steps/import/import-settings-dialog-steps.js +16 -0
- package/steps/import/import-steps.js +88 -17
- package/steps/import/import-test-constants.js +1 -1
- package/steps/import/import-user-data-steps.js +24 -24
- package/steps/language-selector-steps.js +4 -0
- package/steps/layout-steps.js +6 -0
- package/steps/login-steps.js +7 -3
- package/steps/main-menu-steps.js +14 -14
- package/steps/ontop-repository-steps.js +4 -0
- package/steps/page-restrictions-steps.js +24 -0
- package/steps/repositories/attach-repository-steps.js +2 -10
- package/steps/repository-picker-list-steps.js +58 -0
- package/steps/repository-selector-steps.js +20 -0
- package/steps/repository-steps.js +48 -9
- package/steps/resource/resource-steps.js +76 -9
- package/steps/setup/acl-management-steps.js +4 -24
- package/steps/setup/settings-steps.js +42 -0
- package/steps/setup/user-and-access-steps.js +18 -14
- package/steps/toaster-steps.js +4 -0
- package/steps/ttyg/ttyg-view-steps.js +1 -14
- package/steps/visual-graph-steps.js +8 -0
- package/steps/widgets/repository-errors-widget-steps.js +15 -2
- package/steps/yasgui/yasqe-steps.js +3 -1
- package/steps/yasgui/yasr-steps.js +8 -0
- package/stubs/browser-stubs.js +40 -0
- package/stubs/cluster/cluster-stubs.js +15 -1
- package/stubs/graph-navigator-stubs.js +27 -0
- package/stubs/license-stubs.js +11 -3
- package/stubs/repositories/repositories-stubs.js +44 -0
- package/stubs/yasgui/query-stubs.js +5 -0
- package/support/visual-graph-commands.js +19 -0
- package/e2e-legacy/home/solr-banner/solr-banner.spec.js +0 -137
- package/fixtures/graphdb-import/test-trigstar.trigs +0 -32
- package/fixtures/graphdb-import/test_turtlestar.ttls +0 -6
- package/fixtures/graphdb-import/turtlestar-data.ttls +0 -77
- package/steps/deprecation-banner/deprecation-banner-steps.js +0 -13
- package/steps/deprecation-steps.js +0 -13
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import {EnvironmentStubs} from "../../stubs/environment-stubs";
|
|
2
2
|
|
|
3
|
+
const CENTER_SCROLL = {scrollBehavior: 'center'};
|
|
4
|
+
|
|
3
5
|
export class UserAndAccessSteps {
|
|
4
6
|
static visit() {
|
|
5
7
|
cy.visit('/users');
|
|
@@ -118,7 +120,9 @@ export class UserAndAccessSteps {
|
|
|
118
120
|
}
|
|
119
121
|
|
|
120
122
|
static typeUsername(text) {
|
|
121
|
-
this.getUsernameField()
|
|
123
|
+
this.getUsernameField()
|
|
124
|
+
.focus()
|
|
125
|
+
.type(text);
|
|
122
126
|
}
|
|
123
127
|
|
|
124
128
|
static getPasswordField() {
|
|
@@ -238,13 +242,13 @@ export class UserAndAccessSteps {
|
|
|
238
242
|
.contains('Global (any data repository)')
|
|
239
243
|
.parent('tr')
|
|
240
244
|
.find('.graphql')
|
|
241
|
-
.
|
|
245
|
+
.click(CENTER_SCROLL);
|
|
242
246
|
}
|
|
243
247
|
|
|
244
248
|
static clickGraphqlAccessRepo(repoName) {
|
|
245
249
|
this.getRepositoryRightsLine(repoName)
|
|
246
250
|
.find('.graphql')
|
|
247
|
-
.
|
|
251
|
+
.click(CENTER_SCROLL);
|
|
248
252
|
}
|
|
249
253
|
|
|
250
254
|
static clickReadAccessAny() {
|
|
@@ -252,7 +256,7 @@ export class UserAndAccessSteps {
|
|
|
252
256
|
.contains('Global (any data repository)')
|
|
253
257
|
.parent('tr')
|
|
254
258
|
.find('.read')
|
|
255
|
-
.
|
|
259
|
+
.click(CENTER_SCROLL);
|
|
256
260
|
}
|
|
257
261
|
|
|
258
262
|
static clickReadAccessRepo(repoName) {
|
|
@@ -260,7 +264,7 @@ export class UserAndAccessSteps {
|
|
|
260
264
|
.contains(repoName)
|
|
261
265
|
.parent('tr')
|
|
262
266
|
.find('.read')
|
|
263
|
-
.
|
|
267
|
+
.click(CENTER_SCROLL);
|
|
264
268
|
}
|
|
265
269
|
|
|
266
270
|
static clickWriteAccessAny() {
|
|
@@ -268,7 +272,7 @@ export class UserAndAccessSteps {
|
|
|
268
272
|
.contains('Global (any data repository)')
|
|
269
273
|
.parent('tr')
|
|
270
274
|
.find('.write')
|
|
271
|
-
.
|
|
275
|
+
.click(CENTER_SCROLL);
|
|
272
276
|
}
|
|
273
277
|
|
|
274
278
|
static clickWriteAccessRepo(repoName) {
|
|
@@ -276,7 +280,7 @@ export class UserAndAccessSteps {
|
|
|
276
280
|
.contains(repoName)
|
|
277
281
|
.parent('tr')
|
|
278
282
|
.find('.write')
|
|
279
|
-
.
|
|
283
|
+
.click(CENTER_SCROLL);
|
|
280
284
|
}
|
|
281
285
|
|
|
282
286
|
static findUserRowAlias(username, aliasName = 'userRow') {
|
|
@@ -351,7 +355,7 @@ export class UserAndAccessSteps {
|
|
|
351
355
|
}
|
|
352
356
|
|
|
353
357
|
static toggleReadAccessForRepo(repoName) {
|
|
354
|
-
return this.getReadAccessForRepo(repoName).
|
|
358
|
+
return this.getReadAccessForRepo(repoName).click(CENTER_SCROLL);
|
|
355
359
|
}
|
|
356
360
|
|
|
357
361
|
static validateReadAccessForRepo(repoName, expectedState) {
|
|
@@ -374,7 +378,7 @@ export class UserAndAccessSteps {
|
|
|
374
378
|
}
|
|
375
379
|
|
|
376
380
|
static toggleWriteAccessForRepo(repoName) {
|
|
377
|
-
return this.getWriteAccessForRepo(repoName).
|
|
381
|
+
return this.getWriteAccessForRepo(repoName).click(CENTER_SCROLL);
|
|
378
382
|
}
|
|
379
383
|
|
|
380
384
|
static validateWriteAccessForRepo(repoName, expectedState) {
|
|
@@ -390,7 +394,7 @@ export class UserAndAccessSteps {
|
|
|
390
394
|
}
|
|
391
395
|
|
|
392
396
|
static clickMaintainAccessRepo(repoName) {
|
|
393
|
-
UserAndAccessSteps.getMaintainAccessRepoCheckbox(repoName).
|
|
397
|
+
UserAndAccessSteps.getMaintainAccessRepoCheckbox(repoName).click(CENTER_SCROLL);
|
|
394
398
|
}
|
|
395
399
|
|
|
396
400
|
static toggleMaintainRepoForRepo(repoName) {
|
|
@@ -410,7 +414,7 @@ export class UserAndAccessSteps {
|
|
|
410
414
|
}
|
|
411
415
|
|
|
412
416
|
static toggleGraphqlAccessForRepo(repoName) {
|
|
413
|
-
return this.getGraphqlAccessForRepo(repoName).
|
|
417
|
+
return this.getGraphqlAccessForRepo(repoName).click(CENTER_SCROLL);
|
|
414
418
|
}
|
|
415
419
|
|
|
416
420
|
static validateGraphqlAccessForRepo(repoName, expectedState) {
|
|
@@ -455,19 +459,19 @@ export class UserAndAccessSteps {
|
|
|
455
459
|
.contains(repoName)
|
|
456
460
|
.parent('.row')
|
|
457
461
|
.find('.read')
|
|
458
|
-
.
|
|
462
|
+
.click(CENTER_SCROLL);
|
|
459
463
|
}
|
|
460
464
|
|
|
461
465
|
static clickFreeWriteAccessRepo(repoName) {
|
|
462
466
|
cy.get('.repo-fields').contains(repoName).parent('.row').as('row');
|
|
463
467
|
cy.get('@row').scrollIntoView();
|
|
464
|
-
cy.get('@row').find('.write').
|
|
468
|
+
cy.get('@row').find('.write').click(CENTER_SCROLL);
|
|
465
469
|
}
|
|
466
470
|
|
|
467
471
|
static clickFreeGraphqlAccessRepo(repoName) {
|
|
468
472
|
cy.get('.repo-fields').contains(repoName).parent('.row').as('row');
|
|
469
473
|
cy.get('@row').scrollIntoView();
|
|
470
|
-
cy.get('@row').find('.graphql').
|
|
474
|
+
cy.get('@row').find('.graphql').click(CENTER_SCROLL);
|
|
471
475
|
}
|
|
472
476
|
|
|
473
477
|
}
|
package/steps/toaster-steps.js
CHANGED
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
import {BaseSteps} from "../base-steps";
|
|
2
|
-
import {DeprecationSteps} from '../deprecation-banner/deprecation-banner-steps.js';
|
|
3
2
|
|
|
4
3
|
export class TTYGViewSteps extends BaseSteps {
|
|
5
|
-
|
|
6
|
-
* Visits the TTYG page and closes the Solr deprecation banner by default.
|
|
7
|
-
*
|
|
8
|
-
* @param {boolean} closeSolrBanner Whether to close the banner. Set to `false`
|
|
9
|
-
* when revisiting the page after the banner has already been closed.
|
|
10
|
-
*/
|
|
11
|
-
static visit(closeSolrBanner = true) {
|
|
4
|
+
static visit() {
|
|
12
5
|
cy.visit('/ttyg');
|
|
13
|
-
// Temporary workaround until the Solr deprecation banner is removed.
|
|
14
|
-
// The banner changes the page layout, causing tests to fail randomly.
|
|
15
|
-
// This quick fix prevents GraphDB build failures and should be deleted together with the banner.
|
|
16
|
-
if (closeSolrBanner) {
|
|
17
|
-
DeprecationSteps.closeBanner();
|
|
18
|
-
}
|
|
19
6
|
}
|
|
20
7
|
|
|
21
8
|
static getTtygView() {
|
|
@@ -369,6 +369,14 @@ export class VisualGraphSteps extends BaseSteps {
|
|
|
369
369
|
this.getGraphConfig(name).closest('tr').find('.delete-config').click();
|
|
370
370
|
}
|
|
371
371
|
|
|
372
|
+
static getEditConfigButton(name) {
|
|
373
|
+
return this.getGraphConfig(name).closest('tr').getByTestId('graph-config-edit-btn');
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
static getDeleteConfigButton(name) {
|
|
377
|
+
return this.getGraphConfig(name).closest('tr').getByTestId('graph-config-delete-btn');
|
|
378
|
+
}
|
|
379
|
+
|
|
372
380
|
static getGraphConfigSearchPanel() {
|
|
373
381
|
return cy.get('.search-bar');
|
|
374
382
|
}
|
|
@@ -7,8 +7,12 @@ export class RepositoryErrorsWidgetSteps {
|
|
|
7
7
|
return RepositoryErrorsWidgetSteps.getWidget().find('.create-repository-btn');
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
static
|
|
11
|
-
return RepositoryErrorsWidgetSteps.getWidget().
|
|
10
|
+
static getRepositoryFilter() {
|
|
11
|
+
return RepositoryErrorsWidgetSteps.getWidget().getByTestId('core-errors-repository-filter');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
static getLocalOnlyCheckbox() {
|
|
15
|
+
return RepositoryErrorsWidgetSteps.getWidget().getByTestId('core-errors-local-only-checkbox');
|
|
12
16
|
}
|
|
13
17
|
|
|
14
18
|
static getInfoMessage() {
|
|
@@ -18,4 +22,13 @@ export class RepositoryErrorsWidgetSteps {
|
|
|
18
22
|
static getRepositoryList() {
|
|
19
23
|
return RepositoryErrorsWidgetSteps.getWidget().find('.repos .repository');
|
|
20
24
|
}
|
|
25
|
+
|
|
26
|
+
static getRepositoryFedxDeprecatedTag(repositoryId) {
|
|
27
|
+
return RepositoryErrorsWidgetSteps.getWidget()
|
|
28
|
+
.getByTestId('core-errors-repository-id')
|
|
29
|
+
.contains(repositoryId)
|
|
30
|
+
// There is no test id command for closest(), so the row is selected by its data-test attribute.
|
|
31
|
+
.closest('[data-test="core-errors-repository"]')
|
|
32
|
+
.getByTestId('core-errors-fedx-deprecated-tag');
|
|
33
|
+
}
|
|
21
34
|
}
|
|
@@ -64,8 +64,10 @@ export class YasqeSteps {
|
|
|
64
64
|
.should('be.visible');
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
static
|
|
67
|
+
static executeQueryWithoutWaitingForResult() {
|
|
68
68
|
this.clickExecuteQueryButtonAndHideTooltip();
|
|
69
|
+
// Make sure that the query is executed before Cypress continues.
|
|
70
|
+
YasqeSteps.getAbortQueryButton().should('be.visible');
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
static executeErrorQuery() {
|
|
@@ -142,4 +142,12 @@ export class YasrSteps extends BaseSteps {
|
|
|
142
142
|
static toggleFullscreen() {
|
|
143
143
|
YasrSteps.getFullscreenButton().click();
|
|
144
144
|
}
|
|
145
|
+
|
|
146
|
+
static getGraphNavigatorButton() {
|
|
147
|
+
return YasrSteps.getYasr().find('.explore-graph-navigator');
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
static visualizeInGraphNavigator() {
|
|
151
|
+
YasrSteps.getGraphNavigatorButton().click();
|
|
152
|
+
}
|
|
145
153
|
}
|
package/stubs/browser-stubs.js
CHANGED
|
@@ -7,6 +7,10 @@ export class BrowserStubs {
|
|
|
7
7
|
return isDefinition ? 'navigateToUrl' : '@navigateToUrl';
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
static LINK_CLICKS_ALIAS = (isDefinition = false) => {
|
|
11
|
+
return isDefinition ? 'linkClicks' : '@linkClicks';
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
static stubWindowOpen() {
|
|
11
15
|
cy.window().then((win) => {
|
|
12
16
|
cy.stub(win, 'open').as(BrowserStubs.WINDOW_OPEN_ALIAS(true))
|
|
@@ -18,4 +22,40 @@ export class BrowserStubs {
|
|
|
18
22
|
cy.spy(win.singleSpa, 'navigateToUrl').as(BrowserStubs.NAVIGATE_TO_URL_ALIAS(true))
|
|
19
23
|
})
|
|
20
24
|
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Checks what the browser would do with a clicked link, without following it.
|
|
28
|
+
*
|
|
29
|
+
* Use it for plain links (`<a href target="_blank">`) that the browser opens by itself. Such links do not call
|
|
30
|
+
* `window.open`, so {@link stubWindowOpen} cannot see them, and Cypress cannot follow a new window.
|
|
31
|
+
*
|
|
32
|
+
* For every clicked link it records:
|
|
33
|
+
* - `href`: the link address;
|
|
34
|
+
* - `target`: the link target, `_blank` for a new window;
|
|
35
|
+
* - `defaultPrevented`: `true` when the page handled the click itself, for example to navigate in the same window.
|
|
36
|
+
* The browser opens the link only when this is `false`.
|
|
37
|
+
*
|
|
38
|
+
* Then it stops the click, so the test stays on the same page.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* BrowserStubs.captureLinkClicks();
|
|
42
|
+
* cy.get('a.my-link').click();
|
|
43
|
+
* // The browser would open "cluster" in a new window.
|
|
44
|
+
* cy.get(BrowserStubs.LINK_CLICKS_ALIAS())
|
|
45
|
+
* .should('deep.equal', [{href: 'cluster', target: '_blank', defaultPrevented: false}]);
|
|
46
|
+
*/
|
|
47
|
+
static captureLinkClicks() {
|
|
48
|
+
cy.window().then((win) => {
|
|
49
|
+
const clicks = [];
|
|
50
|
+
win.document.addEventListener('click', (event) => {
|
|
51
|
+
const link = event.target.closest('a');
|
|
52
|
+
if (!link) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
clicks.push({href: link.getAttribute('href'), target: link.target, defaultPrevented: event.defaultPrevented});
|
|
56
|
+
event.preventDefault();
|
|
57
|
+
});
|
|
58
|
+
cy.wrap(clicks).as(BrowserStubs.LINK_CLICKS_ALIAS(true));
|
|
59
|
+
});
|
|
60
|
+
}
|
|
21
61
|
}
|
|
@@ -77,6 +77,13 @@ export class ClusterStubs extends Stubs {
|
|
|
77
77
|
}).as('cluster-config');
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
static stubClusterConfigWithTag() {
|
|
81
|
+
cy.intercept('/rest/cluster/config', {
|
|
82
|
+
fixture: '/cluster/cluster-config-with-tag.json',
|
|
83
|
+
statusCode: 200
|
|
84
|
+
}).as('cluster-config-with-tag');
|
|
85
|
+
}
|
|
86
|
+
|
|
80
87
|
static stubDeleteCluster() {
|
|
81
88
|
cy.intercept('/rest/cluster/config?force=false', {
|
|
82
89
|
fixture: '/cluster/delete-cluster.json',
|
|
@@ -132,7 +139,7 @@ export class ClusterStubs extends Stubs {
|
|
|
132
139
|
added.forEach((node) => {
|
|
133
140
|
response[node] = "Node was successfully added in the cluster.";
|
|
134
141
|
});
|
|
135
|
-
|
|
142
|
+
removed.forEach((node) => {
|
|
136
143
|
response[node] = "Node was successfully removed from the cluster.";
|
|
137
144
|
});
|
|
138
145
|
|
|
@@ -210,6 +217,13 @@ export class ClusterStubs extends Stubs {
|
|
|
210
217
|
}).as('3-nodes-cluster-group-status-tag');
|
|
211
218
|
}
|
|
212
219
|
|
|
220
|
+
static stubClusterGroupStatusWithoutLeader() {
|
|
221
|
+
cy.intercept('/rest/cluster/group/status', {
|
|
222
|
+
fixture: '/cluster/3-nodes-cluster-group-status-no-leader.json',
|
|
223
|
+
statusCode: 200
|
|
224
|
+
}).as('3-nodes-cluster-group-status-no-leader');
|
|
225
|
+
}
|
|
226
|
+
|
|
213
227
|
static stubDeleteTag(uri) {
|
|
214
228
|
cy.intercept(`rest/cluster/config/tag`, {
|
|
215
229
|
body: `"Removed primary tag '${uri}' from cluster`,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {Stubs} from './stubs';
|
|
2
|
+
|
|
3
|
+
export class GraphNavigatorStubs extends Stubs {
|
|
4
|
+
/**
|
|
5
|
+
* Makes the full-text search of the Graph Navigator settings use the GraphDB autocomplete index.
|
|
6
|
+
*/
|
|
7
|
+
static stubSettingsWithAutocomplete() {
|
|
8
|
+
cy.intercept('GET', '/rest/repositories/*/graph-navigator/settings', (req) => {
|
|
9
|
+
req.continue((res) => {
|
|
10
|
+
res.body.fullTextSearch.prefix = 'PREFIX auto: <http://www.ontotext.com/plugins/autocomplete#>';
|
|
11
|
+
});
|
|
12
|
+
}).as('graph-navigator-settings');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Aliases the SPARQL requests that look up entities by the given text as `entity-lookup`.
|
|
17
|
+
*/
|
|
18
|
+
static spyEntityLookup(text) {
|
|
19
|
+
cy.intercept('POST', '/repositories/*', (req) => {
|
|
20
|
+
// The body is form-encoded (`query=...`), so decode it to match the SPARQL text.
|
|
21
|
+
const body = new URLSearchParams(String(req.body)).get('query') ?? '';
|
|
22
|
+
if (body.includes('SELECT ?inst ?class ?label WHERE') && body.includes(text)) {
|
|
23
|
+
req.alias = 'entity-lookup';
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
package/stubs/license-stubs.js
CHANGED
|
@@ -4,6 +4,17 @@ export class LicenseStubs {
|
|
|
4
4
|
cy.intercept('GET', '/rest/graphdb-settings/license').as('get-license');
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Spies on the license request and sends it to the server, bypassing the license stubs defined before.
|
|
9
|
+
*/
|
|
10
|
+
static spyGetLicenseFromServer() {
|
|
11
|
+
cy.intercept('GET', '/rest/graphdb-settings/license', (req) => req.continue()).as('get-license');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
static stubLicenseUnauthorized() {
|
|
15
|
+
cy.intercept('GET', '/rest/graphdb-settings/license', {statusCode: 401}).as('unauthorizedLicense');
|
|
16
|
+
}
|
|
17
|
+
|
|
7
18
|
static stubFreeLicense() {
|
|
8
19
|
cy.intercept('GET', '/rest/graphdb-settings/license', {
|
|
9
20
|
statusCode: 200,
|
|
@@ -50,7 +61,6 @@ export class LicenseStubs {
|
|
|
50
61
|
"productType": "enterprise",
|
|
51
62
|
"licenseCapabilities": [
|
|
52
63
|
"Lucene connector",
|
|
53
|
-
"Solr connector",
|
|
54
64
|
"Elasticsearch connector",
|
|
55
65
|
"OpenSearch connector",
|
|
56
66
|
"Kafka connector",
|
|
@@ -114,7 +124,6 @@ export class LicenseStubs {
|
|
|
114
124
|
"OpenSearch connector",
|
|
115
125
|
"Lucene connector",
|
|
116
126
|
"Kafka connector",
|
|
117
|
-
"Solr connector",
|
|
118
127
|
"Cluster",
|
|
119
128
|
"Elasticsearch connector"
|
|
120
129
|
],
|
|
@@ -140,7 +149,6 @@ export class LicenseStubs {
|
|
|
140
149
|
"OpenSearch connector",
|
|
141
150
|
"Lucene connector",
|
|
142
151
|
"Kafka connector",
|
|
143
|
-
"Solr connector",
|
|
144
152
|
"Cluster",
|
|
145
153
|
"Elasticsearch connector"
|
|
146
154
|
],
|
|
@@ -3,6 +3,14 @@ import {REPOSITORIES_URL} from '../../support/repository-commands';
|
|
|
3
3
|
import {GlobalOperationsStatusesStub} from '../global-operations-statuses-stub.js';
|
|
4
4
|
import repoTemplate from "../../fixtures/repo-template.json";
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Returns the pattern that matches the request for the size of a repository, on any host and with any query.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} repositoryId The id of the repository.
|
|
10
|
+
* @return {string} The pattern.
|
|
11
|
+
*/
|
|
12
|
+
const getRepositorySizeUrl = (repositoryId) => `**${REPOSITORIES_URL}/${repositoryId}/size*`;
|
|
13
|
+
|
|
6
14
|
export class RepositoriesStubs extends Stubs {
|
|
7
15
|
static stubRepositories(withDelay = 0, fixture = '/repositories/get-repositories.json') {
|
|
8
16
|
RepositoriesStubs.stubGetQueryResponse('/rest/repositories/all', fixture, 'get-all-repositories', withDelay);
|
|
@@ -20,6 +28,42 @@ export class RepositoriesStubs extends Stubs {
|
|
|
20
28
|
cy.intercept('GET', '/rest/locations/active').as('getActiveLocations');
|
|
21
29
|
}
|
|
22
30
|
|
|
31
|
+
static spyGetRepository(id) {
|
|
32
|
+
cy.intercept(`GET`, `${REPOSITORIES_URL}/${id}?location=`).as('getRepository');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Spies on the request for the size of a repository, without changing its response.
|
|
37
|
+
*
|
|
38
|
+
* @param {string} repositoryId The id of the repository.
|
|
39
|
+
* @param {string} alias The alias of the request, to wait for it with <code>cy.wait('@alias')</code>.
|
|
40
|
+
*/
|
|
41
|
+
static spyGetRepositorySize(repositoryId, alias = 'getRepositorySize') {
|
|
42
|
+
cy.intercept('GET', getRepositorySizeUrl(repositoryId)).as(alias);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Records the requests for the size of a repository in a spy, without changing their response. Use it to check
|
|
47
|
+
* that the size was not requested: <code>cy.get('@alias').should('not.have.been.called')</code>.
|
|
48
|
+
*
|
|
49
|
+
* @param {string} repositoryId The id of the repository.
|
|
50
|
+
* @param {string} alias The alias of the spy.
|
|
51
|
+
*/
|
|
52
|
+
static spyGetRepositorySizeCalls(repositoryId, alias = 'getRepositorySizeCalls') {
|
|
53
|
+
cy.intercept('GET', getRepositorySizeUrl(repositoryId), cy.spy().as(alias));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Makes the request for the size of a repository fail with a server error.
|
|
58
|
+
*
|
|
59
|
+
* @param {string} repositoryId The id of the repository.
|
|
60
|
+
* @param {string} alias The alias of the request, to wait for it with <code>cy.wait('@alias')</code>.
|
|
61
|
+
*/
|
|
62
|
+
static stubGetRepositorySizeError(repositoryId, alias = 'getRepositorySizeError') {
|
|
63
|
+
cy.intercept('GET', getRepositorySizeUrl(repositoryId),
|
|
64
|
+
{statusCode: 500, body: 'Internal Server Error'}).as(alias);
|
|
65
|
+
}
|
|
66
|
+
|
|
23
67
|
static stubLocations(withDelay = 0) {
|
|
24
68
|
RepositoriesStubs.stubQueryResponse('/rest/locations', '/repositories/get-locations.json', 'get-locations', withDelay);
|
|
25
69
|
}
|
|
@@ -225,6 +225,11 @@ export class QueryStubs {
|
|
|
225
225
|
static interceptSavedQueryCreation() {
|
|
226
226
|
cy.intercept('POST', '/rest/sparql/saved-queries').as('saveQuery');
|
|
227
227
|
}
|
|
228
|
+
|
|
229
|
+
static spyAbortQuery() {
|
|
230
|
+
cy.intercept('DELETE', /\/rest\/monitor\/repository\/[^/]+\/query\?query=yasgui-component-.*/)
|
|
231
|
+
.as('abortQuery');
|
|
232
|
+
}
|
|
228
233
|
}
|
|
229
234
|
|
|
230
235
|
export class QueryStubDescription {
|
|
@@ -19,6 +19,25 @@ Cypress.Commands.add('searchEasyVisualGraph', (searchGraph) => {
|
|
|
19
19
|
});
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
+
Cypress.Commands.add('createGraphConfig', (name, repositoryId, secured = false) => {
|
|
23
|
+
let headers = {'Content-Type': 'application/json', 'X-GraphDB-Repository': repositoryId};
|
|
24
|
+
if (secured) {
|
|
25
|
+
headers = {...headers, 'Authorization': Cypress.env('adminToken')};
|
|
26
|
+
}
|
|
27
|
+
return cy.request({
|
|
28
|
+
method: 'POST',
|
|
29
|
+
url: GRAPH_CONFIG_URL,
|
|
30
|
+
headers,
|
|
31
|
+
body: {
|
|
32
|
+
name,
|
|
33
|
+
startMode: 'search',
|
|
34
|
+
startQueryIncludeInferred: true,
|
|
35
|
+
startQuerySameAs: true,
|
|
36
|
+
shared: false
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
22
41
|
Cypress.Commands.add('deleteGraphConfig', (name) => {
|
|
23
42
|
cy.request({
|
|
24
43
|
method: 'GET',
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import HomeSteps from '../../../steps/home-steps.js';
|
|
2
|
-
import {DeprecationSteps} from '../../../steps/deprecation-steps.js';
|
|
3
|
-
import {LoginSteps} from '../../../steps/login-steps.js';
|
|
4
|
-
import {GuidesStubs} from '../../../stubs/guides/guides-stubs.js';
|
|
5
|
-
import {GuideSteps} from '../../../steps/guides/guide-steps.js';
|
|
6
|
-
import {GuideDialogSteps} from '../../../steps/guides/guide-dialog-steps.js';
|
|
7
|
-
|
|
8
|
-
describe('Solr deprecation banner', () => {
|
|
9
|
-
context('Security disabled', () => {
|
|
10
|
-
it('should keep the Solr deprecation banner hidden after the anonymous user dismisses it', () => {
|
|
11
|
-
// GIVEN: I have opened the application with security disabled.
|
|
12
|
-
HomeSteps.visit();
|
|
13
|
-
|
|
14
|
-
// THEN: I expect the Solr deprecation banner to be visible.
|
|
15
|
-
DeprecationSteps.getDeprecationBanner()
|
|
16
|
-
.should('be.visible')
|
|
17
|
-
.should('contain.text', 'The Solr connector is deprecated and will be removed in GraphDB 12');
|
|
18
|
-
|
|
19
|
-
// WHEN: I dismiss the Solr deprecation banner.
|
|
20
|
-
DeprecationSteps.closeBanner();
|
|
21
|
-
// THEN: I expect the Solr deprecation banner to be hidden.
|
|
22
|
-
DeprecationSteps.getDeprecationBanner().should('not.exist');
|
|
23
|
-
|
|
24
|
-
// WHEN: I reload the application.
|
|
25
|
-
HomeSteps.visit();
|
|
26
|
-
// THEN: I expect the Solr deprecation banner to remain hidden.
|
|
27
|
-
DeprecationSteps.getDeprecationBanner().should('not.exist');
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
context('Security enabled', () => {
|
|
32
|
-
const PASSWORD = 'root';
|
|
33
|
-
const USER_USERNAME = 'username';
|
|
34
|
-
|
|
35
|
-
beforeEach(() => {
|
|
36
|
-
cy.createUser({
|
|
37
|
-
username: USER_USERNAME,
|
|
38
|
-
password: PASSWORD
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
cy.switchOnSecurity()
|
|
42
|
-
.then(() => cy.loginAsAdmin())
|
|
43
|
-
.then(() => cy.switchOnFreeAccess(true));
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
afterEach(() => {
|
|
47
|
-
cy.loginAsAdmin()
|
|
48
|
-
.then(() => {
|
|
49
|
-
cy.deleteUser(USER_USERNAME, true);
|
|
50
|
-
cy.switchOffFreeAccess(true);
|
|
51
|
-
cy.switchOffSecurity(true);
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('should persist separate Solr banner states for anonymous and logged-in users', () => {
|
|
56
|
-
// GIVEN: Security and free access are enabled, and no user is logged in.
|
|
57
|
-
HomeSteps.visit();
|
|
58
|
-
|
|
59
|
-
// THEN: I expect the Solr deprecation banner to be visible for the anonymous user.
|
|
60
|
-
DeprecationSteps.getDeprecationBanner()
|
|
61
|
-
.should('be.visible')
|
|
62
|
-
.should('contain.text', 'The Solr connector is deprecated and will be removed in GraphDB 12');
|
|
63
|
-
|
|
64
|
-
// WHEN: The anonymous user dismisses the banner.
|
|
65
|
-
DeprecationSteps.closeBanner();
|
|
66
|
-
// THEN: I expect the banner to be hidden for the anonymous user.
|
|
67
|
-
DeprecationSteps.getDeprecationBanner().should('not.exist');
|
|
68
|
-
|
|
69
|
-
// WHEN: I log in as a user who has not dismissed the banner.
|
|
70
|
-
cy.loginAs(USER_USERNAME, PASSWORD);
|
|
71
|
-
HomeSteps.visit();
|
|
72
|
-
|
|
73
|
-
// THEN: I expect the banner to be visible for the logged-in user.
|
|
74
|
-
DeprecationSteps.getDeprecationBanner()
|
|
75
|
-
.should('be.visible')
|
|
76
|
-
.should('contain.text', 'The Solr connector is deprecated and will be removed in GraphDB 12');
|
|
77
|
-
|
|
78
|
-
// WHEN: The logged-in user dismisses the banner.
|
|
79
|
-
DeprecationSteps.closeBanner();
|
|
80
|
-
// THEN: I expect the banner to be hidden for the logged-in user.
|
|
81
|
-
DeprecationSteps.getDeprecationBanner().should('not.exist');
|
|
82
|
-
|
|
83
|
-
// WHEN: The user logs out.
|
|
84
|
-
LoginSteps.logout();
|
|
85
|
-
// THEN: I expect the banner to remain hidden because the anonymous user has already dismissed it.
|
|
86
|
-
DeprecationSteps.getDeprecationBanner().should('not.exist');
|
|
87
|
-
|
|
88
|
-
// WHEN: I log in as the administrator, who has not dismissed the banner.
|
|
89
|
-
cy.loginAs('admin', 'root');
|
|
90
|
-
HomeSteps.visit();
|
|
91
|
-
// THEN: I expect the banner to be visible for the administrator.
|
|
92
|
-
DeprecationSteps.getDeprecationBanner()
|
|
93
|
-
.should('be.visible')
|
|
94
|
-
.should('contain.text', 'The Solr connector is deprecated and will be removed in GraphDB 12');
|
|
95
|
-
|
|
96
|
-
// WHEN: The administrator logs out.
|
|
97
|
-
LoginSteps.logout();
|
|
98
|
-
// THEN: I expect the banner to remain hidden because the anonymous user has already dismissed it.
|
|
99
|
-
DeprecationSteps.getDeprecationBanner().should('not.exist');
|
|
100
|
-
|
|
101
|
-
// WHEN: I log in again as the user who previously dismissed the banner.
|
|
102
|
-
cy.loginAs(USER_USERNAME, PASSWORD);
|
|
103
|
-
HomeSteps.visit();
|
|
104
|
-
// THEN: I expect the banner to remain hidden for the logged-in user.
|
|
105
|
-
DeprecationSteps.getDeprecationBanner().should('not.exist');
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
context('User guides', () => {
|
|
110
|
-
it('should hide the Solr deprecation banner while a guide is running', () => {
|
|
111
|
-
// GIVEN: The guides are loaded and ready to be started.
|
|
112
|
-
GuidesStubs.stubMainMenuGuide();
|
|
113
|
-
GuideSteps.visit();
|
|
114
|
-
GuideSteps.verifyGuidesListExists();
|
|
115
|
-
cy.wait('@getGuides');
|
|
116
|
-
|
|
117
|
-
// WHEN: I am on an application page, and the Solr deprecation banner has not been dismissed by the current user.
|
|
118
|
-
// THEN: I expect the Solr deprecation banner to be visible because it has not been dismissed by the current user.
|
|
119
|
-
DeprecationSteps.getDeprecationBanner()
|
|
120
|
-
.should('be.visible')
|
|
121
|
-
.should('contain.text', 'The Solr connector is deprecated and will be removed in GraphDB 12');
|
|
122
|
-
|
|
123
|
-
// WHEN: I start a guide.
|
|
124
|
-
GuideSteps.runFirstGuide();
|
|
125
|
-
// THEN: I expect the Solr deprecation banner to be hidden while the guide is running.
|
|
126
|
-
DeprecationSteps.getDeprecationBanner().should('not.exist');
|
|
127
|
-
|
|
128
|
-
// WHEN: I cancel the guide.
|
|
129
|
-
GuideDialogSteps.clickOnCancelButton();
|
|
130
|
-
GuideDialogSteps.clickConfirmCancelDialogExitButton();
|
|
131
|
-
// THEN: I expect the Solr deprecation banner to be visible again.
|
|
132
|
-
DeprecationSteps.getDeprecationBanner()
|
|
133
|
-
.should('be.visible')
|
|
134
|
-
.should('contain.text', 'The Solr connector is deprecated and will be removed in GraphDB 12');
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
@prefix ex: <http://example.com/> .
|
|
2
|
-
@prefix dct: <http://purl.org/dc/terms/> .
|
|
3
|
-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
4
|
-
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
5
|
-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
graph ex:rdfstar {
|
|
9
|
-
ex:bob foaf:knows << ex:alice foaf:knows<<ex:bob dct:created ex:book>> >> .
|
|
10
|
-
|
|
11
|
-
<<<< ex:bob dct:created ex:book >> foaf:knows ex:alice >> dct:source ex:otherbook .
|
|
12
|
-
|
|
13
|
-
ex:bobshomepage dct:source<< ex:book dct:creator ex:alice >> .
|
|
14
|
-
|
|
15
|
-
<< ex:book dct:creator ex:alice >> dct:source ex:bobshomepage .
|
|
16
|
-
|
|
17
|
-
<< ex:book dct:creator ex:alice >> dct:requires << ex:alice dct:created ex:book >> .
|
|
18
|
-
|
|
19
|
-
<<<http://example.org/a>ex:b ex:c>>ex:valid "1999-08-16"^^xsd:date .
|
|
20
|
-
|
|
21
|
-
<< # Start of triple
|
|
22
|
-
ex:bob # triple subject
|
|
23
|
-
foaf:birthday # triple predicate
|
|
24
|
-
"1908-03-18"^^xsd:date # triple object
|
|
25
|
-
>> # end of triple
|
|
26
|
-
dct:source ex:bobshomepage .
|
|
27
|
-
|
|
28
|
-
<< ex:book dct:title "Example book"@en >> dct:source ex:bobshomepage .
|
|
29
|
-
<< ex:book dct:title "Beispielbuch"@de>> dct:source ex:bobshomepage.
|
|
30
|
-
<< ex:book dct:title "Example Book"@en-US>> dct:source ex:bobshomepage.
|
|
31
|
-
|
|
32
|
-
}
|