graphdb-workbench-tests 2.3.1 → 2.4.0-TR1

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 (88) 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/locale-en.json +18 -5
  4. package/fixtures/namespaces/ontotext-generated-namespace.json +22 -0
  5. package/fixtures/queries/empty-query-response.json +11 -0
  6. package/integration/explore/graphs.overview.spec.js +4 -2
  7. package/integration/explore/similariti-index-create.spec.js +315 -0
  8. package/integration/explore/similarity-index.spec.js +88 -0
  9. package/integration/explore/similarity.spec.js +156 -47
  10. package/integration/explore/visual-graph/graphs-config.spec.js +452 -0
  11. package/integration/explore/{visual.graph.spec.js → visual-graph/visual.graph.spec.js} +145 -348
  12. package/integration/home/language-change.spec.js +3 -3
  13. package/integration/import/import.user.data.spec.js +4 -4
  14. package/integration/resource/resource.spec.js +354 -0
  15. package/integration/setup/jdbc-create.spec.js +316 -0
  16. package/integration/setup/jdbc.spec.js +99 -178
  17. package/integration/setup/my-settings.spec.js +9 -41
  18. package/integration/setup/sparql-template-create.js +141 -0
  19. package/integration/setup/sparql-templates.spec.js +82 -146
  20. package/integration/sparql-editor/actions/execute-query.spec.js +44 -0
  21. package/integration/sparql-editor/actions/expand-results-over-sameas.spec.js +136 -0
  22. package/integration/sparql-editor/actions/include-inferred-statements.spec.js +100 -0
  23. package/integration/sparql-editor/actions/save-query.spec.js +70 -0
  24. package/integration/sparql-editor/actions/show-saved-queries.spec.js +61 -0
  25. package/integration/sparql-editor/internationalization.spec.js +41 -0
  26. package/integration/sparql-editor/saved-query/abort-query.spec.js +60 -0
  27. package/integration/sparql-editor/saved-query/delete-query.spec.js +56 -0
  28. package/integration/sparql-editor/saved-query/edit-query.spec.js +68 -0
  29. package/integration/sparql-editor/saved-query/share-query.spec.js +78 -0
  30. package/integration/sparql-editor/sparql-editor.spec.js +20 -0
  31. package/integration/sparql-editor/yasgui-tabs.spec.js +107 -0
  32. package/integration/sparql-editor/yasr/download-as.spec.js +62 -0
  33. package/integration/sparql-editor/yasr/pagination.spec.js +234 -0
  34. package/integration/sparql-editor/yasr/table-plugin.spec.js +191 -0
  35. package/integration/sparql-editor/yasr/toolbar/visual-button.spec.js +56 -0
  36. package/integration-flaky/setup/sparql-template-create.js +139 -0
  37. package/integration-flaky/sparql-editor/actions/execute-update-query.spec.js +89 -0
  38. package/integration-flaky/sparql-editor/actions/share-query.spec.js +84 -0
  39. package/integration-flaky/sparql-editor/lucene-connector.spec.js +62 -0
  40. package/package.json +3 -2
  41. package/steps/application-steps.js +23 -0
  42. package/steps/error-steps.js +9 -0
  43. package/steps/explore/graphs-overview-steps.js +24 -0
  44. package/steps/explore/similarity-index-create-steps.js +113 -0
  45. package/steps/explore/similarity-indexes-steps.js +18 -0
  46. package/steps/import-steps.js +8 -1
  47. package/steps/language-selector-steps.js +22 -0
  48. package/steps/loader-steps.js +10 -0
  49. package/steps/lucene-connector-steps.js +43 -0
  50. package/steps/main-menu-steps.js +39 -0
  51. package/steps/modal-dialog-steps.js +113 -0
  52. package/steps/repository-selector-steps.js +26 -0
  53. package/steps/resource/resource-edit-steps.js +111 -0
  54. package/steps/resource/resource-steps.js +145 -0
  55. package/steps/setup/jdbc-create-steps.js +97 -0
  56. package/steps/setup/jdbc-steps.js +42 -0
  57. package/steps/setup/sparql-create-update-steps.js +55 -0
  58. package/steps/setup/sparql-templates-steps.js +34 -0
  59. package/steps/sparql-editor-steps.js +20 -0
  60. package/steps/visual-graph-steps.js +340 -3
  61. package/steps/yasgui/confirmation-dialog-steps.js +13 -0
  62. package/steps/yasgui/pagination-steps.js +47 -0
  63. package/steps/yasgui/plugin/error-plugin-steps.js +10 -0
  64. package/steps/yasgui/save-query-dialog.js +61 -0
  65. package/steps/yasgui/saved-queries-dialog.js +29 -0
  66. package/steps/yasgui/saved-query.js +25 -0
  67. package/steps/yasgui/share-saved-query-dialog.js +25 -0
  68. package/steps/yasgui/table-plugin-steps.js +29 -0
  69. package/steps/yasgui/yasgui-steps.js +191 -0
  70. package/steps/yasgui/yasqe-steps.js +187 -0
  71. package/steps/yasgui/yasr-steps.js +105 -0
  72. package/stubs/namespace-stubs.js +10 -0
  73. package/stubs/security-stubs.js +69 -0
  74. package/stubs/yasgui/connectors-stubs.js +12 -0
  75. package/stubs/yasgui/query-stubs.js +258 -0
  76. package/support/index.js +2 -0
  77. package/support/repository-commands.js +6 -1
  78. package/support/sparql-commands.js +1 -1
  79. package/support/visual-graph-commands.js +25 -0
  80. package/integration/sparql/main.menu.spec.js +0 -196
  81. package/integration/sparql/sparql-error-handling.spec.js +0 -74
  82. package/integration/sparql/sparql-language-change.spec.js +0 -58
  83. package/integration/sparql/sparql-result-formating.spec.js +0 -84
  84. package/integration/sparql/sparql.menu.spec.js +0 -1244
  85. package/integration-flaky/setup/sparql-templates.spec.js +0 -125
  86. package/integration-flaky/sparql/sparql-language-change.spec.js +0 -45
  87. package/integration-flaky/sparql/sparql.menu.spec.js +0 -75
  88. package/steps/sparql-steps.js +0 -227
