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
@@ -1,3 +1,5 @@
1
+ import {VisualGraphSteps} from "../../../steps/visual-graph-steps";
2
+
1
3
  const FILE_TO_IMPORT = 'wine.rdf';
2
4
  const DRY_GRAPH = "http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Dry";
3
5
 
@@ -27,7 +29,7 @@ describe('Visual graph screen validation', () => {
27
29
  it('Test notification when autocomplete is disabled', () => {
28
30
  cy.visit('graphs-visualizations');
29
31
  cy.window();
30
- getSearchField().should('be.visible').type('http://');
32
+ VisualGraphSteps.getSearchField().should('be.visible').type('http://');
31
33
 
32
34
  // Verify that a message with a redirection to the autocomplete section is displayed.
33
35
  cy.get('.autocomplete-toast a').should('contain', 'Autocomplete is OFF')
@@ -47,7 +49,7 @@ describe('Visual graph screen validation', () => {
47
49
  });
48
50
 
49
51
  it('Test search for an invalid resource', () => {
50
- getSearchField().should('be.visible').type('.invalid_resource');
52
+ VisualGraphSteps.getSearchField().should('be.visible').type('.invalid_resource');
51
53
  // There are two buttons rendered in the DOM where one of them is hidden. We need the visible one.
52
54
  cy.get('.autocomplete-visual-btn:visible').click();
53
55
  // Verify that an "Invalid IRI" message is displayed
@@ -55,63 +57,63 @@ describe('Visual graph screen validation', () => {
55
57
  });
56
58
 
57
59
  it('Test search for a valid resource', () => {
58
- searchForResource(VALID_RESOURCE);
60
+ VisualGraphSteps.searchForResource(VALID_RESOURCE);
59
61
  // Verify redirection to existing visual graph
60
62
  cy.url().should('match', /USRegion$/);
61
63
  });
62
64
 
63
65
  it('Test default graph state', () => {
64
- searchForResource(VALID_RESOURCE);
65
- openVisualGraphSettings();
66
+ VisualGraphSteps.searchForResource(VALID_RESOURCE);
67
+ VisualGraphSteps.openVisualGraphSettings();
66
68
 
67
69
  cy.get('.filter-sidepanel').as('sidepanel').should('be.visible').within(() => {
68
70
  // Verify that the default settings are as follows:
69
71
  // Maximum links to show: 20
70
- getLinksNumberField().and('have.value', '20');
72
+ VisualGraphSteps.getLinksNumberField().and('have.value', '20');
71
73
  // Preferred lang: en
72
74
  cy.get('.preferred-languages .tag-item').should('have.length', 1)
73
75
  .and('contain', 'en');
74
76
  // Include inferred: false
75
- getIncludeInferredStatementsCheckbox().and('be.checked')
77
+ VisualGraphSteps.getIncludeInferredStatementsCheckbox().and('be.checked')
76
78
  .and('not.be.disabled');
77
79
  // Expand results over owl:sameAs: false
78
- getSameAsCheckbox().and('be.checked')
80
+ VisualGraphSteps.getSameAsCheckbox().and('be.checked')
79
81
  .and('not.be.disabled');
80
82
  // Show predicate labels: true
81
- getShowPredicateLabelsCheckbox().and('be.checked')
83
+ VisualGraphSteps.getShowPredicateLabelsCheckbox().and('be.checked')
82
84
  .and('not.be.disabled');
83
85
 
84
86
  // No pre-added preferred/ignored types
85
- getPreferredTypesField().and('be.empty');
86
- getShowPreferredTypesOnlyCheckbox().and(('not.be.checked'))
87
+ VisualGraphSteps.getPreferredTypesField().and('be.empty');
88
+ VisualGraphSteps.getShowPreferredTypesOnlyCheckbox().and(('not.be.checked'))
87
89
  .and('not.be.disabled');
88
- getIgnoredTypesField().should('be.empty');
90
+ VisualGraphSteps.getIgnoredTypesField().should('be.empty');
89
91
 
90
92
  // Go to predicates tab
91
- openPredicatesTab();
93
+ VisualGraphSteps.openPredicatesTab();
92
94
  // No pre-added preferred/ignored predicates
93
- getPreferredPredicatesField().and('be.empty');
94
- getShowPreferredPredicatesOnlyCheckbox().and('not.be.checked')
95
+ VisualGraphSteps.getPreferredPredicatesField().and('be.empty');
96
+ VisualGraphSteps.getShowPreferredPredicatesOnlyCheckbox().and('not.be.checked')
95
97
  .and('not.be.disabled');
96
- getIgnoredPredicatesField().and('be.empty');
98
+ VisualGraphSteps.getIgnoredPredicatesField().and('be.empty');
97
99
 
98
100
  // Save and rest buttons should be visible and enabled
99
101
  cy.get('@sidepanel').scrollIntoView();
100
- getSaveSettingsButton().and('not.be.disabled');
101
- getResetSettingsButton().and('not.be.disabled');
102
+ VisualGraphSteps.getSaveSettingsButton().and('not.be.disabled');
103
+ VisualGraphSteps.getResetSettingsButton().and('not.be.disabled');
102
104
  });
103
105
  });
104
106
 
105
107
  it('Test invalid links limit should show error to user ', () => {
106
- searchForResource(VALID_RESOURCE);
107
- openVisualGraphSettings();
108
+ VisualGraphSteps.searchForResource(VALID_RESOURCE);
109
+ VisualGraphSteps.openVisualGraphSettings();
108
110
 
109
111
  cy.get('.filter-sidepanel').as('sidepanel').should('be.visible').within(() => {
110
112
  // Verify that the default settings are as follows:
111
113
  // Maximum links to show: 20
112
- getLinksNumberField().and('have.value', '20');
114
+ VisualGraphSteps.getLinksNumberField().and('have.value', '20');
113
115
  // Update default 20
114
- updateLinksLimitField('1001')
116
+ VisualGraphSteps.updateLinksLimitField('1001')
115
117
  .then(() => {
116
118
  // Try to put invalid value such as 1001
117
119
  cy.get('.idError')
@@ -119,13 +121,13 @@ describe('Visual graph screen validation', () => {
119
121
  .and('contain.text', 'Invalid links limit');
120
122
  });
121
123
  // Try to save the invalid value
122
- getSaveSettingsButton().and('not.be.disabled')
124
+ VisualGraphSteps.getSaveSettingsButton().and('not.be.disabled')
123
125
  .click();
124
126
  // Then reset to default settings
125
- getResetSettingsButton().and('not.be.disabled')
127
+ VisualGraphSteps.getResetSettingsButton().and('not.be.disabled')
126
128
  .click()
127
129
  .then(() => {
128
- getLinksNumberField().and('have.value', '20');
130
+ VisualGraphSteps.getLinksNumberField().and('have.value', '20');
129
131
  cy.get('.idError')
130
132
  .should('not.exist');
131
133
  });
@@ -133,63 +135,63 @@ describe('Visual graph screen validation', () => {
133
135
  });
134
136
 
135
137
  it('Test search for a valid resource with links', () => {
136
- searchForResource(VALID_RESOURCE);
138
+ VisualGraphSteps.searchForResource(VALID_RESOURCE);
137
139
  // Check include inferred
138
- toggleInferredStatements(true);
140
+ VisualGraphSteps.toggleInferredStatements(true);
139
141
  // Navigate to Visual graph menu
140
- openVisualGraphHome();
142
+ VisualGraphSteps.openVisualGraphHome();
141
143
  // Search for "USRegion" again
142
- searchForResource(VALID_RESOURCE);
144
+ VisualGraphSteps.searchForResource(VALID_RESOURCE);
143
145
  // Verify that 20 links (nodes) are displayed
144
- getPredicates().should('have.length', 20);
146
+ VisualGraphSteps.getPredicates().should('have.length', 20);
145
147
  // Verify that links are counted by nodes and not by triples (predicates)
146
- getNodes().and('have.length', 21);
148
+ VisualGraphSteps.getNodes().and('have.length', 21);
147
149
  });
148
150
 
149
151
  it('Test collapse and expand a node', () => {
150
- searchForResource(VALID_RESOURCE);
151
- toggleInferredStatements(false);
152
+ VisualGraphSteps.searchForResource(VALID_RESOURCE);
153
+ VisualGraphSteps.toggleInferredStatements(false);
152
154
 
153
155
  // Hover over node with the mouse and collapse it through the menu
154
- getTargetNode().trigger('mouseover');
155
- collapseGraph();
156
+ VisualGraphSteps.getTargetNode().trigger('mouseover');
157
+ VisualGraphSteps.collapseGraph();
156
158
 
157
159
  // Verify that all links to the USRegion node are collapsed
158
- getPredicates().should('have.length', 0);
160
+ VisualGraphSteps.getPredicates().should('have.length', 0);
159
161
  // Verify that the USRegion node is the only node left in the graph
160
- getNodes().and('have.length', 1).and('contain', 'USRegion');
162
+ VisualGraphSteps.getNodes().and('have.length', 1).and('contain', 'USRegion');
161
163
 
162
164
  // Hover over node with the mouse and expand it through the menu
163
- getTargetNode().trigger('mouseover');
164
- expandGraph();
165
+ VisualGraphSteps.getTargetNode().trigger('mouseover');
166
+ VisualGraphSteps.expandGraph();
165
167
 
166
168
  // Verify that all links to the USRegion node are expanded
167
- getPredicates().should('have.length', 3);
169
+ VisualGraphSteps.getPredicates().should('have.length', 3);
168
170
  // Verify that the USRegion node is not the only node left in the graph
169
- getNodes().and('have.length', 4);
171
+ VisualGraphSteps.getNodes().and('have.length', 4);
170
172
  });
171
173
 
172
174
  it('Test expand and collapse node info panel with single click', () => {
173
- searchForResource(VALID_RESOURCE);
175
+ VisualGraphSteps.searchForResource(VALID_RESOURCE);
174
176
 
175
177
  // Click once on the node with the mouse to open node's info panel
176
- getTargetNode().click();
178
+ VisualGraphSteps.getTargetNode().click();
177
179
  // Verify that a side panel is displayed containing info about the resource
178
- getNodeInfoPanel().should('be.visible')
180
+ VisualGraphSteps.getNodeInfoPanel().should('be.visible')
179
181
  .find('.uri')
180
182
  .should('be.visible')
181
183
  .and('contain', VALID_RESOURCE);
182
184
 
183
185
  // Close side panel and verify it's missing
184
- getTargetNode().click();
185
- getNodeInfoPanel().should('not.exist');
186
+ VisualGraphSteps.getTargetNode().click();
187
+ VisualGraphSteps.getNodeInfoPanel().should('not.exist');
186
188
  });
187
189
 
188
190
  it('Test remove child node', () => {
189
- searchForResource(VALID_RESOURCE);
190
- toggleInferredStatements(false);
191
+ VisualGraphSteps.searchForResource(VALID_RESOURCE);
192
+ VisualGraphSteps.toggleInferredStatements(false);
191
193
  // Verify that before given node is removed there are 4 of them
192
- getNodes().and('have.length', 4);
194
+ VisualGraphSteps.getNodes().and('have.length', 4);
193
195
  // Click once on node different than parent one with the mouse
194
196
  cy.get('.node-wrapper circle').eq(1)
195
197
  // The wait is needed because mouseover event will result in
@@ -197,46 +199,48 @@ describe('Visual graph screen validation', () => {
197
199
  .should('be.visible').wait(5000)
198
200
  .trigger('mouseover', {force: true});
199
201
  // Select remove function
200
- removeNode();
202
+ VisualGraphSteps.removeNode();
201
203
  // Verify that links between parent node and the child nodes are expanded
202
- getPredicates().should('have.length', 2);
204
+ VisualGraphSteps.getPredicates().should('have.length', 2);
203
205
  // Verify that the nodes left are one less
204
- getNodes().and('have.length', 3);
206
+ VisualGraphSteps.getNodes().and('have.length', 3);
205
207
  });
206
208
 
207
209
  it('Test remove parent node', () => {
208
- searchForResource(VALID_RESOURCE);
210
+ VisualGraphSteps.searchForResource(VALID_RESOURCE);
209
211
 
210
212
  // Verify that search bar isn't visible
211
- getSearchField().should('not.exist');
213
+ VisualGraphSteps.getSearchField().should('not.exist');
212
214
  // Hover over node with the mouse
213
- getTargetNode().trigger('mouseover');
215
+ VisualGraphSteps.getTargetNode().trigger('mouseover');
214
216
  // Select remove function for the parent node
215
- removeNode();
217
+ VisualGraphSteps.removeNode();
216
218
  cy.get('.graph-visualization').should('not.be.visible');
217
219
  // Verify that the search bar re-appears on the screen
218
220
  cy.get('.incontext-search-rdf-resource input').should('be.visible');
219
221
  });
220
222
 
221
223
  it('Test expand collapsed node which has connections with double click', () => {
222
- searchForResource(VALID_RESOURCE);
223
- toggleInferredStatements(false);
224
+ VisualGraphSteps.searchForResource(VALID_RESOURCE);
225
+ VisualGraphSteps.toggleInferredStatements(false);
224
226
 
225
- getTargetNode().trigger('mouseover');
226
- collapseGraph();
227
+ VisualGraphSteps.getTargetNode().trigger('mouseover');
228
+ VisualGraphSteps.collapseGraph();
227
229
  // Verify that all links to the USRegion node are collapsed
228
- getPredicates().should('not.exist');
230
+ VisualGraphSteps.getPredicates().should('not.exist');
229
231
  // Verify that the USRegion node is the only node left in the graph
230
- getNodes().and('have.length', 1).and('contain', 'USRegion');
232
+ VisualGraphSteps.getNodes().and('have.length', 1).and('contain', 'USRegion');
231
233
 
232
234
  // Double click on collapsed node
233
235
  // This is ugly but unfortunately I couldn't make cypress's dblclick to work reliably here
234
- getTargetNodeElement().dblclick()
236
+ VisualGraphSteps.getTargetNodeElement().click().then(() => {
237
+ VisualGraphSteps.getTargetNodeElement().click();
238
+ });
235
239
 
236
240
  // Verify that all links to the USRegion node are expanded
237
- getPredicates().should('have.length', 3);
241
+ VisualGraphSteps.getPredicates().should('have.length', 3);
238
242
  // Verify that the USRegion node is not the only node left in the graph
239
- getNodes().and('have.length', 4);
243
+ VisualGraphSteps.getNodes().and('have.length', 4);
240
244
  });
241
245
 
242
246
  it('Test verify mouse/keyboard actions', () => {
@@ -269,6 +273,7 @@ describe('Visual graph screen validation', () => {
269
273
  'Right arrow\n \n ' +
270
274
  'Rotate the graph to the right\n';
271
275
 
276
+ VisualGraphSteps.searchForResource(VALID_RESOURCE);
272
277
  // Click on "mouse and keyboard actions" in the lower right corner of the screen
273
278
  cy.get('#keyboardShortcuts').click();
274
279
  // Verify all mouse and actions
@@ -284,63 +289,63 @@ describe('Visual graph screen validation', () => {
284
289
  });
285
290
 
286
291
  it('Test maximum links to show', () => {
287
- searchForResource(VALID_RESOURCE);
292
+ VisualGraphSteps.searchForResource(VALID_RESOURCE);
288
293
 
289
294
  // Verify that 20 links (nodes) are displayed
290
- getPredicates().should('have.length', 20);
295
+ VisualGraphSteps.getPredicates().should('have.length', 20);
291
296
 
292
- openVisualGraphSettings();
297
+ VisualGraphSteps.openVisualGraphSettings();
293
298
  // Set maximum links to 2
294
- updateLinksLimitField('2');
295
- saveSettings();
299
+ VisualGraphSteps.updateLinksLimitField('2');
300
+ VisualGraphSteps.saveSettings();
296
301
  // Verify that the diagram is updated
297
- getPredicates().should('have.length', 2);
302
+ VisualGraphSteps.getPredicates().should('have.length', 2);
298
303
 
299
- openVisualGraphSettings();
304
+ VisualGraphSteps.openVisualGraphSettings();
300
305
  // Set maximum links to 100
301
- updateLinksLimitField('100');
302
- saveSettings();
306
+ VisualGraphSteps.updateLinksLimitField('100');
307
+ VisualGraphSteps.saveSettings();
303
308
  // Verify that the diagram is updated
304
- getPredicates().should('have.length', 36);
309
+ VisualGraphSteps.getPredicates().should('have.length', 36);
305
310
  });
306
311
 
307
312
  it('Test include inferred Statements', () => {
308
- searchForResource(VALID_RESOURCE);
313
+ VisualGraphSteps.searchForResource(VALID_RESOURCE);
309
314
  // Check include inferred
310
- toggleInferredStatements(true);
315
+ VisualGraphSteps.toggleInferredStatements(true);
311
316
 
312
317
  // Verify that many results are displayed
313
318
  // Verify that 20 links (nodes) are displayed
314
- getPredicates().should('have.length', 20);
319
+ VisualGraphSteps.getPredicates().should('have.length', 20);
315
320
  // Verify that more than three nodes are displayed
316
- getNodes().and('have.length', 21);
321
+ VisualGraphSteps.getNodes().and('have.length', 21);
317
322
 
318
323
  // Switch Include Inferred Statements off
319
- toggleInferredStatements(false);
324
+ VisualGraphSteps.toggleInferredStatements(false);
320
325
 
321
326
  // Verify that 20 links (nodes) are displayed
322
- getPredicates().should('have.length', 3);
327
+ VisualGraphSteps.getPredicates().should('have.length', 3);
323
328
 
324
329
  // Verify that three nodes are displayed
325
- getNodes().should('have.length', 4);
330
+ VisualGraphSteps.getNodes().should('have.length', 4);
326
331
 
327
332
  // Verify that only "Texas" and "California" regions are displayed
328
- getNodes().and('contain', 'Texas').and('contain', 'California');
333
+ VisualGraphSteps.getNodes().and('contain', 'Texas').and('contain', 'California');
329
334
  });
330
335
 
331
336
  it('Test preferred types', () => {
332
337
  cy.searchEasyVisualGraph(DRY_GRAPH);
333
338
 
334
- openVisualGraphSettings();
339
+ VisualGraphSteps.openVisualGraphSettings();
335
340
  // Set "vin:Chardonnay" as a preferred type
336
- getPreferredTypesField().clear().type('vin:Chardonnay');
341
+ VisualGraphSteps.getPreferredTypesField().clear().type('vin:Chardonnay');
337
342
  // Select "Show preferred types only"
338
- showPreferredTypes(true);
343
+ VisualGraphSteps.showPreferredTypes(true);
339
344
 
340
- saveSettings();
345
+ VisualGraphSteps.saveSettings();
341
346
 
342
347
  // Verify that there are a total of 6 ( 5 children plus one parent nodes ) are connected to the DRY node
343
- getNodes().and('have.length', 6).each(($el) => {
348
+ VisualGraphSteps.getNodes().and('have.length', 6).each(($el) => {
344
349
  // Exclude parent node
345
350
  if ($el.text() !== 'Dry') {
346
351
  expect($el.text()).to.contain('Chardonnay');
@@ -352,350 +357,144 @@ describe('Visual graph screen validation', () => {
352
357
  cy.searchEasyVisualGraph(DRY_GRAPH);
353
358
 
354
359
  // Pick a type that is displayed in the diagram for example "vin:Zinfandel"
355
- getNodes().and('contain', 'Zinfandel');
360
+ VisualGraphSteps.getNodes().and('contain', 'Zinfandel');
356
361
 
357
- openVisualGraphSettings();
362
+ VisualGraphSteps.openVisualGraphSettings();
358
363
  // Set the connections limit to 10
359
- updateLinksLimitField('10');
364
+ VisualGraphSteps.updateLinksLimitField('10');
360
365
  // Go to Settings and set "vin:Zinfandel" as an ignored type
361
- getIgnoredTypesField().clear().type('vin:Zinfandel').type('{enter}');
366
+ VisualGraphSteps.getIgnoredTypesField().clear().type('vin:Zinfandel').type('{enter}');
362
367
 
363
- saveSettings();
368
+ VisualGraphSteps.saveSettings();
364
369
  // Verify that "vin:Zinfandel" has been removed from the diagram
365
- getNodes().and('not.contain', 'Zinfandel');
370
+ VisualGraphSteps.getNodes().and('not.contain', 'Zinfandel');
366
371
  });
367
372
 
368
373
  it('Test preferred predicates', () => {
369
374
  cy.searchEasyVisualGraph(DRY_GRAPH);
370
375
 
371
- openVisualGraphSettings();
376
+ VisualGraphSteps.openVisualGraphSettings();
372
377
  // Go to predicates tab
373
- openPredicatesTab();
378
+ VisualGraphSteps.openPredicatesTab();
374
379
  // Set "vin:hasSugar" as a preferred predicate
375
- getPreferredPredicatesField().clear().type('vin:hasSugar');
380
+ VisualGraphSteps.getPreferredPredicatesField().clear().type('vin:hasSugar');
376
381
  // Select "Show preferred predicates only"
377
- getShowPreferredPredicatesOnlyCheckbox().check();
382
+ VisualGraphSteps.getShowPreferredPredicatesOnlyCheckbox().check();
378
383
 
379
- saveSettings();
384
+ VisualGraphSteps.saveSettings();
380
385
  // Verify that only the "vin:hasSugar" predicate is displayed between the nodes
381
- getPredicates().should('contain', 'hasSugar');
386
+ VisualGraphSteps.getPredicates().should('contain', 'hasSugar');
382
387
  });
383
388
 
384
389
  it('Test ignored predicates', () => {
385
390
  cy.searchEasyVisualGraph(DRY_GRAPH);
386
- toggleInferredStatements(false);
391
+ VisualGraphSteps.toggleInferredStatements(false);
387
392
 
388
393
  // Pick a type that is displayed in the diagram for example "vin:Zinfandel"
389
- getPredicates().should('contain', 'hasSugar');
394
+ VisualGraphSteps.getPredicates().should('contain', 'hasSugar');
390
395
 
391
- openVisualGraphSettings();
396
+ VisualGraphSteps.openVisualGraphSettings();
392
397
  // Go to predicates tab
393
- openPredicatesTab();
398
+ VisualGraphSteps.openPredicatesTab();
394
399
 
395
400
  // Set the connections limit to 10
396
- updateLinksLimitField('10');
401
+ VisualGraphSteps.updateLinksLimitField('10');
397
402
  // Set "vin:hasSugar" as an ignored predicate
398
- getIgnoredPredicatesField().clear().type('vin:hasSugar').type('{enter}');
403
+ VisualGraphSteps.getIgnoredPredicatesField().clear().type('vin:hasSugar').type('{enter}');
399
404
 
400
- saveSettings();
405
+ VisualGraphSteps.saveSettings();
401
406
 
402
407
  // Verify that "vin:hasSugar" has been removed from the diagram
403
- getPredicates().should('not.contain', 'hasSugar');
408
+ VisualGraphSteps.getPredicates().should('not.contain', 'hasSugar');
404
409
  });
405
410
 
406
411
  it('Test reset settings', () => {
407
412
  cy.searchEasyVisualGraph(DRY_GRAPH);
408
413
 
409
414
  // Modify the settings first
410
- openVisualGraphSettings();
415
+ VisualGraphSteps.openVisualGraphSettings();
411
416
  // Verify that the default settings are as follows:
412
417
  // Maximum links to show: 20
413
- updateLinksLimitField('10')
418
+ VisualGraphSteps.updateLinksLimitField('10')
414
419
  .should('have.value', '10');
415
420
  // Preferred lang: en
416
421
  cy.get('.preferred-languages .tag-item').should('have.length', 1)
417
422
  .eq(0).should('contain', 'en');
418
423
  // Include inferred: false
419
- getIncludeInferredStatementsCheckbox().check()
424
+ VisualGraphSteps.getIncludeInferredStatementsCheckbox().check()
420
425
  .should('be.checked');
421
426
  // Expand results over owl:sameAs: false
422
- getSameAsCheckbox().check()
427
+ VisualGraphSteps.getSameAsCheckbox().check()
423
428
  .should('be.checked');
424
429
  // Show predicate labels: true
425
- getShowPredicateLabelsCheckbox().uncheck()
430
+ VisualGraphSteps.getShowPredicateLabelsCheckbox().uncheck()
426
431
  .should('not.be.checked');
427
432
 
428
433
  // No pre-added preferred/ignored types
429
- getPreferredTypesField().type('vin:PinotNoir')
434
+ VisualGraphSteps.getPreferredTypesField().type('vin:PinotNoir')
430
435
  .should('have.value', 'vin:PinotNoir');
431
- getShowPreferredTypesOnlyCheckbox().check()
436
+ VisualGraphSteps.getShowPreferredTypesOnlyCheckbox().check()
432
437
  .should('be.checked');
433
- getIgnoredTypesField().type('vin:PinotNoir')
438
+ VisualGraphSteps.getIgnoredTypesField().type('vin:PinotNoir')
434
439
  .should('have.value', 'vin:PinotNoir');
435
440
 
436
441
  // Go to predicates tab
437
- openPredicatesTab();
442
+ VisualGraphSteps.openPredicatesTab();
438
443
  // No pre-added preferred/ignored predicates
439
- getPreferredPredicatesField().type('vin:hasSugar')
444
+ VisualGraphSteps.getPreferredPredicatesField().type('vin:hasSugar')
440
445
  .should('have.value', 'vin:hasSugar');
441
- getShowPreferredPredicatesOnlyCheckbox().check()
446
+ VisualGraphSteps.getShowPreferredPredicatesOnlyCheckbox().check()
442
447
  .should('be.checked');
443
- getIgnoredPredicatesField().type('vin:hasSugar')
448
+ VisualGraphSteps.getIgnoredPredicatesField().type('vin:hasSugar')
444
449
  .should('have.value', 'vin:hasSugar');
445
450
 
446
- saveSettings();
451
+ VisualGraphSteps.saveSettings();
447
452
 
448
453
  // Reset settings and verify everything is reverted to its default
449
- openVisualGraphSettings();
450
- resetSettings();
451
- saveSettings();
454
+ VisualGraphSteps.openVisualGraphSettings();
455
+ VisualGraphSteps.resetSettings();
456
+ VisualGraphSteps.saveSettings();
452
457
 
453
- openVisualGraphSettings();
458
+ VisualGraphSteps.openVisualGraphSettings();
454
459
  // Verify that the default settings are as follows:
455
460
  // Maximum links to show: 20
456
- getLinksNumberField().and('have.value', '20');
461
+ VisualGraphSteps.getLinksNumberField().and('have.value', '20');
457
462
  // Preferred lang: en
458
463
  cy.get('.preferred-languages .tag-item').should('have.length', 1);
459
464
  // Include inferred: false
460
- getIncludeInferredStatementsCheckbox().and('be.checked')
465
+ VisualGraphSteps.getIncludeInferredStatementsCheckbox().and('be.checked')
461
466
  .and('not.be.disabled');
462
467
  // Expand results over owl:sameAs: true
463
- getSameAsCheckbox().and('be.checked')
468
+ VisualGraphSteps.getSameAsCheckbox().and('be.checked')
464
469
  .and('not.be.disabled');
465
470
  // Show predicate labels: true
466
- getShowPredicateLabelsCheckbox().and('be.checked')
471
+ VisualGraphSteps.getShowPredicateLabelsCheckbox().and('be.checked')
467
472
  .and('not.be.disabled');
468
473
 
469
474
  // No pre-added preferred/ignored types
470
- getPreferredTypesField().and('be.empty');
471
- getShowPreferredTypesOnlyCheckbox().and(('not.be.checked'))
475
+ VisualGraphSteps.getPreferredTypesField().and('be.empty');
476
+ VisualGraphSteps.getShowPreferredTypesOnlyCheckbox().and(('not.be.checked'))
472
477
  .and('not.be.disabled');
473
- getIgnoredTypesField().should('be.empty');
478
+ VisualGraphSteps.getIgnoredTypesField().should('be.empty');
474
479
 
475
480
  // Go to predicates tab
476
- openPredicatesTab();
481
+ VisualGraphSteps.openPredicatesTab();
477
482
  // No pre-added preferred/ignored predicates
478
- getPreferredPredicatesField().and('be.empty');
479
- getShowPreferredPredicatesOnlyCheckbox().and(('not.be.checked'))
483
+ VisualGraphSteps.getPreferredPredicatesField().and('be.empty');
484
+ VisualGraphSteps.getShowPreferredPredicatesOnlyCheckbox().and(('not.be.checked'))
480
485
  .and('not.be.disabled');
481
- getIgnoredPredicatesField().and('be.empty');
486
+ VisualGraphSteps.getIgnoredPredicatesField().and('be.empty');
482
487
  });
483
488
 
484
489
  it('Test include schema statements', () => {
485
490
  cy.searchEasyVisualGraph(DRY_GRAPH);
486
- getPredicates().should('contain', 'type');
487
- openVisualGraphSettings();
488
- getSettingsPanel().should('be.visible');
491
+ VisualGraphSteps.getPredicates().should('contain', 'type');
492
+ VisualGraphSteps.openVisualGraphSettings();
493
+ VisualGraphSteps.getSettingsPanel().should('be.visible');
489
494
  cy.get('.include-schema-statements').should('be.checked');
490
495
  cy.get('.include-schema-statements').uncheck();
491
- saveSettings();
492
- getPredicates().should('not.exist');
496
+ VisualGraphSteps.saveSettings();
497
+ VisualGraphSteps.getPredicates().should('not.exist');
493
498
  });
494
499
  });
495
-
496
- it('Test can create custom visual graph', () => {
497
- cy.visit('graphs-visualizations');
498
- getCreateCustomGraphLink().click();
499
- cy.url().should('include', '/config/save');
500
- getGraphConfigName().type('configName');
501
-
502
- cy.get('.page-1-link').should('be.visible')
503
- .and('contain', 'Starting point')
504
- .and('have.class', 'active');
505
- cy.get('.page-2-link').should('be.visible')
506
- .and('contain', 'Graph expansion');
507
- cy.get('.page-3-link').should('be.visible')
508
- .and('contain', 'Node basics');
509
- cy.get('.page-4-link').should('be.visible')
510
- .and('contain', 'Edge basics');
511
- cy.get('.page-5-link').should('be.visible')
512
- .and('contain', 'Node extra');
513
- cy.get('.page-2-link').click();
514
- cy.get('.page-2-link').should('have.class', 'active');
515
-
516
- cy.get('.expand-samples .list-group-item').first().click();
517
- getSaveConfig().click();
518
- cy.url().should('eq', Cypress.config('baseUrl') + '/graphs-visualizations');
519
- getGraphConfigurationsArea().should('be.visible')
520
- .and('contain', 'configName');
521
- getGraphConfigurationsArea().should('be.visible')
522
- .and('contain', 'No graph configs');
523
- });
524
-
525
- // Visual graph home view access
526
-
527
- function getSearchField() {
528
- return cy.get('.search-rdf-resources input:visible');
529
- }
530
-
531
- function searchForResource(resource) {
532
- // verify that the easy graph search has occured and a valid resource was input and only
533
- // after that execute the next operation
534
- cy.searchEasyVisualGraph(resource)
535
- .then(() => {
536
- // Verify redirection to existing visual graph
537
- cy.waitUntil(() =>
538
- cy.get('.graph-visualization')
539
- .find('.nodes-container')
540
- .then((nodesContainer) => nodesContainer))
541
- .then(() => {
542
- getNodes();
543
- });
544
- });
545
- }
546
-
547
- function getTargetNodeElement() {
548
- return cy.get(`[id="http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#${VALID_RESOURCE}"] circle`).should('be.visible');
549
- }
550
-
551
- function getTargetNode() {
552
- // The wait is needed because mouseover event will result in
553
- // pop-up of menu icons only if nodes are not moving
554
- return getTargetNodeElement().wait(5000);
555
- }
556
-
557
- function getNodes() {
558
- return cy.get('.node-wrapper').should('be.visible');
559
- }
560
-
561
- function getPredicates() {
562
- return cy.get('.predicate');
563
- }
564
-
565
- function getNodeInfoPanel() {
566
- return cy.get('.rdf-info-side-panel .tab-content');
567
- }
568
-
569
- function getSettingsPanel() {
570
- return cy.get('.rdf-info-side-panel .filter-sidepanel');
571
- }
572
-
573
- // Visual graph settings form field access
574
-
575
- function openPredicatesTab() {
576
- cy.get('.predicates-tab').should('be.visible').click();
577
- }
578
-
579
- function showPreferredTypes(enable) {
580
- const command = enable ? 'check' : 'uncheck';
581
- getShowPreferredTypesOnlyCheckbox()[command]();
582
- }
583
-
584
- function toggleInferredStatements(enable) {
585
- openVisualGraphSettings();
586
- getSettingsPanel().should('be.visible');
587
- const command = enable ? 'check' : 'uncheck';
588
- getIncludeInferredStatementsCheckbox()[command]();
589
- saveSettings();
590
- }
591
-
592
- function getLinksNumberField() {
593
- // This element could not be checked with 'be.visible' because it has
594
- // CSS property: 'position: fixed' and its being covered by another element
595
- return cy.get('.input-number');
596
- }
597
-
598
- function getSaveSettingsButton() {
599
- return cy.get('.save-settings-btn').scrollIntoView().should('be.visible');
600
- }
601
-
602
- function saveSettings() {
603
- getSaveSettingsButton().click();
604
- }
605
-
606
- function getResetSettingsButton() {
607
- return cy.get('.reset-settings').scrollIntoView().should('be.visible');
608
- }
609
-
610
- function resetSettings() {
611
- getResetSettingsButton().click();
612
- }
613
-
614
- function getSameAsCheckbox() {
615
- return cy.get('#sameAsCheck').should('be.visible');
616
- }
617
-
618
- function getIncludeInferredStatementsCheckbox() {
619
- return cy.get('.include-inferred-statements').should('be.visible');
620
- }
621
-
622
- function getShowPredicateLabelsCheckbox() {
623
- return cy.get('.show-predicate-labels').should('be.visible');
624
- }
625
-
626
- function getPreferredTypesField() {
627
- return cy.get('.preferred-types input').scrollIntoView().should('be.visible');
628
- }
629
-
630
- function getShowPreferredTypesOnlyCheckbox() {
631
- return cy.get('.show-preferred-types-only').should('be.visible');
632
- }
633
-
634
- function getIgnoredTypesField() {
635
- // This element could not be checked with 'be.visible' because it has
636
- // CSS property: 'position: fixed' and its being covered by another element
637
- return cy.get('.ignored-types input');
638
- }
639
-
640
- function getPreferredPredicatesField() {
641
- return cy.get('.preferred-predicates input').should('be.visible');
642
- }
643
-
644
- function getShowPreferredPredicatesOnlyCheckbox() {
645
- return cy.get('.show-preferred-predicates-only').should('be.visible');
646
- }
647
-
648
- function getIgnoredPredicatesField() {
649
- // This element could not be checked with 'be.visible' because it has
650
- // CSS property: 'position: fixed' and its being covered by another element
651
- return cy.get('.ignored-predicates input');
652
- }
653
-
654
- function getCreateCustomGraphLink() {
655
- return cy.get('.create-graph-config').should('be.visible');
656
- }
657
-
658
- function getGraphConfigName() {
659
- return cy.get('.graph-config-name').should('be.visible');
660
- }
661
-
662
- function getSaveConfig() {
663
- return cy.get('.btn-save-config').should('be.visible');
664
- }
665
-
666
- function getGraphConfigurationsArea() {
667
- return cy.get('.graph-configurations');
668
- }
669
-
670
-
671
- // Node actions
672
-
673
- function collapseGraph() {
674
- cy.get('.menu-events .collapse-icon circle').should('be.visible').click();
675
- }
676
-
677
- function expandGraph() {
678
- cy.get('.menu-events .expand-icon circle').should('be.visible').click();
679
- }
680
-
681
- function removeNode() {
682
- cy.get('.menu-events .close-icon circle').click({force: true});
683
- }
684
-
685
- // Visual graph toolbar actions
686
-
687
- function openVisualGraphSettings() {
688
- return cy.get('.toolbar-holder').should('be.visible')
689
- .find('.visual-graph-settings-btn')
690
- .should('be.visible').click();
691
- }
692
-
693
- function openVisualGraphHome() {
694
- cy.get('.toolbar-holder').should('be.visible')
695
- .find('.return-home-btn').should('be.visible').click();
696
- }
697
-
698
- function updateLinksLimitField(value) {
699
- return getLinksNumberField().invoke('val', value).trigger('change', {force: true});
700
- }
701
500
  });