graphdb-workbench-tests 3.5.3 → 4.0.0-RC1
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-guides.config.js +45 -0
- 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/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 +520 -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 +27 -32
- package/e2e-legacy/guides/ttyg/edit-agent/edit-ttyg-agent-guide.spec.js +12 -20
- package/e2e-legacy/help/rest-api-documentatio/rest-api-documentation-theme.spec.js +50 -0
- 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 +83 -23
- 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-user-data.spec.js +8 -8
- package/e2e-legacy/import/import-view.spec.js +2 -2
- package/e2e-legacy/import/initial-state/import-page-with-selected-repositor.js +1 -1
- package/e2e-legacy/import/initial-state/import-page-with-selected-repository-without-imported-files.js +1 -1
- package/e2e-legacy/monitor/global-operation-statuses-component.spec.js +13 -17
- package/e2e-legacy/monitor/query-and-updates/queries-and-updates-with-repository.spec.js +16 -0
- 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 +129 -0
- package/e2e-legacy/repository/repositories.spec.js +27 -10
- 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 -24
- package/e2e-legacy/sparql-editor/actions/expand-results-over-sameas.spec.js +8 -8
- package/e2e-legacy/sparql-editor/actions/include-inferred-statements.spec.js +4 -4
- package/e2e-legacy/sparql-editor/actions/inferred-sameas.spec.js +2 -2
- 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 +16 -1
- package/e2e-legacy/ttyg/chat-panel.spec.js +14 -0
- package/e2e-legacy/ttyg/chat-template-injection.spec.js +49 -0
- package/e2e-legacy/ttyg/create-chat.spec.js +1 -1
- package/e2e-legacy/ttyg/delete-agent.spec.js +14 -0
- package/e2e-legacy/ttyg/edit-agent.spec.js +8 -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/repository/url-with-repository-id-parameter.spec.js +17 -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/eslint.config.js +5 -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/fixtures/monitoring/get-active-queries-cluster-replicating.json +15 -0
- package/fixtures/ttyg/agent/get-agent-list-with-html-in-names.json +77 -0
- package/fixtures/ttyg/chats/get-chat-list-with-html-in-name.json +22 -0
- package/fixtures/ttyg/chats/get-chat-with-template-injection.json +27 -0
- package/npm-shrinkwrap.json +1264 -1265
- package/package.json +12 -2
- package/steps/application-steps.js +4 -0
- package/steps/base-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 +159 -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 +94 -23
- package/steps/import/import-test-constants.js +1 -1
- package/steps/import/import-user-data-steps.js +26 -26
- 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/monitoring/queries-and-updates-steps.js +9 -0
- 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 +64 -9
- package/steps/resource/resource-steps.js +76 -9
- package/steps/rest-api-documentation-steps.js +23 -0
- package/steps/setup/acl-management-steps.js +4 -24
- package/steps/setup/settings-steps.js +42 -0
- package/steps/toaster-steps.js +4 -0
- package/steps/ttyg/chat-panel-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 +5 -7
- package/steps/yasgui/yasr-steps.js +8 -0
- package/stubs/browser-stubs.js +40 -0
- package/stubs/graph-navigator-stubs.js +28 -0
- package/stubs/license-stubs.js +11 -3
- package/stubs/monitoring/queries-and-updates-stubs.js +5 -0
- package/stubs/repositories/repositories-stubs.js +44 -0
- package/stubs/ttyg/ttyg-stubs.js +3 -2
- package/stubs/yasgui/query-stubs.js +5 -0
- package/support/repository-commands.js +15 -0
- package/support/sparql-commands.js +2 -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
|
@@ -190,7 +190,7 @@ export class AclManagementSteps {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
static getWarningIcon(index) {
|
|
193
|
-
return this.getSavedRoleField(index).
|
|
193
|
+
return this.getSavedRoleField(index).find('.ri-alert-line');
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
static getWarningIconTooltipText(index) {
|
|
@@ -357,7 +357,7 @@ export class AclManagementSteps {
|
|
|
357
357
|
}
|
|
358
358
|
|
|
359
359
|
static checkIfRuleSavingIsForbidden(index) {
|
|
360
|
-
AclManagementSteps.getSaveRuleButton(index).should('
|
|
360
|
+
AclManagementSteps.getSaveRuleButton(index).should('be.visible');
|
|
361
361
|
AclManagementSteps.getSaveRuleDisabledButton(index).should('be.disabled');
|
|
362
362
|
}
|
|
363
363
|
|
|
@@ -388,16 +388,6 @@ export const ACL_VIEW = [
|
|
|
388
388
|
"object": "*",
|
|
389
389
|
"context": "*"
|
|
390
390
|
},
|
|
391
|
-
{
|
|
392
|
-
"scope": "statement",
|
|
393
|
-
"policy": "deny",
|
|
394
|
-
"role": "ROLE3",
|
|
395
|
-
"operation": "read",
|
|
396
|
-
"subject": "<<<http://example.com/test> <http://www.w3.org/2000/01/rdf-schema#label> \"test aber auf Deutsch\"@de>>",
|
|
397
|
-
"predicate": "*",
|
|
398
|
-
"object": "\"test aber auf Deutsch\"@en",
|
|
399
|
-
"context": "<http://example.com/graph1>"
|
|
400
|
-
},
|
|
401
391
|
{
|
|
402
392
|
"scope": "statement",
|
|
403
393
|
"policy": "allow",
|
|
@@ -415,7 +405,7 @@ export const ACL_VIEW = [
|
|
|
415
405
|
"operation": "write",
|
|
416
406
|
"subject": "<urn:Cat>",
|
|
417
407
|
"predicate": "*",
|
|
418
|
-
"object": "
|
|
408
|
+
"object": "<<( <http://example.com/test> <http://www.w3.org/2000/01/rdf-schema#label> \"test aber auf Deutsch\"@de )>>",
|
|
419
409
|
"context": "*"
|
|
420
410
|
}
|
|
421
411
|
];
|
|
@@ -440,16 +430,6 @@ export const ACL = [
|
|
|
440
430
|
"object": "*",
|
|
441
431
|
"context": "*"
|
|
442
432
|
},
|
|
443
|
-
{
|
|
444
|
-
"scope": "statement",
|
|
445
|
-
"policy": "deny",
|
|
446
|
-
"role": "CUSTOM_ROLE3",
|
|
447
|
-
"operation": "read",
|
|
448
|
-
"subject": "<<<http://example.com/test> <http://www.w3.org/2000/01/rdf-schema#label> \"test aber auf Deutsch\"@de>>",
|
|
449
|
-
"predicate": "*",
|
|
450
|
-
"object": "\"test aber auf Deutsch\"@en",
|
|
451
|
-
"context": "<http://example.com/graph1>"
|
|
452
|
-
},
|
|
453
433
|
{
|
|
454
434
|
"scope": "statement",
|
|
455
435
|
"policy": "allow",
|
|
@@ -467,7 +447,7 @@ export const ACL = [
|
|
|
467
447
|
"operation": "write",
|
|
468
448
|
"subject": "<urn:Cat>",
|
|
469
449
|
"predicate": "*",
|
|
470
|
-
"object": "
|
|
450
|
+
"object": "<<( <http://example.com/test> <http://www.w3.org/2000/01/rdf-schema#label> \"test aber auf Deutsch\"@de )>>",
|
|
471
451
|
"context": "*"
|
|
472
452
|
}
|
|
473
453
|
];
|
|
@@ -29,6 +29,10 @@ export class SettingsSteps {
|
|
|
29
29
|
return this.getSettingsPage().find('.login-credentials')
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
static getUsernameLabel() {
|
|
33
|
+
return this.getLoginPanel().find('label[for="wb-user-username"]');
|
|
34
|
+
}
|
|
35
|
+
|
|
32
36
|
static getPasswordField() {
|
|
33
37
|
return this.getLoginPanel().find('#wb-user-password:password');
|
|
34
38
|
}
|
|
@@ -62,6 +66,24 @@ export class SettingsSteps {
|
|
|
62
66
|
return this.getSparqlEditorPanel().find('.inference-label');
|
|
63
67
|
}
|
|
64
68
|
|
|
69
|
+
static getSchemaToggle() {
|
|
70
|
+
return this.getSparqlEditorPanel()
|
|
71
|
+
.find('#schema-on')
|
|
72
|
+
.find('.switch:checkbox');
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
static getSameAsToggleLabel() {
|
|
76
|
+
return this.getSparqlEditorPanel().find('label[for="sameAsCheck"]');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
static getInferenceToggleLabel() {
|
|
80
|
+
return this.getSparqlEditorPanel().find('label[for="inferenceCheck"]');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
static getSchemaToggleLabel() {
|
|
84
|
+
return this.getSparqlEditorPanel().find('label[for="schemaCheck"]');
|
|
85
|
+
}
|
|
86
|
+
|
|
65
87
|
static getCountCheckbox() {
|
|
66
88
|
return this.getSparqlEditorPanel().find('#defaultCount:checkbox');
|
|
67
89
|
}
|
|
@@ -94,6 +116,26 @@ export class SettingsSteps {
|
|
|
94
116
|
return this.getSettingsPage().find('.user-repositories .table');
|
|
95
117
|
}
|
|
96
118
|
|
|
119
|
+
static getAnyRepositoryRow() {
|
|
120
|
+
return this.getUserRepositoryTable().find('.any-repo');
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
static getAnyRepositoryReadCheckbox() {
|
|
124
|
+
return this.getAnyRepositoryRow().find('.read:checkbox');
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
static getAnyRepositoryWriteCheckbox() {
|
|
128
|
+
return this.getAnyRepositoryRow().find('.write:checkbox');
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
static getAnyRepositoryMaintainCheckbox() {
|
|
132
|
+
return this.getAnyRepositoryRow().find('.maintain-repository:checkbox');
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
static getAnyRepositoryGraphqlCheckbox() {
|
|
136
|
+
return this.getAnyRepositoryRow().find('.graphql:checkbox');
|
|
137
|
+
}
|
|
138
|
+
|
|
97
139
|
static getRepositoryRightsRows() {
|
|
98
140
|
return this.getUserRepositoryTable().getByTestId('repository-rights-rows');
|
|
99
141
|
}
|
package/steps/toaster-steps.js
CHANGED
|
@@ -86,6 +86,10 @@ export class ChatPanelSteps extends BaseSteps {
|
|
|
86
86
|
return ChatPanelSteps.getCopyToClipboardElements().eq(index);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
static openInSparqlEditor(index = 0) {
|
|
90
|
+
ChatPanelSteps.getOpenInSparqlEditorElement(index).find(ChatPanelSteps.buildTestIdAttr('open-in-sparql-editor-btn')).click();
|
|
91
|
+
}
|
|
92
|
+
|
|
89
93
|
static getCancelButton() {
|
|
90
94
|
return ChatPanelSteps.getChatPanel().find('.cancel-ask-button');
|
|
91
95
|
}
|
|
@@ -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() {
|
|
@@ -203,12 +205,8 @@ export class YasqeSteps {
|
|
|
203
205
|
return YasqeSteps.getEditor().find('.yasqe_buttons');
|
|
204
206
|
}
|
|
205
207
|
|
|
206
|
-
static
|
|
207
|
-
return YasqeSteps.
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
static getActionButtonTooltip(index) {
|
|
211
|
-
return YasqeSteps.getActionButtonsTooltips().eq(index);
|
|
208
|
+
static getActionButtonTooltip(buttonIndex) {
|
|
209
|
+
return YasqeSteps.getActionButton(buttonIndex).closest('yasgui-tooltip');
|
|
212
210
|
}
|
|
213
211
|
|
|
214
212
|
static getActionButtons() {
|
|
@@ -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
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
// The lookup query may declare a dataset (e.g. `FROM onto:explicit`) between the projection and `WHERE`.
|
|
23
|
+
if (/SELECT \?inst \?class \?label\s+(FROM\s+\S+\s+)*WHERE/.test(body) && body.includes(text)) {
|
|
24
|
+
req.alias = 'entity-lookup';
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
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
|
}
|
package/stubs/ttyg/ttyg-stubs.js
CHANGED
|
@@ -29,9 +29,10 @@ export class TTYGStubs extends Stubs {
|
|
|
29
29
|
* Loads the specified <code>fixture</code> and updates the chatId in the fixture with the actual ID passed in the endpoint call.
|
|
30
30
|
*
|
|
31
31
|
* @param {number} delay - Optional delay in milliseconds before responding with the fixture.
|
|
32
|
+
* @param {string} fixture - Optional fixture with the chats, keyed by chat ID.
|
|
32
33
|
*/
|
|
33
|
-
static stubChatGet(delay = 0) {
|
|
34
|
-
cy.fixture(
|
|
34
|
+
static stubChatGet(delay = 0, fixture = '/ttyg/chats/get-chat.json') {
|
|
35
|
+
cy.fixture(fixture).then((body) => {
|
|
35
36
|
cy.intercept({
|
|
36
37
|
method: 'GET',
|
|
37
38
|
url: '/rest/chat/conversations/*'
|
|
@@ -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,21 @@ Cypress.Commands.add('createRepository', (options = {}) => {
|
|
|
19
19
|
});
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Reads a repository config through the REST API.
|
|
24
|
+
* @param {string} id the repository id
|
|
25
|
+
* @return the repository config, e.g. {id, params: {ruleset: {value}}}
|
|
26
|
+
*/
|
|
27
|
+
Cypress.Commands.add('getRepositoryConfig', (id) => {
|
|
28
|
+
return cy.request({
|
|
29
|
+
method: 'GET',
|
|
30
|
+
url: REPOSITORIES_URL + '/' + id,
|
|
31
|
+
headers: {
|
|
32
|
+
'Accept': 'application/json'
|
|
33
|
+
}
|
|
34
|
+
}).its('body');
|
|
35
|
+
});
|
|
36
|
+
|
|
22
37
|
Cypress.Commands.add('deleteRepository', (id, secured = false) => {
|
|
23
38
|
// unset the repository before delete to avoid missing repo errors
|
|
24
39
|
unsetRepository();
|
|
@@ -68,6 +68,8 @@ Cypress.Commands.add('pasteIntoCodeMirror', (selector, text) => {
|
|
|
68
68
|
});
|
|
69
69
|
event.clipboardData.setData('text/plain', text);
|
|
70
70
|
|
|
71
|
+
// CodeMirror ignores a paste while the editor is not focused, and the editor no longer takes the focus on load.
|
|
72
|
+
codeMirror.focus();
|
|
71
73
|
const inputField = codeMirror.getInputField();
|
|
72
74
|
inputField.dispatchEvent(event);
|
|
73
75
|
});
|
|
@@ -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',
|