@@ -0,0 +1,34 @@
1
+ export class SparqlTemplatesSteps {
2
+
3
+ static visit() {
4
+ cy.visit('/sparql-templates');
5
+ }
6
+
7
+ static verifyUrl() {
8
+ cy.url().should('include', '/sparql-templates');
9
+ }
10
+
11
+ static getCreateSparqlTemplateButton() {
12
+ return cy.get('.create-sparql-template');
13
+ }
14
+
15
+ static clickOnCreateSparqlTemplateButton () {
16
+ SparqlTemplatesSteps.getCreateSparqlTemplateButton().realClick();
17
+ }
18
+
19
+ static getSparqlTemplates() {
20
+ return cy.get('#configurations-table tr');
21
+ }
22
+
23
+ static getSparqlTemplate(templateName) {
24
+ return SparqlTemplatesSteps.getSparqlTemplates().contains(templateName);
25
+ }
26
+
27
+ static deleteTemplate(templateName) {
28
+ SparqlTemplatesSteps.getSparqlTemplate(templateName).parents('tr').find('.delete-configuration-btn').click();
29
+ }
30
+
31
+ static getNoTemplateDefinedElement() {
32
+ return cy.get('.no-indexes');
33
+ }
34
+ }
@@ -0,0 +1,20 @@
1
+ import {YasqeSteps} from "./yasgui/yasqe-steps";
2
+
3
+ const VIEW_URL = '/sparql';
4
+
5
+ export class SparqlEditorSteps {
6
+ static visitSparqlEditorPage() {
7
+ cy.visit(VIEW_URL);
8
+ // Because we use angularjs less than 1.7.3 we use additional library ng-custom-element.umd.js to solve problem with property bindings
9
+ // This library make additional call to ontotext-yasgui-web-component and the component that's way the component renders twice when page loaded.
10
+ // This is bad because in tests cypress can find an element when it is rendered from first call and try to click it for example.
11
+ // If time of clicking such element is when second call to the component is done then exception that element is detached will be thrown.
12
+ // We will wait a little , to give a chance page is loaded correctly before test start.
13
+ cy.wait(1000);
14
+ YasqeSteps.waitUntilQueryIsVisible();
15
+ }
16
+
17
+ static verifyUrl() {
18
+ cy.url().should('include', `${Cypress.config('baseUrl')}${VIEW_URL}`);
19
+ }
20
+ }
@@ -1,4 +1,16 @@
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
+ // cy.window();
9
+ }
10
+
11
+ static verifyUrl() {
12
+ cy.url().should('include', `${Cypress.config('baseUrl')}${VIEW_URL}`);
13
+ }
2
14
 
