graphdb-workbench-tests 2.5.1 → 2.6.0-RC2

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.
Files changed (114) hide show
  1. package/fixtures/graphdb-import/resource-test-data.ttl +99 -0
  2. package/fixtures/graphql-editor/default-query-response.json +517 -0
  3. package/fixtures/guides/guides.json +764 -0
  4. package/fixtures/guides/movies.ttl +629 -0
  5. package/fixtures/guides/starwars.ttl +4384 -0
  6. package/fixtures/locale-en.json +53 -12
  7. package/fixtures/namespaces/ontotext-generated-namespace.json +22 -0
  8. package/fixtures/queries/empty-query-response.json +11 -0
  9. package/integration/cluster/cluster-management.spec.js +1 -2
  10. package/integration/explore/graphs.overview.spec.js +4 -2
  11. package/integration/explore/similariti-index-create.spec.js +333 -0
  12. package/integration/explore/similarity-index.spec.js +88 -0
  13. package/integration/explore/similarity.spec.js +180 -56
  14. package/integration/explore/visual-graph/graphs-config.spec.js +453 -0
  15. package/integration/explore/{visual.graph.spec.js → visual-graph/visual.graph.spec.js} +146 -347
  16. package/integration/guides/movies-interactive-guide.spec.js +73 -0
  17. package/integration/guides/star-wars-interactive-guide.js +60 -0
  18. package/integration/home/language-change.spec.js +3 -3
  19. package/integration/import/import.user.data.spec.js +2 -0
  20. package/integration/resource/resource.spec.js +357 -0
  21. package/integration/setup/aclmanagement/create-rule.spec.js +88 -11
  22. package/integration/setup/aclmanagement/delete-rule.spec.js +6 -4
  23. package/integration/setup/aclmanagement/edit-rule.spec.js +13 -8
  24. package/integration/setup/aclmanagement/render-rules.spec.js +4 -2
  25. package/integration/setup/aclmanagement/reorder-rules.spec.js +5 -3
  26. package/integration/setup/aclmanagement/revert-rules.spec.js +4 -3
  27. package/integration/setup/aclmanagement/scopes.spec.js +228 -0
  28. package/integration/setup/aclmanagement/update-rules.spec.js +17 -9
  29. package/integration/setup/jdbc-create.spec.js +330 -0
  30. package/integration/setup/jdbc.spec.js +78 -154
  31. package/integration/setup/my-settings.spec.js +9 -41
  32. package/integration/setup/sparql-template-create.js +150 -0
  33. package/integration/setup/sparql-templates.spec.js +82 -146
  34. package/integration/sparql-editor/actions/execute-query.spec.js +44 -0
  35. package/integration/sparql-editor/actions/expand-results-over-sameas.spec.js +136 -0
  36. package/integration/sparql-editor/actions/include-inferred-statements.spec.js +100 -0
  37. package/integration/sparql-editor/actions/inferred-sameas.spec.js +47 -0
  38. package/integration/sparql-editor/actions/save-query.spec.js +70 -0
  39. package/integration/sparql-editor/actions/show-saved-queries.spec.js +61 -0
  40. package/integration/sparql-editor/internationalization.spec.js +41 -0
  41. package/integration/sparql-editor/saved-query/abort-query.spec.js +51 -0
  42. package/integration/sparql-editor/saved-query/delete-query.spec.js +56 -0
  43. package/integration/sparql-editor/saved-query/edit-query.spec.js +68 -0
  44. package/integration/sparql-editor/saved-query/share-query.spec.js +78 -0
  45. package/integration/sparql-editor/sparql-editor.spec.js +55 -0
  46. package/integration/sparql-editor/yasgui-tabs.spec.js +107 -0
  47. package/integration/sparql-editor/yasr/download-as.spec.js +54 -0
  48. package/integration/sparql-editor/yasr/pagination.spec.js +234 -0
  49. package/integration/sparql-editor/yasr/table-plugin.spec.js +39 -0
  50. package/integration/sparql-editor/yasr/toolbar/visual-graph-button.spec.js +57 -0
  51. package/integration-flaky/explore/visual.graph.spec.js +3 -2
  52. package/integration-flaky/setup/sparql-template-create.js +139 -0
  53. package/integration-flaky/sparql-editor/actions/execute-update-query.spec.js +89 -0
  54. package/integration-flaky/sparql-editor/actions/share-query.spec.js +84 -0
  55. package/integration-flaky/sparql-editor/lucene-connector.spec.js +62 -0
  56. package/integration-flaky/sparql-editor/plugins/error-plugin.spec.js +83 -0
  57. package/integration-flaky/sparql-editor/yasr/table-plugin.spec.js +81 -0
  58. package/package.json +3 -1
  59. package/steps/application-steps.js +5 -0
  60. package/steps/autocomplete-steps.js +10 -0
  61. package/steps/error-steps.js +9 -0
  62. package/steps/explore/graphs-overview-steps.js +24 -0
  63. package/steps/explore/similarity-index-create-steps.js +113 -0
  64. package/steps/explore/similarity-indexes-steps.js +18 -0
  65. package/steps/guides/guide-dialog-steps.js +38 -0
  66. package/steps/guides/guide-steps.js +278 -0
  67. package/steps/guides/movies-guide-steps.js +241 -0
  68. package/steps/guides/star-wars-guide-steps.js +188 -0
  69. package/steps/import-steps.js +16 -0
  70. package/steps/language-selector-steps.js +22 -0
  71. package/steps/loader-steps.js +10 -0
  72. package/steps/lucene-connector-steps.js +43 -0
  73. package/steps/main-menu-steps.js +67 -0
  74. package/steps/repository-selector-steps.js +26 -0
  75. package/steps/repository-steps.js +4 -0
  76. package/steps/resource/resource-edit-steps.js +111 -0
  77. package/steps/resource/resource-steps.js +149 -0
  78. package/steps/setup/acl-management-steps.js +201 -39
  79. package/steps/setup/jdbc-create-steps.js +97 -0
  80. package/steps/setup/jdbc-steps.js +42 -0
  81. package/steps/setup/sparql-create-update-steps.js +55 -0
  82. package/steps/setup/sparql-templates-steps.js +38 -0
  83. package/steps/sparql-editor-steps.js +20 -0
  84. package/steps/sparql-steps.js +0 -6
  85. package/steps/visual-graph-steps.js +365 -6
  86. package/steps/yasgui/confirmation-dialog-steps.js +13 -0
  87. package/steps/yasgui/pagination-steps.js +47 -0
  88. package/steps/yasgui/plugin/error-plugin-steps.js +30 -0
  89. package/steps/yasgui/save-query-dialog.js +61 -0
  90. package/steps/yasgui/saved-queries-dialog.js +29 -0
  91. package/steps/yasgui/saved-query.js +25 -0
  92. package/steps/yasgui/share-saved-query-dialog.js +25 -0
  93. package/steps/yasgui/table-plugin-steps.js +29 -0
  94. package/steps/yasgui/yasgui-loader.js +10 -0
  95. package/steps/yasgui/yasgui-steps.js +191 -0
  96. package/steps/yasgui/yasqe-steps.js +187 -0
  97. package/steps/yasgui/yasr-steps.js +108 -0
  98. package/stubs/namespace-stubs.js +10 -0
  99. package/stubs/repositories-stub.js +58 -0
  100. package/stubs/security-stubs.js +69 -0
  101. package/stubs/yasgui/connectors-stubs.js +12 -0
  102. package/stubs/yasgui/query-stubs.js +253 -0
  103. package/support/index.js +3 -0
  104. package/support/repository-commands.js +5 -5
  105. package/support/sparql-commands.js +1 -1
  106. package/support/visual-graph-commands.js +25 -0
  107. package/integration/sparql/main.menu.spec.js +0 -232
  108. package/integration/sparql/sparql-error-handling.spec.js +0 -74
  109. package/integration/sparql/sparql-language-change.spec.js +0 -58
  110. package/integration/sparql/sparql-result-formating.spec.js +0 -84
  111. package/integration/sparql/sparql.menu.spec.js +0 -1253
  112. package/integration-flaky/setup/sparql-templates.spec.js +0 -125
  113. package/integration-flaky/sparql/sparql-language-change.spec.js +0 -45
  114. package/integration-flaky/sparql/sparql.menu.spec.js +0 -75
