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
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import {AclManagementSteps} from "../../../steps/setup/acl-management-steps";
|
|
2
|
+
import {ApplicationSteps} from "../../../steps/application-steps";
|
|
3
|
+
|
|
4
|
+
describe('ACL Management: IRI validation', () => {
|
|
5
|
+
|
|
6
|
+
let repositoryId;
|
|
7
|
+
|
|
8
|
+
afterEach(() => {
|
|
9
|
+
cy.deleteRepository(repositoryId);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
repositoryId = 'acl-management-' + Date.now();
|
|
14
|
+
cy.createRepository({id: repositoryId});
|
|
15
|
+
cy.presetRepository(repositoryId);
|
|
16
|
+
cy.initializeRepository(repositoryId);
|
|
17
|
+
cy.enableAutocomplete(repositoryId);
|
|
18
|
+
AclManagementSteps.visit();
|
|
19
|
+
ApplicationSteps.getLoader().should('not.exist');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Fills in all the fields required for the rule to be otherwise valid, except the subject,
|
|
24
|
+
* so that only the subject's own validity determines whether the rule can be saved.
|
|
25
|
+
* @param {number} index
|
|
26
|
+
*/
|
|
27
|
+
const fillMandatoryFieldsExceptSubject = (index) => {
|
|
28
|
+
AclManagementSteps.fillRole(index, 'ROLE1');
|
|
29
|
+
AclManagementSteps.selectPolicy(index, 'allow');
|
|
30
|
+
AclManagementSteps.selectOperation(index, 'write');
|
|
31
|
+
AclManagementSteps.fillPredicate(index, '*');
|
|
32
|
+
AclManagementSteps.fillObject(index, '*');
|
|
33
|
+
AclManagementSteps.fillContext(index, '*');
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
it('should mark the subject field as invalid and block saving when an absolute http IRI is typed without angle brackets', () => {
|
|
37
|
+
// When I create a new rule and type an absolute http IRI without wrapping it in angle brackets
|
|
38
|
+
AclManagementSteps.addRuleInBeginning();
|
|
39
|
+
fillMandatoryFieldsExceptSubject(0);
|
|
40
|
+
AclManagementSteps.fillSubject(0, 'http://example.com/John');
|
|
41
|
+
|
|
42
|
+
// Then I expect the field to be marked as invalid
|
|
43
|
+
AclManagementSteps.getSubjectField(0).should('have.class', 'invalid');
|
|
44
|
+
// And I expect saving the rule to be forbidden
|
|
45
|
+
AclManagementSteps.checkIfRuleSavingIsForbidden(0);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('should mark the subject field as valid and allow saving once the http IRI is wrapped in angle brackets', () => {
|
|
49
|
+
// When I create a new rule and type a properly wrapped absolute http IRI
|
|
50
|
+
AclManagementSteps.addRuleInBeginning();
|
|
51
|
+
fillMandatoryFieldsExceptSubject(0);
|
|
52
|
+
AclManagementSteps.fillSubject(0, '<http://example.com/John>');
|
|
53
|
+
|
|
54
|
+
// Then I expect the field to be marked as valid
|
|
55
|
+
AclManagementSteps.getSubjectField(0).should('not.have.class', 'invalid');
|
|
56
|
+
// And I expect saving the rule to be allowed
|
|
57
|
+
AclManagementSteps.checkIfRuleSavingIsAllowed(0);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('should mark the subject field as invalid for a urn IRI without angle brackets and valid once wrapped', () => {
|
|
61
|
+
// When I create a new rule and type a urn IRI without angle brackets
|
|
62
|
+
AclManagementSteps.addRuleInBeginning();
|
|
63
|
+
fillMandatoryFieldsExceptSubject(0);
|
|
64
|
+
AclManagementSteps.fillSubject(0, 'urn:John');
|
|
65
|
+
|
|
66
|
+
// Then I expect the field to be marked as invalid
|
|
67
|
+
AclManagementSteps.getSubjectField(0).should('have.class', 'invalid');
|
|
68
|
+
AclManagementSteps.checkIfRuleSavingIsForbidden(0);
|
|
69
|
+
|
|
70
|
+
// When I wrap the same urn IRI in angle brackets
|
|
71
|
+
AclManagementSteps.fillSubject(0, '<urn:John>');
|
|
72
|
+
|
|
73
|
+
// Then I expect the field to become valid
|
|
74
|
+
AclManagementSteps.getSubjectField(0).should('not.have.class', 'invalid');
|
|
75
|
+
AclManagementSteps.checkIfRuleSavingIsAllowed(0);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('should keep the wildcard (*) value valid', () => {
|
|
79
|
+
// When I create a new rule and use the wildcard value for the subject
|
|
80
|
+
AclManagementSteps.addRuleInBeginning();
|
|
81
|
+
fillMandatoryFieldsExceptSubject(0);
|
|
82
|
+
AclManagementSteps.fillSubject(0, '*');
|
|
83
|
+
|
|
84
|
+
// Then I expect the field to remain valid
|
|
85
|
+
AclManagementSteps.getSubjectField(0).should('not.have.class', 'invalid');
|
|
86
|
+
AclManagementSteps.checkIfRuleSavingIsAllowed(0);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('should still query autocomplete suggestions for an absolute IRI typed without angle brackets', () => {
|
|
90
|
+
// Given I intercept the autocomplete suggestions requests
|
|
91
|
+
cy.intercept('GET', '**/rest/autocomplete/query*').as('autocompleteQuery');
|
|
92
|
+
|
|
93
|
+
// When I create a new rule and type an absolute http IRI without angle brackets
|
|
94
|
+
AclManagementSteps.addRuleInBeginning();
|
|
95
|
+
fillMandatoryFieldsExceptSubject(0);
|
|
96
|
+
AclManagementSteps.fillSubject(0, 'http://example.com/resource/John');
|
|
97
|
+
|
|
98
|
+
// Then I expect the autocomplete request to still be triggered, searching only by the
|
|
99
|
+
// local name within the detected namespace (namespace and local name joined by ";")
|
|
100
|
+
cy.wait('@autocompleteQuery');
|
|
101
|
+
cy.get('@autocompleteQuery.all').then((interceptions) => {
|
|
102
|
+
const lastCall = interceptions[interceptions.length - 1];
|
|
103
|
+
const url = new URL(lastCall.request.url);
|
|
104
|
+
expect(url.searchParams.get('q')).to.eq('http://example.com/resource/;John');
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it('should reject a triple term value for a plain field validated only as an IRI', () => {
|
|
109
|
+
// Predicate only allows validate-uri/validate-default-value, so a triple term is not a valid value there
|
|
110
|
+
AclManagementSteps.addRuleInBeginning();
|
|
111
|
+
AclManagementSteps.fillRole(0, 'ROLE1');
|
|
112
|
+
AclManagementSteps.selectPolicy(0, 'allow');
|
|
113
|
+
AclManagementSteps.selectOperation(0, 'write');
|
|
114
|
+
AclManagementSteps.fillSubject(0, '*');
|
|
115
|
+
AclManagementSteps.fillObject(0, '*');
|
|
116
|
+
AclManagementSteps.fillContext(0, '*');
|
|
117
|
+
AclManagementSteps.fillPredicate(0, '<<(<http://example.com/a> <http://example.com/b> "c")>>');
|
|
118
|
+
|
|
119
|
+
AclManagementSteps.getPredicateField(0).should('have.class', 'invalid');
|
|
120
|
+
AclManagementSteps.checkIfRuleSavingIsForbidden(0);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it('should accept a triple term value for the object field, where it is allowed', () => {
|
|
124
|
+
// Only the object field is configured with validate-triple-term-value="true"
|
|
125
|
+
AclManagementSteps.addRuleInBeginning();
|
|
126
|
+
AclManagementSteps.fillRole(0, 'ROLE1');
|
|
127
|
+
AclManagementSteps.selectPolicy(0, 'allow');
|
|
128
|
+
AclManagementSteps.selectOperation(0, 'write');
|
|
129
|
+
AclManagementSteps.fillSubject(0, '*');
|
|
130
|
+
AclManagementSteps.fillPredicate(0, '*');
|
|
131
|
+
AclManagementSteps.fillContext(0, '*');
|
|
132
|
+
AclManagementSteps.fillObject(0, '<<(<http://example.com/a> <http://example.com/b> "c")>>');
|
|
133
|
+
|
|
134
|
+
AclManagementSteps.getObjectField(0).should('not.have.class', 'invalid');
|
|
135
|
+
AclManagementSteps.checkIfRuleSavingIsAllowed(0);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
it('should reject a malformed triple term value (missing closing brackets) for the object field', () => {
|
|
139
|
+
AclManagementSteps.addRuleInBeginning();
|
|
140
|
+
AclManagementSteps.fillRole(0, 'ROLE1');
|
|
141
|
+
AclManagementSteps.selectPolicy(0, 'allow');
|
|
142
|
+
AclManagementSteps.selectOperation(0, 'write');
|
|
143
|
+
AclManagementSteps.fillSubject(0, '*');
|
|
144
|
+
AclManagementSteps.fillPredicate(0, '*');
|
|
145
|
+
AclManagementSteps.fillContext(0, '*');
|
|
146
|
+
AclManagementSteps.fillObject(0, '<<(<http://example.com/a> <http://example.com/b> "c")');
|
|
147
|
+
|
|
148
|
+
AclManagementSteps.getObjectField(0).should('have.class', 'invalid');
|
|
149
|
+
AclManagementSteps.checkIfRuleSavingIsForbidden(0);
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
|
package/e2e-legacy/setup/connectors/connectors-initial-state-with-selected-repository.spec.js
CHANGED
|
@@ -2,7 +2,7 @@ import {ConnectorsSteps} from "../../../steps/setup/connectors-steps";
|
|
|
2
2
|
import HomeSteps from "../../../steps/home-steps";
|
|
3
3
|
import {MainMenuSteps} from "../../../steps/main-menu-steps";
|
|
4
4
|
|
|
5
|
-
const expectedButtons = ['elasticsearch', 'opensearch', '
|
|
5
|
+
const expectedButtons = ['elasticsearch', 'opensearch', 'lucene', 'kafka', 'chatgpt-retrieval'];
|
|
6
6
|
|
|
7
7
|
function verifyConnectorsPage() {
|
|
8
8
|
expectedButtons.forEach(buttonId => {
|
|
@@ -22,7 +22,7 @@ describe('Plugins without selected repository', () => {
|
|
|
22
22
|
const verifyInitialStateWithoutSelectedRepository = () => {
|
|
23
23
|
ErrorSteps.verifyNoConnectedRepoMessage();
|
|
24
24
|
PluginsSteps.getPluginsView().should('be.visible');
|
|
25
|
-
PluginsSteps.getSearchPluginBar().should('not.
|
|
25
|
+
PluginsSteps.getSearchPluginBar().should('not.exist');
|
|
26
26
|
PluginsSteps.getPluginsList().should('not.exist');
|
|
27
27
|
};
|
|
28
28
|
})
|
|
@@ -3,6 +3,7 @@ import {YasqeSteps} from '../../../steps/yasgui/yasqe-steps';
|
|
|
3
3
|
import {SecurityStubs} from '../../../stubs/security-stubs';
|
|
4
4
|
import {VisualGraphSteps} from '../../../steps/visual-graph-steps';
|
|
5
5
|
import {ToasterSteps} from '../../../steps/toaster-steps';
|
|
6
|
+
import {SettingsSteps} from '../../../steps/setup/settings-steps';
|
|
6
7
|
|
|
7
8
|
describe('My Settings', () => {
|
|
8
9
|
|
|
@@ -32,16 +33,12 @@ describe('My Settings', () => {
|
|
|
32
33
|
//turn off inference, sameAs and count total results
|
|
33
34
|
clickLabelBtn('#sameas-on')
|
|
34
35
|
.then(() => {
|
|
35
|
-
|
|
36
|
-
.find('.switch:checkbox')
|
|
37
|
-
.should('not.be.visible');
|
|
36
|
+
SettingsSteps.getSameAsToggle().should('not.be.checked');
|
|
38
37
|
});
|
|
39
38
|
|
|
40
39
|
clickLabelBtn('#inference-on')
|
|
41
40
|
.then(() => {
|
|
42
|
-
|
|
43
|
-
.find('.switch:checkbox')
|
|
44
|
-
.should('not.be.visible');
|
|
41
|
+
SettingsSteps.getInferenceToggle().should('not.be.checked');
|
|
45
42
|
});
|
|
46
43
|
|
|
47
44
|
cy.get('#defaultCount:checkbox').uncheck();
|
|
@@ -95,9 +92,7 @@ describe('My Settings', () => {
|
|
|
95
92
|
visitSettingsView();
|
|
96
93
|
|
|
97
94
|
clickLabelBtn('#schema-on').then(() => {
|
|
98
|
-
|
|
99
|
-
.find('.switch:checkbox')
|
|
100
|
-
.should('not.be.visible');
|
|
95
|
+
SettingsSteps.getSchemaToggle().should('not.be.checked');
|
|
101
96
|
});
|
|
102
97
|
|
|
103
98
|
getSaveButton()
|
|
@@ -152,14 +147,29 @@ describe('My Settings', () => {
|
|
|
152
147
|
it('sameAs button should be disabled if inference is turned off', () => {
|
|
153
148
|
clickLabelBtn('#inference-on')
|
|
154
149
|
.then(() => {
|
|
155
|
-
|
|
156
|
-
.find('.switch:checkbox')
|
|
157
|
-
.should('not.be.visible');
|
|
150
|
+
SettingsSteps.getInferenceToggle().should('not.be.checked');
|
|
158
151
|
});
|
|
159
152
|
|
|
160
|
-
|
|
161
|
-
.
|
|
162
|
-
.
|
|
153
|
+
SettingsSteps.getSameAsToggle()
|
|
154
|
+
.should('be.disabled')
|
|
155
|
+
.and('not.be.checked');
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it('should give the settings form controls accessible names', () => {
|
|
159
|
+
SettingsSteps.getUsernameLabel().should('contain', 'Username');
|
|
160
|
+
|
|
161
|
+
SettingsSteps.getSameAsToggleLabel().should('contain', 'Expand results over owl:SameAs');
|
|
162
|
+
SettingsSteps.getInferenceToggleLabel().should('contain', 'Enable inference');
|
|
163
|
+
SettingsSteps.getSchemaToggleLabel().should('contain', 'Show schema');
|
|
164
|
+
|
|
165
|
+
SettingsSteps.getAnyRepositoryReadCheckbox()
|
|
166
|
+
.should('have.attr', 'aria-label', 'Read access to Global (any data repository)');
|
|
167
|
+
SettingsSteps.getAnyRepositoryWriteCheckbox()
|
|
168
|
+
.should('have.attr', 'aria-label', 'Write access to Global (any data repository)');
|
|
169
|
+
SettingsSteps.getAnyRepositoryMaintainCheckbox()
|
|
170
|
+
.should('have.attr', 'aria-label', 'Maintain access to Global (any data repository)');
|
|
171
|
+
SettingsSteps.getAnyRepositoryGraphqlCheckbox()
|
|
172
|
+
.should('have.attr', 'aria-label', 'Restrict Global (any data repository) to GraphQL');
|
|
163
173
|
});
|
|
164
174
|
|
|
165
175
|
function getSaveButton() {
|
|
@@ -8,6 +8,7 @@ import {LoginSteps} from '../../../steps/login-steps';
|
|
|
8
8
|
import {MainMenuSteps} from '../../../steps/main-menu-steps';
|
|
9
9
|
import {SecurityStubs} from '../../../stubs/security-stubs.js';
|
|
10
10
|
import {RepositorySteps} from '../../../steps/repository-steps.js';
|
|
11
|
+
import {LayoutSteps} from '../../../steps/layout-steps';
|
|
11
12
|
|
|
12
13
|
describe('User and Access', () => {
|
|
13
14
|
|
|
@@ -18,7 +19,7 @@ describe('User and Access', () => {
|
|
|
18
19
|
const DEFAULT_ADMIN_PASSWORD = 'root';
|
|
19
20
|
|
|
20
21
|
context('User and access management', () => {
|
|
21
|
-
const user = 'user';
|
|
22
|
+
const user = 'user' + Date.now();
|
|
22
23
|
let repoName;
|
|
23
24
|
|
|
24
25
|
before(() => {
|
|
@@ -280,7 +281,7 @@ describe('User and Access', () => {
|
|
|
280
281
|
LoginSteps.loginWithUser('admin', DEFAULT_ADMIN_PASSWORD);
|
|
281
282
|
UserAndAccessSteps.getUsersTable().should('be.visible');
|
|
282
283
|
|
|
283
|
-
cy.visit('/login?r=%
|
|
284
|
+
cy.visit('/login?r=%2Fsparql');
|
|
284
285
|
cy.reload();
|
|
285
286
|
UserAndAccessSteps.getUrl().should('include', '/sparql');
|
|
286
287
|
});
|
|
@@ -428,7 +429,7 @@ describe('User and Access', () => {
|
|
|
428
429
|
let repositoryId1;
|
|
429
430
|
let repositoryId2;
|
|
430
431
|
let repositoryId3;
|
|
431
|
-
const graphqlUser = 'graphqlUser';
|
|
432
|
+
const graphqlUser = 'graphqlUser' + Date.now();
|
|
432
433
|
|
|
433
434
|
beforeEach(() => {
|
|
434
435
|
RepositoriesStubs.spyGetRepositories();
|
|
@@ -649,7 +650,7 @@ describe('User and Access', () => {
|
|
|
649
650
|
let writeRepositoryId;
|
|
650
651
|
let graphQLOnlyRepositoryId;
|
|
651
652
|
let maintainedRepositoryId;
|
|
652
|
-
const maintainerUser = 'maintainerUser';
|
|
653
|
+
const maintainerUser = 'maintainerUser' + Date.now();
|
|
653
654
|
|
|
654
655
|
beforeEach(() => {
|
|
655
656
|
RepositoriesStubs.spyGetRepositories();
|
|
@@ -690,6 +691,8 @@ describe('User and Access', () => {
|
|
|
690
691
|
// 2. Read permission for one repository.
|
|
691
692
|
UserAndAccessSteps.openEditUserPage(maintainerUser);
|
|
692
693
|
cy.wait('@get-user');
|
|
694
|
+
// Wait until the loaded user is bound to the form, otherwise toggling a right fails.
|
|
695
|
+
UserAndAccessSteps.getUsernameField().should('have.value', maintainerUser);
|
|
693
696
|
setUserAuths({repo: readRepositoryId, read: true});
|
|
694
697
|
// 3. Write permission for one repository.
|
|
695
698
|
setUserAuths({repo: writeRepositoryId, write: true});
|
|
@@ -700,8 +703,10 @@ describe('User and Access', () => {
|
|
|
700
703
|
// When I log in as a user with repository maintain permission.
|
|
701
704
|
UserAndAccessSteps.toggleSecurity();
|
|
702
705
|
LoginSteps.loginWithUser(maintainerUser, PASSWORD);
|
|
706
|
+
// Wait for the login to complete, otherwise visiting another page aborts it.
|
|
707
|
+
cy.url().should('not.include', '/login');
|
|
703
708
|
// And navigate to the repository list view.
|
|
704
|
-
RepositorySteps.visit(
|
|
709
|
+
RepositorySteps.visit();
|
|
705
710
|
|
|
706
711
|
// Then I should see all repositories for which the user has at least read permission.
|
|
707
712
|
RepositorySteps.getRepositories().should('have.length', 4);
|
|
@@ -760,7 +765,9 @@ describe('User and Access', () => {
|
|
|
760
765
|
createUser(maintainerUser, PASSWORD, ROLE_USER, {maintain: true, repoName: maintainedRepositoryId});
|
|
761
766
|
UserAndAccessSteps.toggleSecurity();
|
|
762
767
|
LoginSteps.loginWithUser(maintainerUser, PASSWORD);
|
|
763
|
-
|
|
768
|
+
// Wait for the login to complete, otherwise visiting another page aborts it.
|
|
769
|
+
cy.url().should('not.include', '/login');
|
|
770
|
+
RepositorySteps.visit();
|
|
764
771
|
|
|
765
772
|
// When the user opens the edit page of the repository they can maintain.
|
|
766
773
|
RepositorySteps.getEditRepositoryButton(maintainedRepositoryId).should('be.visible');
|
|
@@ -912,6 +919,9 @@ describe('User and Access', () => {
|
|
|
912
919
|
}
|
|
913
920
|
|
|
914
921
|
function navigateMenuPath(pathArray, expectedUrl, expectedTitle) {
|
|
922
|
+
// The layout rebuilds the navbar model when the previous navigation finishes loading, which closes any opened
|
|
923
|
+
// submenu, so wait for it before opening a menu group.
|
|
924
|
+
LayoutSteps.getLayout().should('not.have.class', 'loading');
|
|
915
925
|
pathArray.forEach((label, index) => {
|
|
916
926
|
if (index === 0) {
|
|
917
927
|
MainMenuSteps.clickOnMenu(label);
|
|
@@ -976,14 +986,14 @@ describe('User and Access', () => {
|
|
|
976
986
|
};
|
|
977
987
|
|
|
978
988
|
const MENU_ITEMS_WITHOUT_GRAPHQL = [
|
|
979
|
-
//
|
|
989
|
+
// Import
|
|
980
990
|
{
|
|
981
991
|
path: ['Import'],
|
|
982
992
|
expectedUrl: '/import',
|
|
983
993
|
checks: noAuthChecks,
|
|
984
994
|
},
|
|
985
995
|
|
|
986
|
-
//
|
|
996
|
+
// Explore
|
|
987
997
|
{
|
|
988
998
|
path: ['Explore', 'Graphs overview'],
|
|
989
999
|
expectedUrl: '/graphs',
|
|
@@ -1011,7 +1021,7 @@ describe('User and Access', () => {
|
|
|
1011
1021
|
checks: noAuthChecks,
|
|
1012
1022
|
},
|
|
1013
1023
|
|
|
1014
|
-
//
|
|
1024
|
+
// SPARQL
|
|
1015
1025
|
{
|
|
1016
1026
|
path: ['SPARQL'],
|
|
1017
1027
|
expectedTitle: 'SPARQL Query & Update',
|
|
@@ -1019,9 +1029,16 @@ describe('User and Access', () => {
|
|
|
1019
1029
|
checks: noAuthChecks,
|
|
1020
1030
|
},
|
|
1021
1031
|
|
|
1022
|
-
//
|
|
1032
|
+
// TTYG
|
|
1033
|
+
{
|
|
1034
|
+
path: ['Talk to Your Graph'],
|
|
1035
|
+
expectedUrl: '/ttyg',
|
|
1036
|
+
checks: noAuthChecks,
|
|
1037
|
+
},
|
|
1038
|
+
|
|
1039
|
+
// GraphQL
|
|
1023
1040
|
|
|
1024
|
-
//
|
|
1041
|
+
// Monitor
|
|
1025
1042
|
{
|
|
1026
1043
|
path: ['Monitor', 'Queries and Updates'],
|
|
1027
1044
|
expectedUrl: '/monitor/queries',
|
|
@@ -1029,7 +1046,7 @@ describe('User and Access', () => {
|
|
|
1029
1046
|
checks: noAuthChecks,
|
|
1030
1047
|
},
|
|
1031
1048
|
|
|
1032
|
-
//
|
|
1049
|
+
// Setup
|
|
1033
1050
|
{
|
|
1034
1051
|
path: ['Setup', 'My Settings'],
|
|
1035
1052
|
expectedUrl: '/settings',
|
|
@@ -1081,14 +1098,7 @@ describe('User and Access', () => {
|
|
|
1081
1098
|
checks: noAuthChecks,
|
|
1082
1099
|
},
|
|
1083
1100
|
|
|
1084
|
-
//
|
|
1085
|
-
{
|
|
1086
|
-
path: ['Lab', 'Talk to Your Graph'],
|
|
1087
|
-
expectedUrl: '/ttyg',
|
|
1088
|
-
checks: noAuthChecks,
|
|
1089
|
-
},
|
|
1090
|
-
|
|
1091
|
-
// 8) Help
|
|
1101
|
+
// Help
|
|
1092
1102
|
{
|
|
1093
1103
|
path: ['Help', 'REST API'],
|
|
1094
1104
|
expectedUrl: '/webapi',
|
|
@@ -1128,14 +1138,14 @@ describe('User and Access', () => {
|
|
|
1128
1138
|
];
|
|
1129
1139
|
|
|
1130
1140
|
const FREE_ACCESS_MENU_ITEMS_WITHOUT_GRAPHQL = [
|
|
1131
|
-
//
|
|
1141
|
+
// Import
|
|
1132
1142
|
{
|
|
1133
1143
|
path: ['Import'],
|
|
1134
1144
|
expectedUrl: '/import',
|
|
1135
1145
|
checks: noAuthChecks,
|
|
1136
1146
|
},
|
|
1137
1147
|
|
|
1138
|
-
//
|
|
1148
|
+
// Explore
|
|
1139
1149
|
{
|
|
1140
1150
|
path: ['Explore', 'Graphs overview'],
|
|
1141
1151
|
expectedUrl: '/graphs',
|
|
@@ -1163,7 +1173,7 @@ describe('User and Access', () => {
|
|
|
1163
1173
|
checks: noAuthChecks,
|
|
1164
1174
|
},
|
|
1165
1175
|
|
|
1166
|
-
//
|
|
1176
|
+
// SPARQL
|
|
1167
1177
|
{
|
|
1168
1178
|
path: ['SPARQL'],
|
|
1169
1179
|
expectedTitle: 'SPARQL Query & Update',
|
|
@@ -1171,7 +1181,7 @@ describe('User and Access', () => {
|
|
|
1171
1181
|
checks: noAuthChecks,
|
|
1172
1182
|
},
|
|
1173
1183
|
|
|
1174
|
-
//
|
|
1184
|
+
// Setup
|
|
1175
1185
|
{
|
|
1176
1186
|
path: ['Setup', 'Connectors'],
|
|
1177
1187
|
expectedUrl: '/connectors',
|
|
@@ -60,7 +60,7 @@ describe('Expand results over owl:sameAs', () => {
|
|
|
60
60
|
// Then I expect that "sameAs" element to be enabled by default
|
|
61
61
|
YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-on');
|
|
62
62
|
// and the tooltip of element describes that "sameAs" element is enabled.
|
|
63
|
-
YasqeSteps.getActionButtonTooltip(
|
|
63
|
+
YasqeSteps.getActionButtonTooltip(5).should('have.attr', 'yasgui-data-tooltip', 'Expand results over owl:sameAs: ON');
|
|
64
64
|
|
|
65
65
|
// When I open a new Tab.
|
|
66
66
|
YasguiSteps.openANewTab();
|
|
@@ -68,7 +68,7 @@ describe('Expand results over owl:sameAs', () => {
|
|
|
68
68
|
// Then I expect that "sameAs" element to be enabled in the new tab.
|
|
69
69
|
YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-on');
|
|
70
70
|
// and the tooltip of element describes that "sameAs" element is enabled.
|
|
71
|
-
YasqeSteps.getActionButtonTooltip(
|
|
71
|
+
YasqeSteps.getActionButtonTooltip(5).should('have.attr', 'yasgui-data-tooltip', 'Expand results over owl:sameAs: ON');
|
|
72
72
|
});
|
|
73
73
|
|
|
74
74
|
it('should not be enabled when infer is true and sameAs is false in user settings',() => {
|
|
@@ -81,7 +81,7 @@ describe('Expand results over owl:sameAs', () => {
|
|
|
81
81
|
// Then I expect that "sameAs" element to be disabled by default
|
|
82
82
|
YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-off');
|
|
83
83
|
// and the tooltip of element describes that "sameAs" element is disabled.
|
|
84
|
-
YasqeSteps.getActionButtonTooltip(
|
|
84
|
+
YasqeSteps.getActionButtonTooltip(5).should('have.attr', 'yasgui-data-tooltip', 'Expand results over owl:sameAs: OFF');
|
|
85
85
|
|
|
86
86
|
// When I open a new Tab.
|
|
87
87
|
YasguiSteps.openANewTab();
|
|
@@ -89,7 +89,7 @@ describe('Expand results over owl:sameAs', () => {
|
|
|
89
89
|
// Then I expect that "sameAs" element to be disabled in the new tab.
|
|
90
90
|
YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-off');
|
|
91
91
|
// and the tooltip of element describes that "sameAs" element is disabled.
|
|
92
|
-
YasqeSteps.getActionButtonTooltip(
|
|
92
|
+
YasqeSteps.getActionButtonTooltip(5).should('have.attr', 'yasgui-data-tooltip', 'Expand results over owl:sameAs: OFF');
|
|
93
93
|
});
|
|
94
94
|
|
|
95
95
|
it('should not be enabled when infer is false and sameAs is true in user settings', () => {
|
|
@@ -100,7 +100,7 @@ describe('Expand results over owl:sameAs', () => {
|
|
|
100
100
|
YasguiSteps.getYasgui().should('be.visible');
|
|
101
101
|
|
|
102
102
|
// Then I expect that "sameAs" element to be disabled by default
|
|
103
|
-
YasqeSteps.getActionButtonTooltip(
|
|
103
|
+
YasqeSteps.getActionButtonTooltip(5).should('have.attr', 'yasgui-data-tooltip', 'Requires \'Include Inferred\'!');
|
|
104
104
|
// and the tooltip of element describes that "infer" is required.
|
|
105
105
|
YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-off');
|
|
106
106
|
|
|
@@ -110,7 +110,7 @@ describe('Expand results over owl:sameAs', () => {
|
|
|
110
110
|
// Then I expect that "sameAs" element to be disabled in the new tab,
|
|
111
111
|
YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-off');
|
|
112
112
|
// and the tooltip of element describes that "infer" is required.
|
|
113
|
-
YasqeSteps.getActionButtonTooltip(
|
|
113
|
+
YasqeSteps.getActionButtonTooltip(5).should('have.attr', 'yasgui-data-tooltip', 'Requires \'Include Inferred\'!');
|
|
114
114
|
});
|
|
115
115
|
|
|
116
116
|
it('should not be enabled when infer is false and sameAs is false in user settings', () => {
|
|
@@ -123,7 +123,7 @@ describe('Expand results over owl:sameAs', () => {
|
|
|
123
123
|
// Then I expect that "sameAs" element to be disabled by default,
|
|
124
124
|
YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-off');
|
|
125
125
|
// and the tooltip of element describes that "infer" is required.
|
|
126
|
-
YasqeSteps.getActionButtonTooltip(
|
|
126
|
+
YasqeSteps.getActionButtonTooltip(5).should('have.attr', 'yasgui-data-tooltip', 'Requires \'Include Inferred\'!');
|
|
127
127
|
|
|
128
128
|
// When I open a new Tab.
|
|
129
129
|
YasguiSteps.openANewTab();
|
|
@@ -131,6 +131,6 @@ describe('Expand results over owl:sameAs', () => {
|
|
|
131
131
|
// Then I expect that "sameAs" element to be disabled in the new tab,
|
|
132
132
|
YasqeSteps.getActionButton(5).should('have.class', 'icon-same-as-off');
|
|
133
133
|
// and the tooltip of element describes that "infer" is required.
|
|
134
|
-
YasqeSteps.getActionButtonTooltip(
|
|
134
|
+
YasqeSteps.getActionButtonTooltip(5).should('have.attr', 'yasgui-data-tooltip', 'Requires \'Include Inferred\'!');
|
|
135
135
|
});
|
|
136
136
|
});
|
|
@@ -66,7 +66,7 @@ describe('Include inferred statements', () => {
|
|
|
66
66
|
// Then I expect that "infer" element to be enabled by default,
|
|
67
67
|
YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-on');
|
|
68
68
|
// and the tooltip of element describes that "infer" functionality is enabled.
|
|
69
|
-
YasqeSteps.getActionButtonTooltip(
|
|
69
|
+
YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: ON');
|
|
70
70
|
|
|
71
71
|
// When I open a new Tab.
|
|
72
72
|
YasguiSteps.openANewTab();
|
|
@@ -74,7 +74,7 @@ describe('Include inferred statements', () => {
|
|
|
74
74
|
// Then I expect that inferred element to be enabled in the new tab,
|
|
75
75
|
YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-on');
|
|
76
76
|
// and the tooltip of element describes that "infer" element is enabled.
|
|
77
|
-
YasqeSteps.getActionButtonTooltip(
|
|
77
|
+
YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: ON');
|
|
78
78
|
});
|
|
79
79
|
|
|
80
80
|
it('should not be enabled when user settings is set to false.', () => {
|
|
@@ -87,7 +87,7 @@ describe('Include inferred statements', () => {
|
|
|
87
87
|
// Then I expect that "infer" element to be disabled by default,
|
|
88
88
|
YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-off');
|
|
89
89
|
// and the tooltip of element describes that "infer" element is disabled.
|
|
90
|
-
YasqeSteps.getActionButtonTooltip(
|
|
90
|
+
YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: OFF');
|
|
91
91
|
|
|
92
92
|
// When I open a new Tab.
|
|
93
93
|
YasguiSteps.openANewTab();
|
|
@@ -95,6 +95,6 @@ describe('Include inferred statements', () => {
|
|
|
95
95
|
// Then I expect that inferred element to be disabled in the new tab,
|
|
96
96
|
YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-off');
|
|
97
97
|
// and the tooltip of element describes that "infer" element is disabled.
|
|
98
|
-
YasqeSteps.getActionButtonTooltip(
|
|
98
|
+
YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: OFF');
|
|
99
99
|
});
|
|
100
100
|
});
|
|
@@ -36,14 +36,14 @@ describe('Expand results over owl:sameAs', () => {
|
|
|
36
36
|
SparqlEditorSteps.visitSparqlEditorPage();
|
|
37
37
|
|
|
38
38
|
// Then I expect inferred button to be on.
|
|
39
|
-
YasqeSteps.getActionButtonTooltip(
|
|
39
|
+
YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: ON');
|
|
40
40
|
YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-on');
|
|
41
41
|
|
|
42
42
|
// When I click on inferred button
|
|
43
43
|
YasqeSteps.getActionButton(4).click({force: true});
|
|
44
44
|
|
|
45
45
|
// Then I expect inferred button to not be toggled.
|
|
46
|
-
YasqeSteps.getActionButtonTooltip(
|
|
46
|
+
YasqeSteps.getActionButtonTooltip(4).should('have.attr', 'yasgui-data-tooltip', 'Include inferred data in results: ON');
|
|
47
47
|
YasqeSteps.getActionButton(4).should('have.class', 'icon-inferred-on');
|
|
48
48
|
});
|
|
49
49
|
});
|
|
@@ -28,7 +28,7 @@ describe('Abort query', () => {
|
|
|
28
28
|
// and execute a query that takes a long time.
|
|
29
29
|
YasqeSteps.pasteQuery(
|
|
30
30
|
'select (count(*) as ?count) where {?s ?p ?o. ?s1 ?p1 ?o1. ?s2 ?p2 ?o2. ?s3 ?p3 ?o3.}');
|
|
31
|
-
YasqeSteps.
|
|
31
|
+
YasqeSteps.executeQueryWithoutWaitingForResult();
|
|
32
32
|
|
|
33
33
|
// Then I expect to an "Abort query" button to be displayed,
|
|
34
34
|
YasqeSteps.getAbortQueryButton().should('exist');
|