3
15
  static updateGraphConfiguration(namedGraph) {
4
16
  cy.get('[data-cy="save-or-update-graph"]').click()
@@ -26,6 +38,331 @@ class VisualGraphSteps {
26
38
  cy.get('.modal').should('not.exist');
27
39
  }
28
40
 
29
- }
41
+ // ============================
42
+
43
+ // Visual graph home view access
44
+
45
+ static getSearchField() {
46
+ return cy.get('.search-rdf-resources input:visible');
47
+ }
48
+
49
+ static getGraphVisualizationPane() {
50
+ return cy.get('.graph-visualization');
51
+ }
52
+
53
+ static searchForResource(resource) {
54
+ // verify that the easy graph search has occured and a valid resource was input and only
55
+ // after that execute the next operation
56
+ cy.searchEasyVisualGraph(resource)
57
+ .then(() => {
58
+ // Verify redirection to existing visual graph
59
+ cy.waitUntil(() =>
60
+ cy.get('.graph-visualization')
61
+ .find('.nodes-container')
62
+ .then((nodesContainer) => nodesContainer))
63
+ .then(() => {
64
+ this.getNodes();
65
+ });
66
+ });
67
+ }
68
+
69
+ static getTargetNodeElement() {
70
+ return cy.get(`[id="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#${VALID_RESOURCE}"] circle`).should('be.visible');
71
+ }
72
+
73
+ static getTargetNode() {
74
+ // The wait is needed because mouseover event will result in
75
+ // pop-up of menu icons only if nodes are not moving
76
+ return this.getTargetNodeElement().wait(5000);
77
+ }
78
+
79
+ static getNodes() {
80
+ return cy.get('.node-wrapper').should('be.visible');
81
+ }
82
+
83
+ static getPredicates() {
84
+ return cy.get('.predicate');
85
+ }
86
+
87
+ static getNodeInfoPanel() {
88
+ return cy.get('.rdf-info-side-panel .tab-content');
89
+ }
90
+
91
+ static getSettingsPanel() {
92
+ return cy.get('.rdf-info-side-panel .filter-sidepanel');
93
+ }
94
+
95
+ // Visual graph settings form field access
96
+
97
+ static openPredicatesTab() {
98
+ cy.get('.predicates-tab').should('be.visible').click();
99
+ }
100
+
101
+ static showPreferredTypes(enable) {
102
+ const command = enable ? 'check' : 'uncheck';
103
+ this.getShowPreferredTypesOnlyCheckbox()[command]();
104
+ }
105
+
106
+ static toggleInferredStatements(enable) {
107
+ this.openVisualGraphSettings();
108
+ this.getSettingsPanel().should('be.visible');
109
+ const command = enable ? 'check' : 'uncheck';
110
+ this.getIncludeInferredStatementsCheckbox()[command]();
111
+ this.saveSettings();
112
+ }
113
+
114
+ static getLinksNumberField() {
115
+ // This element could not be checked with 'be.visible' because it has
116
+ // CSS property: 'position: fixed' and its being covered by another element
117
+ return cy.get('.input-number');
118
+ }
119
+
120
+ static getSaveSettingsButton() {
121
+ return cy.get('.save-settings-btn').scrollIntoView().should('be.visible');
122
+ }
123
+
124
+ static saveSettings() {
125
+ this.getSaveSettingsButton().click();
126
+ }
127
+
128
+ static getResetSettingsButton() {
129
+ return cy.get('.reset-settings').scrollIntoView().should('be.visible');
130
+ }
131
+
132
+ static resetSettings() {
133
+ this.getResetSettingsButton().click();
134
+ }
135
+
136
+ static getSameAsCheckbox() {
137
+ return cy.get('#sameAsCheck').should('be.visible');
138
+ }
139
+
140
+ static getIncludeInferredStatementsCheckbox() {
141
+ return cy.get('.include-inferred-statements').should('be.visible');
142
+ }
143
+
144
+ static getShowPredicateLabelsCheckbox() {
145
+ return cy.get('.show-predicate-labels').should('be.visible');
146
+ }
147
+
148
+ static getPreferredTypesField() {
149
+ return cy.get('.preferred-types input').scrollIntoView().should('be.visible');
150
+ }
151
+
152
+ static getShowPreferredTypesOnlyCheckbox() {
153
+ return cy.get('.show-preferred-types-only').should('be.visible');
154
+ }
155
+
156
+ static getIgnoredTypesField() {
157
+ // This element could not be checked with 'be.visible' because it has
158
+ // CSS property: 'position: fixed' and its being covered by another element
159
+ return cy.get('.ignored-types input');
160
+ }
161
+
162
+ static getPreferredPredicatesField() {
163
+ return cy.get('.preferred-predicates input').should('be.visible');
164
+ }
165
+
166
+ static getShowPreferredPredicatesOnlyCheckbox() {
167
+ return cy.get('.show-preferred-predicates-only').should('be.visible');
168
+ }
169
+
170
+ static getIgnoredPredicatesField() {
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-predicates input');
174
+ }
175
+
176
+ static getCreateCustomGraphLink() {
177
+ return cy.get('.create-graph-config').should('be.visible');
178
+ }
179
+
180
+ static getGraphConfigName() {
181
+ return cy.get('.graph-config-name').should('be.visible');
182
+ }
183
+
184
+ static typeGraphConfigName(name) {
185
+ this.getGraphConfigName().type(name);
186
+ }
187
+
188
+ static getSaveConfigButton() {
189
+ return cy.get('.btn-save-config');
190
+ }
191
+
192
+ static saveConfig() {
193
+ this.getSaveConfigButton().click();
194
+ }
195
+
196
+ static getCanceSaveConfigButton() {
197
+ return cy.get('.btn-cancel-save-config');
198
+ }
199
+
200
+ static cancelSaveConfig() {
201
+ this.getCanceSaveConfigButton().click();
202
+ }
203
+
204
+ static getGraphConfigurationsArea() {
205
+ return cy.get('.graph-configurations');
206
+ }
207
+
208
+ static getGraphConfigs() {
209
+ return this.getGraphConfigurationsArea().find('.graph-configurations-list tr');
210
+ }
30
211
 