@@ -0,0 +1,191 @@
1
+ export class YasguiSteps {
2
+
3
+ static getYasgui() {
4
+ return cy.get('.yasgui');
5
+ }
6
+
7
+ static getYasguiTag() {
8
+ return cy.get('ontotext-yasgui');
9
+ }
10
+
11
+ static openANewTab() {
12
+ cy.get('button.addTab').click();
13
+ }
14
+
15
+ static closeTab(index) {
16
+ this.getTabs().eq(index).find('.closeTab').click();
17
+ }
18
+
19
+ static getTabs() {
20
+ return cy.get('.tab');
21
+ }
22
+
23
+ static getCurrentTab() {
24
+ return cy.get('.tab.active');
25
+ }
26
+
27
+ static getCurrentTabTitle() {
28
+ return this.getCurrentTab().find('[role=tab] > div');
29
+ }
30
+
31
+ static openTab(index) {
32
+ this.getTabs().eq(index).click();
33
+ }
34
+
35
+ static openTabContextMenu(index) {
36
+ this.getTabs().eq(index).rightclick();
37
+ return TabContextMenu.getContextMenu();
38
+ }
39
+
40
+ static getTabQuery(tabIndex) {
41
+ return cy.get('.yasqe .CodeMirror').then((el) => {
42
+ return el[tabIndex].CodeMirror.getValue();
43
+ });
44
+ }
45
+
46
+ static getCreateSavedQueryButton() {
47
+ return cy.get('.yasqe_createSavedQueryButton');
48
+ }
49
+
50
+ static createSavedQuery() {
51
+ this.getCreateSavedQueryButton().click();
52
+ }
53
+
54
+ static getShowSavedQueriesButton() {
55
+ return cy.get('.yasqe_showSavedQueriesButton');
56
+ }
57
+
58
+ static showSavedQueries() {
59
+ this.getShowSavedQueriesButton().click();
60
+ }
61
+
62
+ static getYasguiModeButton() {
63
+ return cy.get('.btn-mode-yasgui');
64
+ }
65
+
66
+ static isYasguiModeSelected() {
67
+ return this.getYasguiModeButton().should('have.class', 'btn-selected');
68
+ }
69
+
70
+ static isYasguiModeDeselected() {
71
+ return this.getYasguiModeButton().should('not.have.class', 'btn-selected');
72
+ }
73
+
74
+ static getYasqeModeButton() {
75
+ return cy.get('.btn-mode-yasqe');
76
+ }
77
+
78
+ static isYasqeModeSelected() {
79
+ return this.getYasqeModeButton().should('have.class', 'btn-selected');
80
+ }
81
+
82
+ static isYasqeModeDeselected() {
83
+ return this.getYasqeModeButton().should('not.have.class', 'btn-selected');
84
+ }
85
+
86
+ static isVerticalOrientation() {
87
+ this.getYasguiTag().should('have.class', 'orientation-vertical');
88
+ }
89
+
90
+ static getYasrModeButton() {
91
+ return cy.get('.btn-mode-yasr');
92
+ }
93
+
94
+ static isYasrModeSelected() {
95
+ return this.getYasrModeButton().should('have.class', 'btn-selected');
96
+ }
97
+
98
+ static getOrientationButton() {
99
+ return cy.get('.btn-orientation');
100
+ }
101
+
102
+ static isBtnOrientationVerticalOrientation() {
103
+ this.getOrientationButton().should('not.have.class', 'icon-rotate-90');
104
+ }
105
+
106
+ static isBtnOrientationHorizontalOrientation() {
107
+ this.getOrientationButton().should('have.class', 'icon-rotate-90');
108
+ }
109
+
110
+ static switchToModeYasgui() {
111
+ this.getYasguiModeButton().click();
112
+ }
113
+
114
+ static switchToModeYasqe() {
115
+ this.getYasqeModeButton().click();
116
+ }
117
+
118
+ static switchToModeYasr() {
119
+ this.getYasrModeButton().click();
120
+ }
121
+
122
+ static toggleOrientation() {
123
+ this.getOrientationButton().click();
124
+ }
125
+
126
+ static getHideToolbarButton() {
127
+ return cy.get('#hideToolbar');
128
+ }
129
+
130
+ static hideToolbar() {
131
+ this.getHideToolbarButton().click();
132
+ }
133
+
134
+ static getShowToolbarButton() {
135
+ return cy.get('#showToolbar');
136
+ }
137
+
138
+ static showToolbar() {
139
+ this.getShowToolbarButton().click();
140
+ }
141
+
142
+ static getToolbar() {
143
+ return cy.get('.yasgui-toolbar');
144
+ }
145
+
146
+ static showLayoutOrientationButtonTooltip() {
147
+ YasguiSteps.getOrientationButton().trigger('mouseover');
148
+ }
149
+
150
+ static hideLayoutOrientationButtonTooltip() {
151
+ YasguiSteps.getOrientationButton().trigger('mouseleave');
152
+ }
153
+
154
+ static isYasrModeDeselected() {
155
+ return this.getYasrModeButton().should('not.have.class', 'btn-selected');
156
+ }
157
+
158
+ static isHorizontalOrientation() {
159
+ this.getYasguiTag().should('have.class', 'orientation-horizontal');
160
+ }
161
+
162
+ static getDeleteQueryConfirmation() {
163
+ return cy.get('.confirmation-dialog');
164
+ }
165
+
166
+ static rejectDeleteOperation() {
167
+ this.getDeleteQueryConfirmation().find('.cancel-button').click();
168
+ }
169
+
170
+ static confirmDeleteOperation() {
171
+ this.getDeleteQueryConfirmation().find('.confirm-button').click();
172
+ }
173
+
174
+ static getTooltipRoot() {
175
+ return cy.get('div[data-tippy-root]');
176
+ }
177
+ }
178
+
179
+ export class TabContextMenu {
180
+ static getContextMenu() {
181
+ return cy.get('.yasgui .context-menu');
182
+ }
183
+
184
+ static closeTab() {
185
+ this.getContextMenu().contains('Close Tab').click();
186
+ }
187
+
188
+ static closeOtherTabs() {
189
+ this.getContextMenu().contains('Close other tabs').click();
190
+ }
191
+ }
@@ -0,0 +1,187 @@
1
+ import {YasrSteps} from "./yasr-steps";
2
+
3
+ export class YasqeSteps {
4
+ static getYasqe() {
5
+ return cy.get('.tabPanel.active .yasqe');
6
+ }
7
+
8
+ static getQueryTabs() {
9
+ return cy.get('.tabsList');
10
+ }
11
+
12
+ static getEditor() {
13
+ return YasqeSteps.getYasqe();
14
+ }
15
+
16
+ static getCodeMirror() {
17
+ return this.getEditor().find('.CodeMirror').then(($el) => {
18
+ // @ts-ignore
19
+ return $el[0].CodeMirror;
20
+ });
21
+ }
22
+
23
+ static getActiveTabCodeMirror() {
24
+ return this.getYasqe().find('.CodeMirror').then(($el) => {
25
+ // @ts-ignore
26
+ return $el[0].CodeMirror;
27
+ });
28
+ }
29
+
30
+ static getExecuteQueryButton() {
31
+ return YasqeSteps.getYasqe().find('.yasqe_queryButton');
32
+ }
33
+
34
+ static executeQuery() {
35
+ this.getExecuteQueryButton().click();
36
+ YasrSteps.getResponseInfo()
37
+ .should('not.have.class', 'hidden')
38
+ .should('not.have.class', 'empty')
39
+ .should('be.visible');
40
+ }
41
+
42
+ static executeQueryWithoutWaiteResult() {
43
+ this.getExecuteQueryButton().click();
44
+ }
45
+
46
+ static executeErrorQuery() {
47
+ this.getExecuteQueryButton().click();
48
+ // Wait a wile for the response information to be present.
49
+ cy.get('.error-response-plugin').should('be.visible');
50
+ }
51
+
52
+ static clearEditor() {
53
+ this.getCodeMirror().then((cm) => {
54
+ cm.getDoc().setValue('');
55
+ });
56
+ }
57
+
58
+ /**
59
+ * Adds <code>text</code> to the end of current query.
60
+ * @param {string} text - text to be added.
61
+ */
62
+ static writeInEditor(text, parseSpecialCharSequences = false) {
63
+ YasqeSteps.getEditor().find('textarea').type(text, {force: true, parseSpecialCharSequences});
64
+ YasqeSteps.verifyQueryContains(text);
65
+ }
66
+
67
+ /**
68
+ * Paste query in Yasqe editor.
69
+ * This method is faster than {@link YasqeSteps.writeInEditor}, but the editor stay pristine, if you want editor to be touched use {@link YasqeSteps.writeInEditor}.
70
+ * @param {string} query - the new value of Yasqe.
71
+ */
72
+ static pasteQuery(query) {
73
+ this.clearEditor();
74
+ this.getCodeMirror().then((cm) => {
75
+ cm.getDoc().setValue(query);
76
+ });
77
+ YasqeSteps.verifyQueryTyped(query);
78
+ }
79
+
80
+ static waitUntilQueryIsVisible() {
81
+ return cy.waitUntil(() =>
82
+ this.getEditor().find('.CodeMirror')
83
+ .then((codeMirrorEl) =>
84
+ codeMirrorEl && codeMirrorEl[0].CodeMirror.getValue().trim().length > 0));
85
+ }
86
+
87
+ static verifyQueryTyped(query) {
88
+ return cy.waitUntil(() =>
89
+ this.getEditor().find('.CodeMirror')
90
+ .then((codeMirrorEl) => {
91
+ return codeMirrorEl && codeMirrorEl[0].CodeMirror.getValue().indexOf(query) !== -1;
92
+ }));
93
+ }
94
+
95
+ static verifyQueryContains(queryPart) {
96
+ this.getCodeMirror().then((cm) => {
97
+ expect(cm.getValue().replace(/\s/g, '')).contain(queryPart.replace(/\s/g, ''));
98
+ });
99
+ }
100
+
101
+ /**
102
+ * In certain scenarios we need to wait a bit before trying to get the query from the editor. For example, when the
103
+ * query is dynamically switched using the yasgui api, it may take some time before the old query gets replaced or
104
+ * removed from the editor.
105
+ * @param {number} delay The time in milliseconds to wait before trying to get the editor and its query.
106
+ * @return {Cypress.Chainable<unknown>}
107
+ */
108
+ static getQuery(delay = 0) {
109
+ return cy.wait(delay).then(() => this.getCodeMirror()).then((cm) => {
110
+ return cm.getValue();
111
+ });
112
+ }
113
+
114
+ static getActiveTabQuery(delay = 0) {
115
+ return cy.wait(delay).then(() => this.getActiveTabCodeMirror()).then((cm) => {
116
+ return cm.getValue();
117
+ });
118
+ }
119
+
120
+ static getControlBar() {
121
+ return cy.get('.controlbar');
122
+ }
123
+
124
+ static getIncludeInferredStatementsButton() {
125
+ return cy.get('.yasqe_inferStatementsButton');
126
+ }
127
+
128
+ static getIncludeInferredStatementsButtonTooltip() {
129
+ return this.getIncludeInferredStatementsButton().parent();
130
+ }
131
+
132
+ static includeInferredStatements() {
133
+ this.getIncludeInferredStatementsButton().click();
134
+ }
135
+
136
+ static getExpandResultsOverSameAsButton() {
137
+ return cy.get('.yasqe_expandResultsButton');
138
+ }
139
+
140
+ static getExpandResultsOverSameAsButtonTooltip() {
141
+ return this.getExpandResultsOverSameAsButton().parent();
142
+ }
143
+
144
+ static expandResultsOverSameAs() {
145
+ this.getExpandResultsOverSameAsButton().click();
146
+ }
147
+
148
+ static getShareQueryButton() {
149
+ return cy.get('.yasqe_shareQueryButton');
150
+ }
151
+
152
+ static shareQuery() {
153
+ this.getShareQueryButton().click();
154
+ }
155
+
156
+ static getAbortQueryButton() {
157
+ return cy.get('.abort-button');
158
+ }
159
+
160
+ static hoverOverAbortQueryButton() {
161
+ YasqeSteps.getAbortQueryButton().realHover();
162
+ }
163
+
164
+ static getAbortQueryTooltip() {
165
+ return YasqeSteps.getAbortQueryButton().parent();
166
+ }
167
+
168
+ static getActionsToolbar() {
169
+ return YasqeSteps.getEditor().find('.yasqe_buttons');
170
+ }
171
+
172
+ static getActionButtonsTooltips() {
173
+ return YasqeSteps.getActionsToolbar().find('yasgui-tooltip');
174
+ }
175
+
176
+ static getActionButtonTooltip(index) {
177
+ return YasqeSteps.getActionButtonsTooltips().eq(index);
178
+ }
179
+
180
+ static getActionButtons() {
181
+ return YasqeSteps.getActionsToolbar().find('.custom-button');
182
+ }
183
+
184
+ static getActionButton(index) {
185
+ return YasqeSteps.getActionButtons().eq(index);
186
+ }
187
+ }
@@ -0,0 +1,108 @@
1
+ export class YasrSteps {
2
+ static getYasr() {
3
+ return cy.get('.tabPanel.active .yasr');
4
+ }
5
+
6
+ static getResultHeader() {
7
+ return cy.get('.yasr_header');
8
+ }
9
+
10
+ static getResponseInfo() {
11
+ return YasrSteps.getYasr().find('.yasr_response_chip');
12
+ }
13
+
14
+ static getErrorHeader() {
15
+ return YasrSteps.getResultHeader().get('.errorHeader');
16
+ }
17
+
18
+ static getErrorBody() {
19
+ return YasrSteps.getResultHeader().get('.error-response-plugin-body');
20
+ }
21
+
22
+ static getYasrResultsContainer() {
23
+ return YasrSteps.getYasr().find('.yasr_results');
24
+ }
25
+
26
+ static getResults() {
27
+ return YasrSteps.getYasr().find('.yasr_results tbody').find('tr');
28
+ }
29
+
30
+ static getResultTableHeader() {
31
+ return cy.get('.yasr_results thead');
32
+ }
33
+
34
+ static getResultTableHeaderColumns() {
35
+ return YasrSteps.getResultTableHeader().find('th');
36
+ }
37
+
38
+ static getResultFilter() {
39
+ return cy.get('.tableFilter');
40
+ }
41
+
42
+ static getResultRow(rowNumber) {
43
+ return this.getResults().eq(rowNumber);
44
+ }
45
+
46
+ static getResultRowCells(rowNumber) {
47
+ return YasrSteps.getResultRow(rowNumber).find('td');
48
+ }
49
+
50
+ static getResultCell(rowNumber, cellNumber) {
51
+ return YasrSteps.getResultRowCells(rowNumber).eq(cellNumber);
52
+ }
53
+
54
+ static getResultLink(rowNumber, cellNumber) {
55
+ return YasrSteps.getResultCell(rowNumber, cellNumber).find('a');
56
+ }
57
+
58
+ static hoverCell(rowNumber, cellNumber) {
59
+ this.getResultCell(rowNumber, cellNumber).realHover();
60
+ }
61
+
62
+ static getCopyResourceLink(rowNumber, cellNumber) {
63
+ return this.getResultCell(rowNumber, cellNumber)
64
+ .realHover()
65
+ .find('.copy-resource-link-button a');
66
+ }
67
+
68
+ static showSharedResourceLink(rowNumber, cellNumber) {
69
+ return this.getResultCell(rowNumber, cellNumber)
70
+ .find('.copy-resource-link-button a');
71
+ }
72
+
73
+ static copyResourceLink(rowNumber, cellNumber) {
74
+ this.showSharedResourceLink(rowNumber, cellNumber).realClick();
75
+ }
76
+
77
+ static getDownloadAsDropdown() {
78
+ return this.getYasr().find('ontotext-download-as');
79
+ }
80
+
81
+ static openDownloadAsDropdown() {
82
+ this.getDownloadAsDropdown().click();
83
+ }
84
+
85
+ static getDownloadAsOption(number) {
86
+ return this.getDownloadAsDropdown().find('.ontotext-dropdown-menu-item').eq(number);
87
+ }
88
+
89
+ static getPagination() {
90
+ return YasrSteps.getYasr().find('.ontotext-pagination');
91
+ }
92
+
93
+ static getYasrToolbar() {
94
+ return YasrSteps.getYasr().find('.yasr-toolbar');
95
+ }
96
+
97
+ static getVisualButton() {
98
+ return YasrSteps.getYasrToolbar().find('.explore-visual-graph-button');
99
+ }
100
+
101
+ static getNoDataElement() {
102
+ return cy.get('.dataTables_empty');
103
+ }
104
+
105
+ static getNoResultsMessage() {
106
+ return YasrSteps.getYasr().find('.alert-success');
107
+ }
108
+ }
@@ -0,0 +1,10 @@
1
+ export class NamespaceStubs {
2
+
3
+ static stubGeneratedOntotextNamespacesResponse(repositoryId, withDelay = 0) {
4
+ NamespaceStubs.stubNameSpaceResponse(repositoryId, '/namespaces/ontotext-generated-namespace.json', withDelay);
5
+ }
6
+
7
+ static stubNameSpaceResponse(repositoryId, fixture, withDelay = 0) {
8
+ cy.intercept(`/repositories/${repositoryId}/namespaces`, {fixture, delay: withDelay}).as(`${repositoryId}-stub-namespaces`);
9
+ }
10
+ }
@@ -0,0 +1,58 @@
1
+ export class RepositoriesStub {
2
+
3
+ static stubOntopRepository(repositoryId) {
4
+ const alRepositoryResponse = `{
5
+ "":[{
6
+ "id": "${repositoryId}",
7
+ "title": "",
8
+ "uri": "http://b:9000/repositories/${repositoryId}",
9
+ "externalUrl": "http://b:9000/repositories/${repositoryId}",
10
+ "local": true,
11
+ "type": "ontop",
12
+ "sesameType": "graphdb:OntopRepository",
13
+ "location": "",
14
+ "readable": true,
15
+ "writable": true,
16
+ "unsupported": false,
17
+ "state": "RUNNING"
18
+ }]}`;
19
+
20
+
21
+ cy.intercept('GET', '/rest/repositories/all', {
22
+ statusCode: 200,
23
+ body: alRepositoryResponse
24
+ });
25
+ }
26
+
27
+ /**
28
+ * @param {string} repositoryId
29
+ * @param {[]}namespaces - An instance of array object have to be:
30
+ * {
31
+ * "prefix" : {
32
+ * "type" : "literal",
33
+ * "value" : "agg"
34
+ * },
35
+ * "namespace" : {
36
+ * "type" : "literal",
37
+ * "value" : "http://jena.apache.org/ARQ/function/aggregate#"
38
+ * }
39
+ * }
40
+ */
41
+ static stubNameSpaces(repositoryId, namespaces = []) {
42
+ const namespacesResponse = `{
43
+ "head" : {
44
+ "vars" : [
45
+ "prefix",
46
+ "namespace"
47
+ ]
48
+ },
49
+ "results" : {
50
+ "bindings" : ${JSON.stringify(namespaces)}
51
+ }
52
+ }`;
53
+ cy.intercept('GET', `/repositories/${repositoryId}/namespaces`, {
54
+ statusCode: 200,
55
+ body: namespacesResponse
56
+ });
57
+ }
58
+ }
@@ -0,0 +1,69 @@
1
+ export class SecurityStubs {
2
+
3
+ static stubUserSecurity(infer = true, sameAs = true, userName = 'admin') {
4
+ cy.intercept(`rest/security/users/${userName}`, (req) => {
5
+ req.reply(SecurityStubs.getAdminResponse(infer, sameAs));
6
+ }).as('security-get-admin');
7
+ }
8
+
9
+ static stubInferAndSameAsDefaults() {
10
+ cy.intercept('rest/security/all', (req) => {
11
+ req.reply(SecurityStubs.getResponseSecurityEnabled());
12
+ }).as('security-all');
13
+ }
14
+
15
+ static getAdminResponse(infer, sameAs) {
16
+ return {
17
+ "username": "admin",
18
+ "password": "",
19
+ "grantedAuthorities": [
20
+ "ROLE_ADMIN"
21
+ ],
22
+ "appSettings": {
23
+ "DEFAULT_INFERENCE": infer,
24
+ "DEFAULT_VIS_GRAPH_SCHEMA": true,
25
+ "DEFAULT_SAMEAS": sameAs,
26
+ "IGNORE_SHARED_QUERIES": false,
27
+ "EXECUTE_COUNT": true
28
+ },
29
+ "dateCreated": 1663139335552
30
+ };
31
+ }
32
+
33
+ static getResponseSecurityEnabled() {
34
+ return {
35
+ "freeAccess": {
36
+ "enabled": false,
37
+ "authorities": [],
38
+ "appSettings": {
39
+ "DEFAULT_INFERENCE": true,
40
+ "DEFAULT_VIS_GRAPH_SCHEMA": true,
41
+ "DEFAULT_SAMEAS": true,
42
+ "IGNORE_SHARED_QUERIES": false,
43
+ "EXECUTE_COUNT": true
44
+ }
45
+ },
46
+ "overrideAuth": {
47
+ "enabled": false,
48
+ "authorities": [
49
+ "ROLE_REPO_MANAGER",
50
+ "ROLE_MONITORING",
51
+ "ROLE_USER"
52
+ ],
53
+ "appSettings": {
54
+ "DEFAULT_INFERENCE": true,
55
+ "DEFAULT_VIS_GRAPH_SCHEMA": true,
56
+ "DEFAULT_SAMEAS": true,
57
+ "IGNORE_SHARED_QUERIES": false,
58
+ "EXECUTE_COUNT": true
59
+ }
60
+ },
61
+ "methodSettings": {},
62
+ "enabled": false,
63
+ "passwordLoginEnabled": true,
64
+ "hasExternalAuth": false,
65
+ "authImplementation": "Local",
66
+ "openIdEnabled": false
67
+ };
68
+ }
69
+ }
@@ -0,0 +1,12 @@
1
+ export class ConnectorsStubs {
2
+
3
+ static stubLuceneHasNotSupport() {
4
+ ConnectorsStubs.stubCheckConnector('create', 'lucene-connector', 'Lucene', false);
5
+ }
6
+
7
+ static stubCheckConnector(command, connectorName, pluginName, hasSupport) {
8
+ cy.intercept(`rest/connectors/check`, (req) => {
9
+ req.reply({command, connectorName, pluginName, hasSupport});
10
+ }).as(`query-connector-has-not-support`);
11
+ }
12
+ }