graphdb-workbench-tests 2.5.1 → 2.6.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.
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 +44 -10
  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 +220 -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 +193 -35
  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
@@ -1,21 +1,32 @@
1
- class VisualGraphSteps {
1
+ const VIEW_URL = '/graphs-visualizations';
2
+ const VALID_RESOURCE = 'USRegion';
3
+
4
+ export class VisualGraphSteps {
5
+
6
+ static visit() {
7
+ cy.visit(VIEW_URL);
8
+ }
9
+
10
+ static verifyUrl() {
11
+ cy.url().should('include', `${Cypress.config('baseUrl')}${VIEW_URL}`);
12
+ }
2
13
 
3
14
  static updateGraphConfiguration(namedGraph) {
4
15
  cy.get('[data-cy="save-or-update-graph"]').click()
5
- .get( '[id="wb-graphviz-savegraph-name"]').type(namedGraph)
16
+ .get('[id="wb-graphviz-savegraph-name"]').type(namedGraph)
6
17
  .get('[id="wb-graphviz-savegraph-submit"]').should('be.visible').click();
7
18
  cy.get('.toast').contains('Saved graph ' + namedGraph + ' was saved');
8
19
  }
9
20
 
10
21
  static deleteSavedGraph(renamedGraph) {
11
- cy.contains('td', renamedGraph).parent().within( () => {
22
+ cy.contains('td', renamedGraph).parent().within(() => {
12
23
  cy.get('[data-cy="delete-saved-graph"]').should('be.visible').click();
13
24
  });
14
25
  VisualGraphSteps.confirmDelete();
15
26
  }
16
27
 
17
28
  static deleteGraphConfig(graphConfigName) {
18
- cy.contains('td', graphConfigName).parent().within( () => {
29
+ cy.contains('td', graphConfigName).parent().within(() => {
19
30
  cy.get('[data-cy="delete-graph-config"]').should('be.visible').click();
20
31
  });
21
32
  VisualGraphSteps.confirmDelete();
@@ -26,6 +37,354 @@ class VisualGraphSteps {
26
37
  cy.get('.modal').should('not.exist');
27
38
  }
28
39
 
29
- }
40
+ // ============================
41
+
42
+ // Visual graph home view access
43
+
44
+ static getSearchField() {
45
+ return cy.get('.search-rdf-resources input:visible');
46
+ }
47
+
48
+ static getGraphVisualizationPane() {
49
+ return cy.get('.graph-visualization');
50
+ }
51
+
52
+ static searchForResource(resource) {
53
+ // verify that the easy graph search has occured and a valid resource was input and only
54
+ // after that execute the next operation
55
+ cy.searchEasyVisualGraph(resource)
56
+ .then(() => {
57
+ // Verify redirection to existing visual graph
58
+ cy.waitUntil(() =>
59
+ cy.get('.graph-visualization')
60
+ .find('.nodes-container')
61
+ .then((nodesContainer) => nodesContainer))
62
+ .then(() => {
63
+ this.getNodes();
64
+ });
65
+ });
66
+ }
67
+
68
+ static getTargetNodeElement() {
69
+ return cy.get(`[id="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#${VALID_RESOURCE}"] circle`).should('be.visible');
70
+ }
71
+
72
+ static getTargetNode() {
73
+ // The wait is needed because mouseover event will result in
74
+ // pop-up of menu icons only if nodes are not moving
75
+ return this.getTargetNodeElement().wait(5000);
76
+ }
77
+
78
+ static getNodes() {
79
+ return cy.get('.node-wrapper').should('be.visible');
80
+ }
81
+
82
+ static getPredicates() {
83
+ return cy.get('.predicate');
84
+ }
85
+
86
+ static getNodeInfoPanel() {
87
+ return cy.get('.rdf-info-side-panel .tab-content');
88
+ }
89
+
90
+ static getCircleOfNodeByNodeId(nodeId) {
91
+ return cy.get(`[id="${nodeId}"] circle`);
92
+ }
93
+
94
+ static getLineBetweenNodesById(narrowId) {
95
+ return cy.get(`[id="${narrowId}"] line`);
96
+ }
97
+
98
+ static getSettingsPanel() {
99
+ return cy.get('.rdf-info-side-panel .filter-sidepanel');
100
+ }
101
+
102
+ static getSidePanelCloseButton() {
103
+ return cy.get('');
104
+ }
105
+
106
+ static getSidePanelContent() {
107
+ return cy.get('.rdf-side-panel-content');
108
+ }
109
+
110
+ // Visual graph settings form field access
111
+
112
+ static openPredicatesTab() {
113
+ cy.get('.predicates-tab').should('be.visible').click();
114
+ }
115
+
116
+ static showPreferredTypes(enable) {
117
+ const command = enable ? 'check' : 'uncheck';
118
+ this.getShowPreferredTypesOnlyCheckbox()[command]();
119
+ }
120
+
121
+ static toggleInferredStatements(enable) {
122
+ this.openVisualGraphSettings();
123
+ this.getSettingsPanel().should('be.visible');
124
+ const command = enable ? 'check' : 'uncheck';
125
+ this.getIncludeInferredStatementsCheckbox()[command]();
126
+ this.saveSettings();
127
+ }
128
+
129
+ static getLinksNumberField() {
130
+ // This element could not be checked with 'be.visible' because it has
131
+ // CSS property: 'position: fixed' and its being covered by another element
132
+ return cy.get('.input-number');
133
+ }
134
+
135
+ static getSaveSettingsButton() {
136
+ return cy.get('.save-settings-btn').scrollIntoView().should('be.visible');
137
+ }
138
+
139
+ static saveSettings() {
140
+ this.getSaveSettingsButton().click();
141
+ }
142
+
143
+ static getResetSettingsButton() {
144
+ return cy.get('.reset-settings').scrollIntoView().should('be.visible');
145
+ }
146
+
147
+ static resetSettings() {
148
+ this.getResetSettingsButton().click();
149
+ }
150
+
151
+ static getSameAsCheckbox() {
152
+ return cy.get('#sameAsCheck').should('be.visible');
153
+ }
154
+
155
+ static getIncludeInferredStatementsCheckbox() {
156
+ return cy.get('.include-inferred-statements').should('be.visible');
157
+ }
158
+
159
+ static getShowPredicateLabelsCheckbox() {
160
+ return cy.get('.show-predicate-labels').should('be.visible');
161
+ }
162
+
163
+ static getPreferredTypesField() {
164
+ return cy.get('.preferred-types input').scrollIntoView().should('be.visible');
165
+ }
166
+ static getShowPreferredTypesOnlyCheckbox() {
167
+ return cy.get('.show-preferred-types-only').should('be.visible');
168
+ }
169
+
170
+ static getIgnoredTypesField() {
171
+ // This element could not be checked with 'be.visible' because it has
172
+ // CSS property: 'position: fixed' and its being covered by another element
173
+ return cy.get('.ignored-types input');
174
+ }
175
+
176
+ static getPreferredPredicatesField() {
177
+ return cy.get('.preferred-predicates input').should('be.visible');
178
+ }
179
+
180
+ static getShowPreferredPredicatesOnlyCheckbox() {
181
+ return cy.get('.show-preferred-predicates-only').should('be.visible');
182
+ }
183
+
184
+ static getIgnoredPredicatesField() {
185
+ // This element could not be checked with 'be.visible' because it has
186
+ // CSS property: 'position: fixed' and its being covered by another element
187
+ return cy.get('.ignored-predicates input');
188
+ }
189
+
190
+ static getCreateCustomGraphLink() {
191
+ return cy.get('.create-graph-config').should('be.visible');
192
+ }
193
+
194
+ static getGraphConfigName() {
195
+ return cy.get('.graph-config-name').should('be.visible');
196
+ }
197
+
198
+ static typeGraphConfigName(name) {
199
+ this.getGraphConfigName().type(name);
200
+ }
201
+
202
+ static getSaveConfigButton() {
203
+ return cy.get('.btn-save-config');
204
+ }
205
+
206
+ static saveConfig() {
207
+ this.getSaveConfigButton().click();
208
+ }
209
+
210
+ static getCanceSaveConfigButton() {
211
+ return cy.get('.btn-cancel-save-config');
212
+ }
213
+
214
+ static cancelSaveConfig() {
215
+ this.getCanceSaveConfigButton().click();
216
+ }
217
+
218
+ static getGraphConfigurationsArea() {
219
+ return cy.get('.graph-configurations');
220
+ }
30
221
 
31
- export default VisualGraphSteps;
222
+ static getGraphConfigs() {
223
+ return this.getGraphConfigurationsArea().find('.graph-configurations-list tr');
224
+ }
225
+
226
+ static getGraphConfig(name) {
227
+ return this.getGraphConfigs().contains(name);
228
+ }
229
+
230
+ static openGraphConfig(name) {
231
+ this.getGraphConfig(name).click();
232
+ }
233
+
234
+ static editConfig(name) {
235
+ this.getGraphConfig(name).closest('tr').find('.btn-edit-config').click();
236
+ }
237
+
238
+ static deleteConfig(name) {
239
+ this.getGraphConfig(name).closest('tr').find('.delete-config').click();
240
+ }
241
+
242
+ static getGraphConfigSearchPanel() {
243
+ return cy.get('.search-bar');
244
+ }
245
+
246
+ static getGraphConfigSearchPanelName() {
247
+ return this.getGraphConfigSearchPanel().find('.graph-config-name');
248
+ }
249
+
250
+ // Node actions
251
+
252
+ static collapseGraph() {
253
+ cy.get('.menu-events .collapse-icon circle').should('be.visible').click();
254
+ }
255
+
256
+ static expandGraph() {
257
+ cy.get('.menu-events .expand-icon circle').should('be.visible').click();
258
+ }
259
+
260
+ static removeNode() {
261
+ cy.get('.menu-events .close-icon circle').click({force: true});
262
+ }
263
+
264
+ // Visual graph toolbar actions
265
+
266
+ static openVisualGraphSettings() {
267
+ return cy.get('.toolbar-holder').should('be.visible')
268
+ .find('.visual-graph-settings-btn')
269
+ .should('be.visible').click();
270
+ }
271
+
272
+ static openVisualGraphHome() {
273
+ cy.get('.toolbar-holder').should('be.visible')
274
+ .find('.return-home-btn').should('be.visible').click();
275
+ }
276
+
277
+ static updateLinksLimitField(value) {
278
+ return this.getLinksNumberField().invoke('val', value).trigger('change', {force: true});
279
+ }
280
+
281
+ static getNextPageButton() {
282
+ return cy.get(`.btn-next-page`);
283
+ }
284
+
285
+ static goToNextPage() {
286
+ this.getNextPageButton().click();
287
+ }
288
+
289
+ static getPreviousPageButton() {
290
+ return cy.get(`.btn-previous-page`);
291
+ }
292
+
293
+ static goToPreviousPage() {
294
+ this.getPreviousPageButton().click();
295
+ }
296
+
297
+ static getConfigWizardTab(index) {
298
+ return cy.get(`.page-${index}-link`);
299
+ }
300
+
301
+ static openConfigWizardTab(index) {
302
+ this.getConfigWizardTab(index).click();
303
+ }
304
+
305
+ static getStartModes() {
306
+ return cy.get('.start-mode');
307
+ }
308
+
309
+ static getStartMode(type) {
310
+ return this.getStartModes().filter(`.${type}`);
311
+ }
312
+
313
+ static getStartModeSelector(type) {
314
+ return this.getStartMode(type).find('input');
315
+ }
316
+
317
+ static selectStartMode(type) {
318
+ this.getStartMode(type).click();
319
+ }
320
+
321
+ static getQueryEditor() {
322
+ return cy.get(".yasqe:visible");
323
+ }
324
+
325
+ static getPredefinedQuerySamples() {
326
+ return cy.get('.predefined-queries .predefined-query');
327
+ }
328
+
329
+ static selectPredefinedQuerySample(index) {
330
+ this.getPredefinedQuerySamples().eq(index).click();
331
+ }
332
+
333
+ static getUserQuerySamples() {
334
+ return cy.get('.user-queries .user-query');
335
+ }
336
+
337
+ static selectUserQuerySample(index) {
338
+ this.getUserQuerySamples().eq(index).click();
339
+ }
340
+
341
+ static getHelpInfoBox() {
342
+ return cy.get('.help-box');
343
+ }
344
+
345
+ static getStartNodeSelectorComponent() {
346
+ return cy.get('.start-node-selector');
347
+ }
348
+
349
+ static getStartNodeSelectorField() {
350
+ return cy.get('.view-res-input');
351
+ }
352
+
353
+ static getResultItemField() {
354
+ return cy.get('#auto-complete-results-wrapper .result-item');
355
+ }
356
+
357
+ static selectStartNode(uri, index) {
358
+ cy.get('.graph-config-wizard-body .view-res-input').type(uri)
359
+ .closest('.start-node-selector')
360
+ .find('#auto-complete-results-wrapper .result-item').eq(index).click();
361
+ }
362
+
363
+ static getSelectedStartNodeUri() {
364
+ return this.getStartNodeSelectorComponent().find('.selected-node code');
365
+ }
366
+
367
+ static getPreviewQueryResultsButton() {
368
+ return cy.get('.btn-preview-query-results');
369
+ }
370
+
371
+ static previewQueryResults() {
372
+ this.getPreviewQueryResultsButton().click();
373
+ }
374
+
375
+ static editQuery() {
376
+ cy.get('.btn-show-query-editor').click();
377
+ }
378
+
379
+ static getRevertQueryButton() {
380
+ return cy.get('.btn-revert-query');
381
+ }
382
+
383
+ static revertQuery() {
384
+ this.getRevertQueryButton().click();
385
+ }
386
+
387
+ static getMainGroupElement() {
388
+ return cy.get('#classChart #main-group');
389
+ }
390
+ }
@@ -0,0 +1,13 @@
1
+ export class ConfirmationDialogSteps {
2
+ static getConfirmation() {
3
+ return cy.get('.confirmation-dialog');
4
+ }
5
+
6
+ static confirm() {
7
+ this.getConfirmation().find('.confirm-button').click();
8
+ }
9
+
10
+ static reject() {
11
+ this.getConfirmation().find('.cancel-button').click();
12
+ }
13
+ }
@@ -0,0 +1,47 @@
1
+ export class PaginationSteps {
2
+
3
+ static getPagination() {
4
+ return cy.get('.ontotext-pagination');
5
+ }
6
+
7
+ static getPageSelectors() {
8
+ return PaginationSteps.getPagination().find('.page-selectors');
9
+ }
10
+
11
+ static getPageNumberButtons() {
12
+ return PaginationSteps.getPageSelectors().find('.page-button');
13
+ }
14
+
15
+ static getNextPageButton() {
16
+ return PaginationSteps.getPageSelectors().find('.next-button');
17
+ }
18
+
19
+ static getPreviousPageButton() {
20
+ return PaginationSteps.getPageSelectors().find('.previous-button');
21
+ }
22
+
23
+ static getPageNumberButton(pageNumber) {
24
+ return PaginationSteps.getPagination().find(`button:contains("${pageNumber}")`);
25
+ }
26
+
27
+ static clickOnPageNumberButton(pageNumber) {
28
+ PaginationSteps.getPageNumberButton(pageNumber).scrollIntoView().click();
29
+ }
30
+
31
+ static clickOnNextPageButton() {
32
+ PaginationSteps.getNextPageButton().scrollIntoView().click();
33
+ }
34
+
35
+ static clickOnPreviousPageButton() {
36
+ PaginationSteps.getPreviousPageButton().scrollIntoView().click();
37
+ }
38
+
39
+ /**
40
+ * Checks when a page button is selected. When the button is selected this mean that current page is loaded.
41
+ * Use this method to wait until new page loaded.
42
+ * @param expectedPage - expected page.
43
+ */
44
+ static waitPageSelected(expectedPage) {
45
+ PaginationSteps.getPageNumberButton(expectedPage).should('have.class', 'selected-page');
46
+ }
47
+ }
@@ -0,0 +1,30 @@
1
+ export class ErrorPluginSteps {
2
+
3
+ static getErrorPlugin() {
4
+ return cy.get('.error-response-plugin');
5
+ }
6
+
7
+ static getErrorPluginHeader() {
8
+ return ErrorPluginSteps.getErrorPlugin().find('.error-response-plugin-header');
9
+ }
10
+
11
+ static getErrorPluginErrorStatus() {
12
+ return ErrorPluginSteps.getErrorPluginHeader().find('.error-response-plugin-error-status');
13
+ }
14
+
15
+ static getErrorPluginErrorTimeMessage() {
16
+ return ErrorPluginSteps.getErrorPluginHeader().find('.error-response-plugin-error-time-message');
17
+ }
18
+
19
+ static getErrorPluginBody() {
20
+ return ErrorPluginSteps.getErrorPlugin().find('.error-response-plugin-body');
21
+ }
22
+
23
+ static getShowFullErrorMessage() {
24
+ return cy.get('.show-full-message-link');
25
+ }
26
+
27
+ static getShowLessErrorMessage() {
28
+ return cy.get('.show-less-message-link');
29
+ }
30
+ }
@@ -0,0 +1,61 @@
1
+ export class SaveQueryDialog {
2
+ static getSaveQueryDialog() {
3
+ return cy.get('.dialog');
4
+ }
5
+
6
+ static closeSaveQueryDialog() {
7
+ this.getSaveQueryDialog().find('.close-button').click();
8
+ }
9
+
10
+ static cancelSaveQuery() {
11
+ this.getSaveQueryDialog().find('.cancel-button').click();
12
+ }
13
+
14
+ static getSaveQueryButton() {
15
+ return this.getSaveQueryDialog().find('.ok-button');
16
+ }
17
+
18
+ static saveQuery() {
19
+ this.getSaveQueryButton().click();
20
+ }
21
+
22
+ static getQueryField() {
23
+ return this.getSaveQueryDialog().find('#query');
24
+ }
25
+
26
+ static writeQuery(query) {
27
+ this.getQueryField().type(query, {parseSpecialCharSequences: false});
28
+ }
29
+
30
+ static clearQueryField() {
31
+ this.getQueryField().clear();
32
+ }
33
+
34
+ static getQueryNameField() {
35
+ return this.getSaveQueryDialog().find('#queryName');
36
+ }
37
+
38
+ static writeQueryName(queryName) {
39
+ this.getQueryNameField().type(queryName);
40
+ }
41
+
42
+ static clearQueryNameField() {
43
+ this.getQueryNameField().clear();
44
+ }
45
+
46
+ static toggleIsPublic() {
47
+ this.getSaveQueryDialog().find('#publicQuery').click();
48
+ }
49
+
50
+ static getIsPublicField() {
51
+ return this.getSaveQueryDialog().find('#publicQuery');
52
+ }
53
+
54
+ static getErrorsPane() {
55
+ return this.getSaveQueryDialog().find('.alert-danger');
56
+ }
57
+
58
+ static getErrors() {
59
+ return this.getErrorsPane().find('.error-message');
60
+ }
61
+ }
@@ -0,0 +1,29 @@
1
+ export class SavedQueriesDialog {
2
+ static getSavedQueriesPopup() {
3
+ return cy.get('.saved-queries-popup');
4
+ }
5
+
6
+ static getSavedQueries() {
7
+ return this.getSavedQueriesPopup().find('.saved-query');
8
+ }
9
+
10
+ static selectSavedQueryByIndex(index) {
11
+ this.getSavedQueries().eq(index).find('a').click();
12
+ }
13
+
14
+ static selectSavedQueryByName(name) {
15
+ this.getSavedQueries().contains(name).click();
16
+ }
17
+
18
+ static editQueryByName(name) {
19
+ this.getSavedQueries().contains(name).realHover().closest('.saved-query').find('.edit-saved-query').click();
20
+ }
21
+
22
+ static deleteQueryByName(name) {
23
+ this.getSavedQueries().contains(name).realHover().closest('.saved-query').find('.delete-saved-query').click();
24
+ }
25
+
26
+ static shareQueryByName(name) {
27
+ this.getSavedQueries().contains(name).realHover().closest('.saved-query').find('.share-saved-query').click();
28
+ }
29
+ }
@@ -0,0 +1,25 @@
1
+ import {YasguiSteps} from "./yasgui-steps";
2
+ import {SaveQueryDialog} from "./save-query-dialog";
3
+ import {ApplicationSteps} from "../application-steps";
4
+
5
+ export const DEFAULT_QUERY = 'select *';
6
+
7
+ export class SavedQuery {
8
+
9
+ static create(queryName, query) {
10
+ YasguiSteps.createSavedQuery();
11
+ SaveQueryDialog.clearQueryNameField();
12
+ const savedQueryName = queryName || this.generateQueryName();
13
+ SaveQueryDialog.writeQueryName(savedQueryName);
14
+ SaveQueryDialog.clearQueryField();
15
+ SaveQueryDialog.writeQuery(query || DEFAULT_QUERY);
16
+ SaveQueryDialog.toggleIsPublic();
17
+ SaveQueryDialog.saveQuery();
18
+ SaveQueryDialog.getSaveQueryDialog().should('not.exist');
19
+ ApplicationSteps.getSuccessNotifications().should('be.visible');
20
+ }
21
+
22
+ static generateQueryName() {
23
+ return 'Saved query - ' + Date.now();
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ export class ShareSavedQueryDialog {
2
+ static getDialog() {
3
+ return cy.get('.share-saved-query-dialog');
4
+ }
5
+
6
+ static getDialogTitle() {
7
+ return this.getDialog().find('.dialog-title');
8
+ }
9
+
10
+ static getShareLinkField() {
11
+ return this.getDialog().find('[name=shareLink]');
12
+ }
13
+
14
+ static getShareLink() {
15
+ return this.getShareLinkField().invoke('val');
16
+ }
17
+
18
+ static copyLink() {
19
+ this.getDialog().find('.copy-button').click();
20
+ }
21
+
22
+ static closeDialog() {
23
+ this.getDialog().find('.cancel-button').click();
24
+ }
25
+ }
@@ -0,0 +1,29 @@
1
+ export class TablePluginSteps {
2
+ static getCopyResourceLinkDialog() {
3
+ return cy.get('.copy-resource-link-dialog');
4
+ }
5
+
6
+ static getCopyResourceLinkInput() {
7
+ return this.getCopyResourceLinkDialog().find('input');
8
+ }
9
+
10
+ static clickCopyLinkDialogCopyButton() {
11
+ this.getCopyResourceLinkDialog().find('.copy-button').click();
12
+ }
13
+
14
+ static clickCopyLinkDialogCloseButton() {
15
+ this.getCopyResourceLinkDialog().find('.close-button').click();
16
+ }
17
+
18
+ static clickCopyLinkDialogCancelButton() {
19
+ this.getCopyResourceLinkDialog().find('.cancel-button').click();
20
+ }
21
+
22
+ static clickOutsideCopyLinkDialog() {
23
+ cy.get('body').click(0, 0);
24
+ }
25
+
26
+ static getQueryResultInfo() {
27
+ return cy.get('.tabPanel.active .yasr_response_chip');
28
+ }
29
+ }
@@ -0,0 +1,10 @@
1
+ export class YasguiLoader {
2
+
3
+ static getLoader(index = 0) {
4
+ return cy.get('loader-component');
5
+ }
6
+
7
+ static verifyMessage(message, index = 0) {
8
+ YasguiLoader.getLoader(index).shadow().contains(message);
9
+ }
10
+ }