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
|
@@ -10,14 +10,14 @@ export class ImportUserDataSteps extends ImportSteps {
|
|
|
10
10
|
return this.getView().find('.user-data-import-help');
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
static
|
|
14
|
-
return this.getView().find('.file-size-limit-
|
|
13
|
+
static getFileSizeLimitationInfoMessage() {
|
|
14
|
+
return this.getView().find('.file-size-limit-info');
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
static openImportTextSnippetDialog() {
|
|
18
|
-
cy.get('#import-user .import-rdf-snippet-btn').click()
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
cy.get('#import-user .import-rdf-snippet-btn').click();
|
|
19
|
+
// Forces the popover to disappear as it covers the modal and Cypress refuses to continue
|
|
20
|
+
cy.get('#import-user .import-rdf-snippet-btn').trigger('mouseleave', {force: true});
|
|
21
21
|
this.getModal().find('#wb-import-textarea').should('be.visible');
|
|
22
22
|
return this;
|
|
23
23
|
}
|
|
@@ -34,7 +34,8 @@ export class ImportUserDataSteps extends ImportSteps {
|
|
|
34
34
|
static selectRDFFormat(rdfFormat) {
|
|
35
35
|
cy.get('.modal-footer .import-format-dropdown').within(() => {
|
|
36
36
|
cy.get('.import-format-dropdown-btn').click();
|
|
37
|
-
cy.get('.dropdown-item').contains(rdfFormat).click()
|
|
37
|
+
cy.get('.dropdown-item').contains(rdfFormat).click();
|
|
38
|
+
cy.get('.dropdown-item').contains(rdfFormat).should('not.be.visible');
|
|
38
39
|
});
|
|
39
40
|
return this;
|
|
40
41
|
}
|
|
@@ -48,6 +49,24 @@ export class ImportUserDataSteps extends ImportSteps {
|
|
|
48
49
|
cy.intercept('POST', `/rest/repositories/${repositoryId}/import/upload/url`).as('postJsonldUrl');
|
|
49
50
|
}
|
|
50
51
|
|
|
52
|
+
static openTextSnippetImportSettings(snippet, rdfFormat) {
|
|
53
|
+
this.openImportTextSnippetDialog();
|
|
54
|
+
this.pasteRDFTextSnippet(snippet);
|
|
55
|
+
if (rdfFormat) {
|
|
56
|
+
this.selectRDFFormat(rdfFormat);
|
|
57
|
+
}
|
|
58
|
+
this.clickImportTextSnippetButton();
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
static interceptTextSnippetImport(repositoryId) {
|
|
63
|
+
cy.intercept('POST', `/rest/repositories/${repositoryId}/import/upload/text`).as('importTextSnippet');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
static waitForTextSnippetImportSettings() {
|
|
67
|
+
return cy.wait('@importTextSnippet').its('request.body');
|
|
68
|
+
}
|
|
69
|
+
|
|
51
70
|
static getErrors() {
|
|
52
71
|
return cy.get('.text-danger');
|
|
53
72
|
}
|
|
@@ -64,30 +83,11 @@ export class ImportUserDataSteps extends ImportSteps {
|
|
|
64
83
|
return this.getModal().find('#wb-import-textarea');
|
|
65
84
|
}
|
|
66
85
|
|
|
67
|
-
static getImportFromDataRadioButton() {
|
|
68
|
-
return this.getModal().find('#wb-import-from-data');
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
static getImportInDefaultGraphRadioButton() {
|
|
72
|
-
return this.getModal().find('#wb-import-in-default-graph');
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
static getExistingDataReplacementCheckbox() {
|
|
76
|
-
return this.getModal().find('#wb-import-existing-data-replacement');
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
static getReplacedGraphsInputField() {
|
|
80
|
-
return this.getModal().find('#wb-import-replaced-graphs');
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
static getAddGraphToReplaceButton() {
|
|
84
|
-
return this.getModal().find('#wb-import-add-graph-to-replace');
|
|
85
|
-
}
|
|
86
|
-
|
|
87
86
|
//verifies that the data has been inserted in the given graph and that the new data has replaced the old one.
|
|
88
87
|
static verifyGraphData(graphName, s, p, o, c, checkForReplacedData, oldData) {
|
|
89
88
|
cy.visit('/graphs');
|
|
90
89
|
// wait a bit to give chance page loaded.
|
|
90
|
+
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
91
91
|
cy.wait(1000);
|
|
92
92
|
cy.get(`#export-graphs td a:contains(${graphName})`).click();
|
|
93
93
|
cy.get(`.uri-cell:contains(${s})`).should('be.visible');
|
|
@@ -7,6 +7,10 @@ export class LanguageSelectorSteps {
|
|
|
7
7
|
LanguageSelectorSteps.getLanguageSelectorDropdown().should('be.visible').click();
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
static getLanguageSelectorDropdownButton() {
|
|
11
|
+
return LanguageSelectorSteps.getLanguageSelectorDropdown().getByTestId('onto-dropdown-button');
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
static changeLanguage(language) {
|
|
11
15
|
LanguageSelectorSteps.openLanguageSelectorDropdown();
|
|
12
16
|
this.getLanguageSelectorDropdown().find(`button.${language}`).click();
|
package/steps/login-steps.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {EnvironmentStubs} from "../stubs/environment-stubs";
|
|
2
|
-
|
|
2
|
+
const VIEW_URL = '/login';
|
|
3
3
|
export class LoginSteps {
|
|
4
4
|
static visitLoginPage() {
|
|
5
|
-
cy.visit(
|
|
5
|
+
cy.visit(VIEW_URL);
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
static visitInProdMode() {
|
|
9
|
-
cy.visit(
|
|
9
|
+
cy.visit(VIEW_URL, {
|
|
10
10
|
onBeforeLoad: () => {
|
|
11
11
|
EnvironmentStubs.stubWbProdMode();
|
|
12
12
|
}
|
|
@@ -18,6 +18,10 @@ export class LoginSteps {
|
|
|
18
18
|
cy.visit(`/login?r=${returnURLEncoded}`);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
static verifyUrl() {
|
|
22
|
+
cy.url().should('include', `${Cypress.config('baseUrl')}${VIEW_URL}`);
|
|
23
|
+
}
|
|
24
|
+
|
|
21
25
|
static getLoginPage() {
|
|
22
26
|
return cy.get('app-login');
|
|
23
27
|
}
|
package/steps/main-menu-steps.js
CHANGED
|
@@ -107,6 +107,15 @@ export class MainMenuSteps {
|
|
|
107
107
|
this.getSubMenuButton('sub-menu-visual-graph').click();
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
static clickOnGraphNavigator() {
|
|
111
|
+
this.clickOnExplore();
|
|
112
|
+
this.clickOnSubmenuGraphNavigator();
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
static clickOnSubmenuGraphNavigator() {
|
|
116
|
+
this.getSubMenuButton('menu-graph-navigator').click();
|
|
117
|
+
}
|
|
118
|
+
|
|
110
119
|
static clickOnClassRelationships() {
|
|
111
120
|
this.clickOnExplore();
|
|
112
121
|
this.clickOnSubmenuClassRelationships();
|
|
@@ -272,23 +281,14 @@ export class MainMenuSteps {
|
|
|
272
281
|
}
|
|
273
282
|
|
|
274
283
|
// --------------------------
|
|
275
|
-
// --
|
|
284
|
+
// -- TTYG menu --
|
|
276
285
|
// --------------------------
|
|
277
|
-
static
|
|
278
|
-
return this.getMainMenu().getByTestId('menu-
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
static clickOnMenuLab() {
|
|
282
|
-
return this.getMenuLab().click();
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
static clickOnTTYG() {
|
|
286
|
-
this.clickOnMenuLab();
|
|
287
|
-
this.clickOnTTYGSubmenu()
|
|
286
|
+
static getMenuTTYG() {
|
|
287
|
+
return this.getMainMenu().getByTestId('menu-ttyg');
|
|
288
288
|
}
|
|
289
289
|
|
|
290
|
-
static
|
|
291
|
-
this.
|
|
290
|
+
static clickOnMenuTTYG() {
|
|
291
|
+
return this.getMenuTTYG().click();
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
// --------------------------
|
|
@@ -14,6 +14,15 @@ export class QueriesAndUpdatesSteps extends BaseSteps {
|
|
|
14
14
|
return this.getQueryAndUpdatePage().getByTestId('pause-button');
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
static getAbortButtons() {
|
|
18
|
+
return this.getQueryAndUpdatePage().getByTestId('monitoring-queries-abort-button');
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// A real hover: the popover's jQuery mouseenter handler ignores a synthetic mouseenter.
|
|
22
|
+
static hoverAbortButton(index) {
|
|
23
|
+
this.getQueryAndUpdatePage().getByTestId('monitoring-queries-abort-popover-trigger').eq(index).realHover();
|
|
24
|
+
}
|
|
25
|
+
|
|
17
26
|
static getNoRunningQueriesOrUpdates() {
|
|
18
27
|
return this.getQueryAndUpdatePage().getByTestId('no-running-queries-or-updates-alert');
|
|
19
28
|
}
|
|
@@ -25,6 +25,10 @@ export class OntopRepositorySteps {
|
|
|
25
25
|
OntopRepositorySteps.getOBDAFileFieldEditButton().click();
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
static getFileContentEditor() {
|
|
29
|
+
return cy.getByTestId('repository-file-content');
|
|
30
|
+
}
|
|
31
|
+
|
|
28
32
|
static getOntologyFileField() {
|
|
29
33
|
return cy.get('div').contains("Ontology file");
|
|
30
34
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {BaseSteps} from "./base-steps.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Steps for the restriction block (`app-page-restrictions`) that the new workbench shows instead of a
|
|
5
|
+
* page's content when the page is restricted. For its repository picker see {@link RepositoryPickerListSteps}.
|
|
6
|
+
*/
|
|
7
|
+
export class PageRestrictionsSteps extends BaseSteps {
|
|
8
|
+
|
|
9
|
+
static getRestrictions() {
|
|
10
|
+
return this.getByTestId('page-restrictions');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
static getMessages() {
|
|
14
|
+
return this.getRestrictions().find(this.buildTestIdAttr('page-restriction-message'));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static getInternalLink() {
|
|
18
|
+
return this.getMessages().find(this.buildTestIdAttr('restriction-internal-link'));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static getMessage(text) {
|
|
22
|
+
return this.getMessages().contains(text);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -120,15 +120,7 @@ export class AttachRepositorySteps {
|
|
|
120
120
|
AttachRepositorySteps.getPasswordInput().clear();
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
static
|
|
124
|
-
return this.getRemoteLocationSettingsForm().find('
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
static getBackwardCompatibilityWarning() {
|
|
128
|
-
return this.getRemoteLocationSettingsForm().find('.backward-compatibility-warning');
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
static encryptPassword() {
|
|
132
|
-
this.getRemoteLocationSettingsForm().find('#encryptPassword').check();
|
|
123
|
+
static getEncryptPasswordCheckbox() {
|
|
124
|
+
return this.getRemoteLocationSettingsForm().find('#encryptPassword');
|
|
133
125
|
}
|
|
134
126
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {BaseSteps} from "./base-steps.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Steps for the repository picker list (`app-repository-picker-list`) of the new workbench, which lists the
|
|
5
|
+
* repositories the user can select and, when allowed, offers the creation of a new one.
|
|
6
|
+
*/
|
|
7
|
+
export class RepositoryPickerListSteps extends BaseSteps {
|
|
8
|
+
|
|
9
|
+
static getRepositoryPickerList() {
|
|
10
|
+
return this.getByTestId('repository-picker-list');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
static getRepositoryRows() {
|
|
14
|
+
return this.getRepositoryPickerList().find(this.buildTestIdAttr('repository-picker-row'));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static getRepositoryRow(repositoryId) {
|
|
18
|
+
return this.getRepositoryRows()
|
|
19
|
+
.contains(this.buildTestIdAttr('repository-picker-repository-id'), repositoryId)
|
|
20
|
+
.parents(this.buildTestIdAttr('repository-picker-row'));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
static getRepositoryLocation(repositoryId) {
|
|
24
|
+
return this.getRepositoryRow(repositoryId).find(this.buildTestIdAttr('repository-picker-repository-location'));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
static getRepositoryFedxDeprecatedTag(repositoryId) {
|
|
28
|
+
return this.getRepositoryRow(repositoryId).find(this.buildTestIdAttr('repository-picker-fedx-deprecated-tag'));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static getSelectRepositoryButton(repositoryId) {
|
|
32
|
+
return this.getRepositoryRow(repositoryId).find(this.buildTestIdAttr('repository-picker-select-btn'));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static focusRepository(repositoryId) {
|
|
36
|
+
this.getSelectRepositoryButton(repositoryId).focus();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
static getRepositoryInfo() {
|
|
40
|
+
return cy.get('.repository-info-popover-content onto-repository-info');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
static getRepositoryInfoPart(name) {
|
|
44
|
+
return this.getRepositoryInfo().find(this.buildTestIdAttr(`repository-info-${name}`));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
static selectRepository(repositoryId) {
|
|
48
|
+
this.getRepositoryRow(repositoryId).click();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
static getCreateRepositoryButton() {
|
|
52
|
+
return this.getRepositoryPickerList().find(this.buildTestIdAttr('repository-picker-create-btn'));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
static clickCreateRepositoryButton() {
|
|
56
|
+
this.getCreateRepositoryButton().click();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -23,4 +23,24 @@ export class RepositorySelectorSteps {
|
|
|
23
23
|
static getSelectedRepository() {
|
|
24
24
|
return RepositorySelectorSteps.getRepositorySelectorDropdown().find('.active-repository');
|
|
25
25
|
}
|
|
26
|
+
|
|
27
|
+
static getRepositoryItem(repositoryId) {
|
|
28
|
+
return RepositorySelectorSteps.getRepositorySelectorButton(repositoryId).closest('.onto-dropdown-menu-item');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static hoverRepositoryItem(repositoryId) {
|
|
32
|
+
RepositorySelectorSteps.getRepositoryItem(repositoryId).realHover();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static getRepositoryFedxDeprecatedTag(repositoryId) {
|
|
36
|
+
return RepositorySelectorSteps.getRepositoryItem(repositoryId).getByTestId('repository-selector-fedx-deprecated-tag');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
static getRepositoryTooltip() {
|
|
40
|
+
return cy.get('.onto-tooltip-box onto-repository-info');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
static getRepositoryTooltipPart(name) {
|
|
44
|
+
return RepositorySelectorSteps.getRepositoryTooltip().find(`[data-test="repository-info-${name}"]`);
|
|
45
|
+
}
|
|
26
46
|
}
|
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
import {REPOSITORIES_URL} from "../support/repository-commands";
|
|
2
2
|
import {BaseSteps} from "./base-steps.js";
|
|
3
|
+
import {ModalDialogSteps} from "./modal-dialog-steps.js";
|
|
3
4
|
|
|
4
5
|
export class RepositorySteps extends BaseSteps {
|
|
5
6
|
|
|
6
|
-
static visit(
|
|
7
|
+
static visit() {
|
|
7
8
|
cy.intercept('/rest/locations').as('getLocations');
|
|
8
9
|
cy.intercept(REPOSITORIES_URL + '/all').as('getRepositories');
|
|
9
10
|
cy.visit('/repository');
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
RepositorySteps.waitUntilRepositoriesPageIsLoaded();
|
|
12
|
+
// Consumes the initial locations request, so a later cy.wait('@getLocations') in a test matches the next one.
|
|
13
|
+
// It must stay after the page-loaded check, which has a longer timeout than cy.wait for the request to start.
|
|
13
14
|
cy.wait('@getLocations');
|
|
14
|
-
if (waitPageLoaded) {
|
|
15
|
-
RepositorySteps.waitUntilRepositoriesPageIsLoaded();
|
|
16
|
-
}
|
|
17
15
|
}
|
|
18
16
|
|
|
19
17
|
static visitEditPage(repositoryId) {
|
|
20
18
|
cy.visit(`repository/edit/${repositoryId}?location=`);
|
|
21
19
|
}
|
|
22
20
|
|
|
21
|
+
static verifyRepositoryCreateViewUrl() {
|
|
22
|
+
return cy.url().should('include', '/repository/create');
|
|
23
|
+
}
|
|
24
|
+
|
|
23
25
|
static getRepositoryPage() {
|
|
24
26
|
return cy.get('#wb-repository');
|
|
25
27
|
}
|
|
@@ -32,9 +34,12 @@ export class RepositorySteps extends BaseSteps {
|
|
|
32
34
|
return cy.get('#wb-repositories-addRepositoryLink');
|
|
33
35
|
}
|
|
34
36
|
|
|
37
|
+
// The page loader is hidden once the locations are loaded, regardless of the user's role.
|
|
35
38
|
static waitUntilRepositoriesPageIsLoaded() {
|
|
36
|
-
RepositorySteps.
|
|
37
|
-
|
|
39
|
+
RepositorySteps.getRepositoriesPage()
|
|
40
|
+
.should('be.visible')
|
|
41
|
+
.find('.ot-loader-new-content')
|
|
42
|
+
.should('not.be.visible');
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
static getRepositoriesDropdown() {
|
|
@@ -186,6 +191,40 @@ export class RepositorySteps extends BaseSteps {
|
|
|
186
191
|
|
|
187
192
|
static createFedexRepositoryType() {
|
|
188
193
|
RepositorySteps.chooseRepositoryType('fedx');
|
|
194
|
+
// FedX is deprecated, so its creation is confirmed in a dialog.
|
|
195
|
+
RepositorySteps.confirmModal();
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
static getRepositoryTypeFedxDeprecationMessage(type) {
|
|
199
|
+
return RepositorySteps.getRepositoryTypeButton(type).find(RepositorySteps.buildTestIdAttr('repository-type-fedx-deprecation-message'));
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
static getRepositoryFedxDeprecatedTag(repositoryId) {
|
|
203
|
+
return RepositorySteps.getRepositoryFromList(repositoryId).find(RepositorySteps.buildTestIdAttr('repository-fedx-deprecated-tag'));
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
static hoverRepositoryInList(repositoryId) {
|
|
207
|
+
// "mouseover" sets the repository of the popover, "mouseenter" opens it.
|
|
208
|
+
RepositorySteps.getRepositoryFromList(repositoryId).find(RepositorySteps.buildTestIdAttr('repository-popover-trigger'))
|
|
209
|
+
.trigger('mouseover')
|
|
210
|
+
.trigger('mouseenter');
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
static getRepositoryPopoverDeprecationMessage() {
|
|
214
|
+
return RepositorySteps.getByTestId('repository-info-popover').find(RepositorySteps.buildTestIdAttr('repository-deprecation-message'));
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
static getFedxDeprecationWarning() {
|
|
218
|
+
return RepositorySteps.getByTestId('repository-fedx-deprecation-warning');
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
static getFedxMigrationLink() {
|
|
222
|
+
return RepositorySteps.getByTestId('repository-fedx-migration-link');
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
static getFedxDeprecationDialogMigrationLink() {
|
|
226
|
+
// The link comes from a translation rendered as HTML, which cannot keep a data-test attribute.
|
|
227
|
+
return ModalDialogSteps.getDialogBody().find('a');
|
|
189
228
|
}
|
|
190
229
|
|
|
191
230
|
static getGDBRepositoryTypeButton() {
|
|
@@ -255,6 +294,22 @@ export class RepositorySteps extends BaseSteps {
|
|
|
255
294
|
return RepositorySteps.getRepositoryCreateForm().find('#ruleset');
|
|
256
295
|
}
|
|
257
296
|
|
|
297
|
+
/**
|
|
298
|
+
* Selects a ruleset in the repository form by its name in the dropdown.
|
|
299
|
+
* @param {string} rulesetName the ruleset name, e.g. 'OWL-Horst (Optimized)'
|
|
300
|
+
*/
|
|
301
|
+
static selectRuleset(rulesetName) {
|
|
302
|
+
return RepositorySteps.getRepositoryRulesetMenu().select(rulesetName);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Verifies which ruleset is selected in the repository form.
|
|
307
|
+
* @param {string} rulesetName the expected ruleset name, e.g. 'OWL-Horst (Optimized)'
|
|
308
|
+
*/
|
|
309
|
+
static verifySelectedRuleset(rulesetName) {
|
|
310
|
+
return RepositorySteps.getRepositoryRulesetMenu().find('option:selected').should('have.text', rulesetName);
|
|
311
|
+
}
|
|
312
|
+
|
|
258
313
|
static getAdditionalPropertiesTextArea() {
|
|
259
314
|
return RepositorySteps.getRepositoryCreateForm().find('#additionalProperties');
|
|
260
315
|
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
const VIEW_URL = '/resource';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* The label of the "triple term" role tab. It differs from the role itself, which is "triple-term".
|
|
5
|
+
* @type {string}
|
|
6
|
+
*/
|
|
7
|
+
export const TRIPLE_TERM_ROLE_LABEL = 'triple term';
|
|
8
|
+
|
|
3
9
|
export class ResourceSteps {
|
|
4
10
|
|
|
5
11
|
static visit(parameters) {
|
|
@@ -44,12 +50,12 @@ export class ResourceSteps {
|
|
|
44
50
|
ResourceSteps.getSameAsButton().find('.icon-same-as-off').should('have.length', 1);
|
|
45
51
|
}
|
|
46
52
|
|
|
47
|
-
static
|
|
48
|
-
return cy.
|
|
53
|
+
static getShowBlankNodesCheckbox() {
|
|
54
|
+
return cy.getByTestId('show-blank-nodes-checkbox');
|
|
49
55
|
}
|
|
50
56
|
|
|
51
|
-
static
|
|
52
|
-
ResourceSteps.
|
|
57
|
+
static clickOnShowBlankNodesCheckbox() {
|
|
58
|
+
ResourceSteps.getShowBlankNodesCheckbox().click();
|
|
53
59
|
}
|
|
54
60
|
|
|
55
61
|
static getDownloadAsDropdown() {
|
|
@@ -89,8 +95,12 @@ export class ResourceSteps {
|
|
|
89
95
|
return cy.get('#selection');
|
|
90
96
|
}
|
|
91
97
|
|
|
98
|
+
static getRoleTabs() {
|
|
99
|
+
return ResourceSteps.getRoleSelectionElement().find('.nav-link');
|
|
100
|
+
}
|
|
101
|
+
|
|
92
102
|
static getRoleTab(role = 'subject') {
|
|
93
|
-
return ResourceSteps.
|
|
103
|
+
return ResourceSteps.getRoleTabs().contains(role);
|
|
94
104
|
}
|
|
95
105
|
|
|
96
106
|
static selectRole(role) {
|
|
@@ -121,21 +131,59 @@ export class ResourceSteps {
|
|
|
121
131
|
ResourceSteps.getAllRoleTab().click();
|
|
122
132
|
}
|
|
123
133
|
|
|
134
|
+
/**
|
|
135
|
+
* Verifies that the tab of the given role is the only active one. Only the rendered tabs are checked,
|
|
136
|
+
* because the "triple term" tab is rendered for triple terms only.
|
|
137
|
+
*
|
|
138
|
+
* @param {string} activeRole the label of the role tab which is expected to be active
|
|
139
|
+
*/
|
|
124
140
|
static verifyActiveRoleTab(activeRole = 'subject') {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
141
|
+
// Assert that the expected tab is rendered at all, otherwise the check below passes vacuously.
|
|
142
|
+
ResourceSteps.getRoleTab(activeRole).should('have.class', 'active');
|
|
143
|
+
ResourceSteps.getRoleTabs().each(($tab) => {
|
|
144
|
+
const chainer = $tab.text().trim() === activeRole ? 'have.class' : 'not.have.class';
|
|
145
|
+
cy.wrap($tab).should(chainer, 'active');
|
|
128
146
|
});
|
|
129
147
|
}
|
|
130
148
|
|
|
131
|
-
static
|
|
149
|
+
static verifyRoleTabDisabled(role) {
|
|
150
|
+
ResourceSteps.getRoleTab(role)
|
|
151
|
+
.should('have.class', 'disabled')
|
|
152
|
+
.and('have.attr', 'tabindex', '-1');
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
static verifyRoleTabEnabled(role) {
|
|
156
|
+
ResourceSteps.getRoleTab(role)
|
|
157
|
+
.should('not.have.class', 'disabled')
|
|
158
|
+
.and('have.attr', 'tabindex', '0');
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
static verifyRoleTabMissing(role) {
|
|
162
|
+
ResourceSteps.getRoleTabs().contains(role).should('not.exist');
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* @return {string[]} the roles which can be selected for a resource which is not a triple term.
|
|
167
|
+
*/
|
|
168
|
+
static getPlainResourceRoles() {
|
|
132
169
|
return ['subject', 'predicate', 'object', 'context', 'all'];
|
|
133
170
|
}
|
|
134
171
|
|
|
172
|
+
/**
|
|
173
|
+
* @return {string[]} the labels of all role tabs, including the "triple term" one.
|
|
174
|
+
*/
|
|
175
|
+
static getAllRoles() {
|
|
176
|
+
return [TRIPLE_TERM_ROLE_LABEL, ...ResourceSteps.getPlainResourceRoles()];
|
|
177
|
+
}
|
|
178
|
+
|
|
135
179
|
static getTargetLink() {
|
|
136
180
|
return cy.get('.target-link');
|
|
137
181
|
}
|
|
138
182
|
|
|
183
|
+
static clickOnTargetLink() {
|
|
184
|
+
ResourceSteps.getTargetLink().click();
|
|
185
|
+
}
|
|
186
|
+
|
|
139
187
|
static getTripleResourceLink() {
|
|
140
188
|
return cy.get('.triple-resource-link');
|
|
141
189
|
}
|
|
@@ -144,7 +192,26 @@ export class ResourceSteps {
|
|
|
144
192
|
ResourceSteps.getTripleResourceLink().click();
|
|
145
193
|
}
|
|
146
194
|
|
|
195
|
+
/**
|
|
196
|
+
* Verifies the text of an element after trimming it. The templates surround the interpolated
|
|
197
|
+
* values with whitespace, which makes a plain "have.text" assertion unusable.
|
|
198
|
+
*
|
|
199
|
+
* @param {Cypress.Chainable} element the element whose text has to be verified
|
|
200
|
+
* @param {string} expectedText the expected text without any surrounding whitespace
|
|
201
|
+
*/
|
|
202
|
+
static verifyTrimmedText(element, expectedText) {
|
|
203
|
+
element.invoke('text').invoke('trim').should('eq', expectedText);
|
|
204
|
+
}
|
|
205
|
+
|
|
147
206
|
static getDataTable() {
|
|
148
207
|
return cy.get('.dataTable');
|
|
149
208
|
}
|
|
209
|
+
|
|
210
|
+
static getVisualizeGraphNavigatorButton() {
|
|
211
|
+
return cy.getByTestId('visualize-graph-navigator-button');
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
static clickOnVisualizeGraphNavigatorButton() {
|
|
215
|
+
ResourceSteps.getVisualizeGraphNavigatorButton().click();
|
|
216
|
+
}
|
|
150
217
|
}
|
|
@@ -12,4 +12,27 @@ export class RestApiDocumentationSteps extends BaseSteps {
|
|
|
12
12
|
static verifyInitialState() {
|
|
13
13
|
this.getRestApiContent().should('be.visible');
|
|
14
14
|
}
|
|
15
|
+
|
|
16
|
+
static getSwaggerDocument() {
|
|
17
|
+
return this.getRestApiContent().its('0.contentDocument');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static getSwaggerRoot() {
|
|
21
|
+
return this.getSwaggerDocument().its('documentElement');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static waitForSwaggerUi() {
|
|
25
|
+
// The iframe starts with an empty document; wait until Swagger UI has rendered the API operations.
|
|
26
|
+
this.getSwaggerDocument().find('.opblock-tag').should('have.length.greaterThan', 0);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
static verifySwaggerDarkTheme() {
|
|
30
|
+
this.waitForSwaggerUi();
|
|
31
|
+
this.getSwaggerRoot().should('have.class', 'dark-mode');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
static verifySwaggerLightTheme() {
|
|
35
|
+
this.waitForSwaggerUi();
|
|
36
|
+
this.getSwaggerRoot().should('not.have.class', 'dark-mode');
|
|
37
|
+
}
|
|
15
38
|
}
|