31
- export default VisualGraphSteps;
212
+ static getGraphConfig(name) {
213
+ return this.getGraphConfigs().contains(name);
214
+ }
215
+
216
+ static openGraphConfig(name) {
217
+ this.getGraphConfig(name).click();
218
+ }
219
+
220
+ static editConfig(name) {
221
+ this.getGraphConfig(name).closest('tr').find('.btn-edit-config').click();
222
+ }
223
+
224
+ static deleteConfig(name) {
225
+ this.getGraphConfig(name).closest('tr').find('.delete-config').click();
226
+ }
227
+
228
+ static getGraphConfigSearchPanel() {
229
+ return cy.get('.search-bar');
230
+ }
231
+
232
+ static getGraphConfigSearchPanelName() {
233
+ return this.getGraphConfigSearchPanel().find('.graph-config-name');
234
+ }
235
+
236
+ // Node actions
237
+
238
+ static collapseGraph() {
239
+ cy.get('.menu-events .collapse-icon circle').should('be.visible').click();
240
+ }
241
+
242
+ static expandGraph() {
243
+ cy.get('.menu-events .expand-icon circle').should('be.visible').click();
244
+ }
245
+
246
+ static removeNode() {
247
+ cy.get('.menu-events .close-icon circle').click({force: true});
248
+ }
249
+
250
+ // Visual graph toolbar actions
251
+
252
+ static openVisualGraphSettings() {
253
+ return cy.get('.toolbar-holder').should('be.visible')
254
+ .find('.visual-graph-settings-btn')
255
+ .should('be.visible').click();
256
+ }
257
+
258
+ static openVisualGraphHome() {
259
+ cy.get('.toolbar-holder').should('be.visible')
260
+ .find('.return-home-btn').should('be.visible').click();
261
+ }
262
+
263
+ static updateLinksLimitField(value) {
264
+ return this.getLinksNumberField().invoke('val', value).trigger('change', {force: true});
265
+ }
266
+
267
+ static getNextPageButton() {
268
+ return cy.get(`.btn-next-page`);
269
+ }
270
+
271
+ static goToNextPage() {
272
+ this.getNextPageButton().click();
273
+ }
274
+
275
+ static getPreviousPageButton() {
276
+ return cy.get(`.btn-previous-page`);
277
+ }
278
+
279
+ static goToPreviousPage() {
280
+ this.getPreviousPageButton().click();
281
+ }
282
+
283
+ static getConfigWizardTab(index) {
284
+ return cy.get(`.page-${index}-link`);
285
+ }
286
+
287
+ static openConfigWizardTab(index) {
288
+ this.getConfigWizardTab(index).click();
289
+ }
290
+
291
+ static getStartModes() {
292
+ return cy.get('.start-mode');
293
+ }
294
+
295
+ static getStartMode(type) {
296
+ return this.getStartModes().filter(`.${type}`);
297
+ }
298
+
299
+ static getStartModeSelector(type) {
300
+ return this.getStartMode(type).find('input');
301
+ }
302
+
303
+ static selectStartMode(type) {
304
+ this.getStartMode(type).click();
305
+ }
306
+
307
+ static getQueryEditor() {
308
+ return cy.get(".yasqe:visible");
309
+ }
310
+
311
+ static getPredefinedQuerySamples() {
312
+ return cy.get('.predefined-queries .predefined-query');
313
+ }
314
+
315
+ static selectPredefinedQuerySample(index) {
316
+ this.getPredefinedQuerySamples().eq(index).click();
317
+ }
318
+
319
+ static getUserQuerySamples() {
320
+ return cy.get('.user-queries .user-query');
321
+ }
322
+
323
+ static selectUserQuerySample(index) {
324
+ this.getUserQuerySamples().eq(index).click();
325
+ }
326
+
327
+ static getHelpInfoBox() {
328
+ return cy.get('.help-box');
329
+ }
330
+
331
+ static getStartNodeSelectorComponent() {
332
+ return cy.get('.start-node-selector');
333
+ }
334
+
335
+ static getStartNodeSelectorField() {
336
+ return this.getStartNodeSelectorComponent().find('.view-res-input');
337
+ }
338
+
339
+ static selectStartNode(uri, index) {
340
+ this.getStartNodeSelectorField().type(uri)
341
+ .closest('.start-node-selector')
342
+ .find('#auto-complete-results-wrapper .result-item').eq(index).click();
343
+ }
344
+
345
+ static getSelectedStartNodeUri() {
346
+ return this.getStartNodeSelectorComponent().find('.selected-node code');
347
+ }
348
+
349
+ static getPreviewQueryResultsButton() {
350
+ return cy.get('.btn-preview-query-results');
351
+ }
352
+
353
+ static previewQueryResults() {
354
+ this.getPreviewQueryResultsButton().click();
355
+ }
356
+
357
+ static editQuery() {
358
+ cy.get('.btn-show-query-editor').click();
359
+ }
360
+
361
+ static getRevertQueryButton() {
362
+ return cy.get('.btn-revert-query');
363
+ }
364
+
365
+ static revertQuery() {
366
+ this.getRevertQueryButton().click();
367
+ }
368
+ }
@@ -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,10 @@
1
+ export class ErrorPluginSteps {
2
+
3
+ static getErrorPlugin() {
4
+ return cy.get('.error-response-plugin');
5
+ }
6
+
7
+ static getErrorPluginBody() {
8
+ return ErrorPluginSteps.getErrorPlugin().find('.error-response-plugin-body');
9
+ }
10
+ }
@@ -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('#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
+ }