graphdb-workbench-tests 3.3.3 → 3.4.0-SPARQL12-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 (74) hide show
  1. package/cypress-flaky.config.js +2 -0
  2. package/cypress-legacy.config.js +2 -2
  3. package/cypress-security.config.js +3 -14
  4. package/e2e-flaky/import/import-server-files-operations.spec.js +1 -1
  5. package/e2e-flaky/import/import-user-data-batch-operations.spec.js +1 -1
  6. package/e2e-flaky/setup/sparql-template-create.js +3 -18
  7. package/e2e-flaky/sparql-editor/actions/execute-update-query.spec.js +2 -12
  8. package/e2e-flaky/sparql-editor/actions/share-query.spec.js +1 -7
  9. package/e2e-flaky/sparql-editor/yasr/table-plugin.spec.js +1 -6
  10. package/e2e-legacy/cluster/cluster-states.spec.js +3 -3
  11. package/e2e-legacy/explore/visual-graph/node-info-panel.spec.js +58 -0
  12. package/e2e-legacy/explore/visual-graph/visual-graph-links-limit.spec.js +142 -0
  13. package/e2e-legacy/explore/visual-graph/visual.graph.spec.js +57 -85
  14. package/e2e-legacy/guides/execute-sparql-query/execute-sparql-query-guide.spec.js +92 -0
  15. package/e2e-legacy/guides/import-rdf-file/confirm-duplicate-rdf-file.spec.js +63 -0
  16. package/e2e-legacy/guides/import-rdf-file/import-rdf-file.spec.js +105 -0
  17. package/e2e-legacy/guides/navigation/navigation-guide.spec.js +64 -0
  18. package/e2e-legacy/guides/rdf-rank/rdf-rank-guide.spec.js +42 -0
  19. package/e2e-legacy/guides/table-graph-explore/table-graph-explore-guide.spec.js +168 -0
  20. package/e2e-legacy/guides/ttyg/configure-agent/configure-agent-guide.spec.js +34 -26
  21. package/e2e-legacy/guides/ttyg/edit-agent/edit-ttyg-agent-guide.spec.js +2 -2
  22. package/e2e-legacy/guides/visual-graph/visual-graph-guide.spec.js +372 -0
  23. package/e2e-legacy/guides/welcome/welcome-guide.spec.js +36 -0
  24. package/e2e-legacy/help/guides/guides-autostart.spec.js +36 -3
  25. package/e2e-legacy/help/guides/guides-confirm-cancel-dialog.js +83 -0
  26. package/e2e-legacy/help/guides/movies-interactive-guide.spec.js +47 -49
  27. package/e2e-legacy/repository/url-with-repository-id-parameter.spec.js +1 -0
  28. package/e2e-legacy/resource/resource.spec.js +34 -19
  29. package/e2e-legacy/setup/aclmanagement/acl-management-with-selected repository.spec.js +44 -0
  30. package/e2e-legacy/setup/aclmanagement/create-rule.spec.js +3 -0
  31. package/e2e-legacy/setup/connectors-lucene.spec.js +24 -8
  32. package/e2e-legacy/sparql-editor/actions/expand-results-over-sameas.spec.js +1 -1
  33. package/e2e-legacy/sparql-editor/actions/show-saved-queries.spec.js +1 -6
  34. package/e2e-legacy/sparql-editor/yasgui-tabs.spec.js +2 -12
  35. package/e2e-legacy/sparql-editor/yasr/pagination.spec.js +5 -18
  36. package/e2e-legacy/sparql-editor/yasr/table-plugin.spec.js +1 -6
  37. package/e2e-legacy/sparql-editor/yasr/toolbar/visual-graph-button.spec.js +90 -41
  38. package/e2e-legacy/sparql-editor/yasr/yasr.spec.js +80 -0
  39. package/e2e-legacy/ttyg/chat-list.spec.js +2 -12
  40. package/e2e-legacy/ttyg/create-agent.spec.js +8 -48
  41. package/e2e-legacy/ttyg/edit-agent.spec.js +2 -12
  42. package/e2e-security/setup/users-and-access/turn-on-security-and-password-change.spec.js +73 -61
  43. package/fixtures/graph/graph-configurations.json +59 -0
  44. package/fixtures/guides/confirm-cancel-dialog/confirm-cancel-dialog-guide.json +15 -0
  45. package/fixtures/guides/execute-sparql-query/execute-sparql-query-guide.json +54 -0
  46. package/fixtures/guides/import-rdf-file/confirm-duplicate-rdf-file-guide.json +30 -0
  47. package/fixtures/guides/import-rdf-file/import-rdf-file-guide.json +21 -0
  48. package/fixtures/guides/navigation/navigation-guide.json +60 -0
  49. package/fixtures/guides/rdf-rank/rdf-rank-guide.json +18 -0
  50. package/fixtures/guides/table-graph-explore/table-graph-explore-guide.json +51 -0
  51. package/fixtures/guides/table-graph-explore/table-graph-explore-without-substeps-guide.json +25 -0
  52. package/fixtures/guides/ttyg/configure-agent/configure-ttyg-agent-guide.json +6 -1
  53. package/fixtures/guides/visual-graph/visual-graph-config-guide.json +39 -0
  54. package/fixtures/guides/visual-graph/visual-graph-guide.json +85 -0
  55. package/fixtures/guides/welcome/welcome-guide.json +18 -0
  56. package/npm-shrinkwrap.json +332 -279
  57. package/package.json +1 -1
  58. package/steps/guides/guide-dialog-steps.js +60 -2
  59. package/steps/guides/movies-guide-steps.js +2 -1
  60. package/steps/main-menu-steps.js +1 -0
  61. package/steps/repository-steps.js +24 -0
  62. package/steps/resource/resource-steps.js +0 -8
  63. package/steps/setup/acl-management-steps.js +16 -0
  64. package/steps/sparql-editor-steps.js +18 -4
  65. package/steps/sparql-steps.js +13 -1
  66. package/steps/ttyg/ttyg-agent-settings-modal.steps.js +1 -1
  67. package/steps/visual-graph-split-button-steps.js +45 -0
  68. package/steps/visual-graph-steps.js +80 -2
  69. package/steps/yasgui/yasqe-steps.js +29 -4
  70. package/steps/yasgui/yasr-steps.js +31 -5
  71. package/stubs/graph-config-stubs.js +17 -0
  72. package/stubs/guides/guides-stubs.js +41 -1
  73. package/support/commands.js +1 -0
  74. package/support/url-commands.js +13 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "3.3.3",
3
+ "version": "3.4.0-SPARQL12-TR1",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,4 +1,6 @@
1
- export class GuideDialogSteps {
1
+ import {BaseSteps} from "../base-steps.js";
2
+
3
+ export class GuideDialogSteps extends BaseSteps {
2
4
 
3
5
  static getModalDialog() {
4
6
  return cy.get('.shepherd-content:visible');
@@ -8,6 +10,50 @@ export class GuideDialogSteps {
8
10
  return GuideDialogSteps.getModalDialog().find('.shepherd-header');
9
11
  }
10
12
 
13
+ static getCancelButton() {
14
+ return this.getHeader().find('.shepherd-cancel-icon');
15
+ }
16
+
17
+ static clickOnCancelButton() {
18
+ return this.getCancelButton().click();
19
+ }
20
+
21
+ static getConfirmCancelDialog() {
22
+ return this.getByTestId('confirm-cancel-dialog');
23
+ }
24
+
25
+ static getConfirmCancelDialogCloseButton() {
26
+ return this.getByTestId('close-dialog-btn');
27
+ }
28
+
29
+ static clickOnConfirmCancelDialogCloseButton() {
30
+ return this.getConfirmCancelDialogCloseButton().click();
31
+ }
32
+
33
+ static getConfirmCancelDialogCancelButton() {
34
+ return this.getByTestId('cancel-btn');
35
+ }
36
+
37
+ static clickConfirmCancelDialogCancelButton() {
38
+ return this.getConfirmCancelDialogCancelButton().click();
39
+ }
40
+
41
+ static getConfirmCancelDialogDontShowAgainButton() {
42
+ return this.getByTestId('dont-show-again-btn');
43
+ }
44
+
45
+ static clickConfirmCancelDialogDontShowAgainButton() {
46
+ return this.getConfirmCancelDialogDontShowAgainButton().click();
47
+ }
48
+
49
+ static getConfirmCancelDialogExitButton() {
50
+ return this.getByTestId('exit-btn');
51
+ }
52
+
53
+ static clickConfirmCancelDialogExitButton() {
54
+ return this.getConfirmCancelDialogExitButton().click();
55
+ }
56
+
11
57
  static getContent() {
12
58
  return GuideDialogSteps.getModalDialog().find('.shepherd-text');
13
59
  }
@@ -28,8 +74,12 @@ export class GuideDialogSteps {
28
74
  return GuideDialogSteps.getFooter().find('.shepherd-button').contains('Close');
29
75
  }
30
76
 
77
+ static getSkipButton() {
78
+ return GuideDialogSteps.getFooter().find('.shepherd-button').contains('Skip');
79
+ }
80
+
31
81
  static clickOnNextButton(forceVisible = false) {
32
- GuideDialogSteps.getNextButton().scrollIntoView().click({force: forceVisible});
82
+ return GuideDialogSteps.getNextButton().scrollIntoView().click({force: forceVisible});
33
83
  }
34
84
 
35
85
  static clickOnPreviousButton(forceVisible = false) {
@@ -40,6 +90,10 @@ export class GuideDialogSteps {
40
90
  GuideDialogSteps.getCloseButton().scrollIntoView().click();
41
91
  }
42
92
 
93
+ static clickOnSkipButton() {
94
+ GuideDialogSteps.getSkipButton().scrollIntoView().click();
95
+ }
96
+
43
97
  static getContentLink() {
44
98
  return GuideDialogSteps.getContent().find('a');
45
99
  }
@@ -56,4 +110,8 @@ export class GuideDialogSteps {
56
110
  static assertDialogIsClosed() {
57
111
  GuideDialogSteps.getModalDialog().should('not.exist');
58
112
  }
113
+
114
+ static copyQueryToEditor() {
115
+ GuideDialogSteps.getModalDialog().find('.guide-copy-to-editor-query-button').click();
116
+ }
59
117
  }
@@ -5,6 +5,7 @@ import {VisualGraphSteps} from "../visual-graph-steps";
5
5
  import {YasrSteps} from "../yasgui/yasr-steps";
6
6
  import {YasqeSteps} from "../yasgui/yasqe-steps";
7
7
  import {ResourceSteps} from "../resource/resource-steps";
8
+ import {VisualGraphSplitButtonSteps} from '../visual-graph-split-button-steps.js';
8
9
 
9
10
  export class MoviesGuideSteps {
10
11
 
@@ -181,7 +182,7 @@ export class MoviesGuideSteps {
181
182
  static assertExploreRDFStep7() {
182
183
  GuideSteps.assertPageNotInteractive();
183
184
  GuideDialogSteps.assertDialogWithTitleIsVisible('Explore RDF as a table — 7/10');
184
- ResourceSteps.getVisualGraphButton().should('be.visible');
185
+ VisualGraphSplitButtonSteps.getVisualizeMainButton().should('be.visible');
185
186
  }
186
187
 
187
188
  static assertExploreRDFStep8() {
@@ -16,6 +16,7 @@ export class MainMenuSteps {
16
16
  return MainMenuSteps.getMenuButton('Import');
17
17
  }
18
18
 
19
+ // TODO: temporary using more complex implementation until we have two SPARQL menu elements in the navbar
19
20
  static getMenuSparql() {
20
21
  return MainMenuSteps.getMenuButton('SPARQL');
21
22
  }
@@ -16,6 +16,14 @@ export class RepositorySteps extends BaseSteps {
16
16
  cy.visit(`repository/edit/${repositoryId}?location=`);
17
17
  }
18
18
 
19
+ static getRepositoryPage() {
20
+ return cy.get('#wb-repository');
21
+ }
22
+
23
+ static getRepositoriesPage() {
24
+ return cy.get('#wb-repositories');
25
+ }
26
+
19
27
  static getCreateRepositoryButton() {
20
28
  return cy.get('#wb-repositories-addRepositoryLink');
21
29
  }
@@ -135,6 +143,10 @@ export class RepositorySteps extends BaseSteps {
135
143
  RepositorySteps.getRepositoryTypeButton(type).click();
136
144
  }
137
145
 
146
+ static createFedexRepositoryType() {
147
+ RepositorySteps.chooseRepositoryType('fedx');
148
+ }
149
+
138
150
  static getGDBRepositoryTypeButton() {
139
151
  return RepositorySteps.getRepositoryTypeButton('gdb');
140
152
  }
@@ -354,4 +366,16 @@ export class RepositorySteps extends BaseSteps {
354
366
  static getEntityIndexSize() {
355
367
  return RepositorySteps.getRepositoryCreateForm().find('#entityIndexSize');
356
368
  }
369
+
370
+ static getFedexMembersPanel() {
371
+ return this.getRepositoryPage().find('#fedx-members');
372
+ }
373
+
374
+ static selectFedexMember(repositoryId) {
375
+ this.getFedexMembersPanel()
376
+ .find('.form-local-repos')
377
+ .find('.location-item')
378
+ .contains(repositoryId)
379
+ .click();
380
+ }
357
381
  }
@@ -61,14 +61,6 @@ export class ResourceSteps {
61
61
  cy.get('.download-options li').eq(option).click();
62
62
  }
63
63
 
64
- static getVisualGraphButton() {
65
- return cy.get('.visual-graph-btn');
66
- }
67
-
68
- static clickOnVisualGraphButton() {
69
- ResourceSteps.getVisualGraphButton().click();
70
- }
71
-
72
64
  static getEditResourceLink() {
73
65
  return cy.get('.edit-resource-link');
74
66
  }
@@ -11,6 +11,18 @@ export class AclManagementSteps {
11
11
  return this.getPage().find('#acl-management-view-title');
12
12
  }
13
13
 
14
+ static getFedexWarningMessage() {
15
+ return this.getPage().find('.unexpected-fedex-repository-warning');
16
+ }
17
+
18
+ static getAclManagementContainer() {
19
+ return this.getPage().find('.acl-management-container');
20
+ }
21
+
22
+ static getAclManagementContent() {
23
+ return this.getPage().find('.acl-management-content');
24
+ }
25
+
14
26
  static getAclTable() {
15
27
  return this.getPage().find('.acl-rules');
16
28
  }
@@ -165,6 +177,10 @@ export class AclManagementSteps {
165
177
  this.getRoleField(index).clear().type(value);
166
178
  }
167
179
 
180
+ static blurRole(index) {
181
+ this.getRoleField(index).blur();
182
+ }
183
+
168
184
  static getFieldError() {
169
185
  return cy.get('div.small');
170
186
  }
@@ -1,14 +1,16 @@
1
1
  import {YasqeSteps} from "./yasgui/yasqe-steps";
2
+ import {YasrSteps} from './yasgui/yasr-steps.js';
2
3
 
3
4
  const VIEW_URL = '/sparql';
4
5
 
5
6
  export class SparqlEditorSteps {
6
- static visitSparqlEditorPage() {
7
- cy.visit(VIEW_URL);
7
+ static visitSparqlEditorPage(urlParameters) {
8
+ const url = urlParameters ? `${VIEW_URL}?${urlParameters}` : VIEW_URL;
9
+ cy.visit(url);
8
10
  }
9
11
 
10
- static visitSparqlEditorPageAndWaitForEditor() {
11
- SparqlEditorSteps.visitSparqlEditorPage();
12
+ static visitSparqlEditorPageAndWaitForEditor(urlParameters ) {
13
+ SparqlEditorSteps.visitSparqlEditorPage(urlParameters);
12
14
  // Because we use angularjs less than 1.7.3 we use additional library ng-custom-element.umd.js to solve problem with property bindings
13
15
  // This library make additional call to ontotext-yasgui-web-component and the component that's way the component renders twice when page loaded.
14
16
  // 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.
@@ -19,6 +21,18 @@ export class SparqlEditorSteps {
19
21
  YasqeSteps.waitUntilQueryIsVisible();
20
22
  }
21
23
 
24
+ static visitSparqlEditorPageAndWaitForResults(urlParameters ) {
25
+ SparqlEditorSteps.visitSparqlEditorPage(urlParameters);
26
+ // Because we use angularjs less than 1.7.3 we use additional library ng-custom-element.umd.js to solve problem with property bindings
27
+ // This library make additional call to ontotext-yasgui-web-component and the component that's way the component renders twice when page loaded.
28
+ // 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.
29
+ // If time of clicking such element is when second call to the component is done then exception that element is detached will be thrown.
30
+ // We will wait a little , to give a chance page is loaded correctly before test start.
31
+ // eslint-disable-next-line cypress/no-unnecessary-waiting
32
+ cy.wait(1000);
33
+ YasrSteps.waitUntilResultsIsVisible();
34
+ }
35
+
22
36
  static verifyUrl() {
23
37
  cy.url().should('include', `${Cypress.config('baseUrl')}${VIEW_URL}`);
24
38
  }
@@ -63,8 +63,12 @@ class SparqlSteps {
63
63
  this.getLoader().should('not.exist');
64
64
  }
65
65
 
66
+ static getActiveTabPanel() {
67
+ return cy.get('.tabPanel.active');
68
+ }
69
+
66
70
  static getRunQueryButton() {
67
- return cy.get('#wb-sparql-runQuery');
71
+ return this.getActiveTabPanel().find('.yasqe_queryButton');
68
72
  }
69
73
 
70
74
  static getNoQueryRunInfo() {
@@ -124,6 +128,14 @@ class SparqlSteps {
124
128
  return cy.get('#saveAsBtn');
125
129
  }
126
130
 
131
+ static getVisualBtn() {
132
+ return this.getActiveTabPanel().find('.explore-visual-graph-button');
133
+ }
134
+
135
+ static visualizeConstructQuery() {
136
+ this.getVisualBtn().click();
137
+ }
138
+
127
139
  static getEditorAndResultsBtn() {
128
140
  return cy.get('.editor-and-results-btn');
129
141
  }
@@ -429,7 +429,7 @@ export class TtygAgentSettingsModalSteps extends ModalDialogSteps {
429
429
  }
430
430
 
431
431
  static enterContextSize(input) {
432
- this.getContextSizeField().type(input);
432
+ this.getContextSizeField().type(input, {force: true});
433
433
  }
434
434
 
435
435
  static getContextSizeError() {
@@ -0,0 +1,45 @@
1
+ export class VisualGraphSplitButtonSteps {
2
+ static getGraphExploreSplitButton() {
3
+ return cy.get('onto-graph-explore-split-button');
4
+ }
5
+
6
+ static getVisualizeMainButton() {
7
+ return VisualGraphSplitButtonSteps.getGraphExploreSplitButton().find('.explore-visual-graph-button');
8
+ }
9
+
10
+ static clickOnVisualizeMainButton() {
11
+ VisualGraphSplitButtonSteps.getVisualizeMainButton().click();
12
+ }
13
+
14
+ static getDropdownToggleButton() {
15
+ return VisualGraphSplitButtonSteps.getGraphExploreSplitButton().find('.onto-dropdown-button');
16
+ }
17
+
18
+ static toggleGraphConfigDropdown() {
19
+ VisualGraphSplitButtonSteps.getDropdownToggleButton().click();
20
+ }
21
+
22
+ static getGraphConfigs() {
23
+ return VisualGraphSplitButtonSteps.getGraphExploreSplitButton().find('.onto-dropdown-menu-item');
24
+ }
25
+
26
+ static getGraphConfig(index = 0) {
27
+ return VisualGraphSplitButtonSteps.getGraphConfigs().eq(index);
28
+ }
29
+
30
+ static selectGraphConfig(index = 0) {
31
+ VisualGraphSplitButtonSteps.getGraphConfig(index).click();
32
+ }
33
+
34
+ static getCreateGraphConfigLink() {
35
+ return VisualGraphSplitButtonSteps.getGraphExploreSplitButton().find('.graph-create-link');
36
+ }
37
+
38
+ static clickCreateGraphConfigLink() {
39
+ VisualGraphSplitButtonSteps.getCreateGraphConfigLink().click();
40
+ }
41
+
42
+ static getNoConfigurationsMessage() {
43
+ return VisualGraphSplitButtonSteps.getGraphExploreSplitButton().find('.no-configurations-message');
44
+ }
45
+ }
@@ -87,6 +87,30 @@ export class VisualGraphSteps extends BaseSteps {
87
87
  return cy.get('.autocomplete-toast a');
88
88
  }
89
89
 
90
+ static getRdfResourceSearchInput() {
91
+ return cy.getByTestId('rdf-resource-input');
92
+ }
93
+
94
+ static searchForRdfResource(resource) {
95
+ this.getRdfResourceSearchInput().type(resource, {force: true});
96
+ }
97
+
98
+ static shareVisualGraphWithOtherUsers() {
99
+ this.getShareGraphButton().click();
100
+ }
101
+
102
+ static getShareGraphButton() {
103
+ return cy.getByTestId('share-graph-config');
104
+ }
105
+
106
+ static selectConfig(configName) {
107
+ this.getConfigByName(configName).click();
108
+ }
109
+
110
+ static getConfigByName(name) {
111
+ return cy.getByTestId(`graph-config-${name}`);
112
+ }
113
+
90
114
  static getGraphVisualizationNodes() {
91
115
  return this.getGraphVisualizationPane().find('.node-wrapper');
92
116
  }
@@ -148,6 +172,14 @@ export class VisualGraphSteps extends BaseSteps {
148
172
  return cy.get(`[id="${nodeId}"] circle`);
149
173
  }
150
174
 
175
+ static clickOnNode(nodeId) {
176
+ this.getCircleOfNodeByNodeId(nodeId).click();
177
+ }
178
+
179
+ static dblclickOnNode(nodeId) {
180
+ this.getCircleOfNodeByNodeId(nodeId).trigger('dblclick');
181
+ }
182
+
151
183
  static getLineBetweenNodesById(narrowId) {
152
184
  return cy.get(`[id="${narrowId}"] line`);
153
185
  }
@@ -157,13 +189,31 @@ export class VisualGraphSteps extends BaseSteps {
157
189
  }
158
190
 
159
191
  static getSidePanelCloseButton() {
160
- return cy.get('');
192
+ return this.getSidePanelContent().find('.close');
161
193
  }
162
194
 
163
195
  static getSidePanelContent() {
164
196
  return cy.get('.rdf-side-panel-content');
165
197
  }
166
198
 
199
+ static getPropertyByIndex(index) {
200
+ return this.getSidePanelContent().find('.rdf-list .datasource').eq(index);
201
+ }
202
+
203
+ static closeSidePanel() {
204
+ this.getSidePanelCloseButton().click();
205
+ }
206
+
207
+ // Note the index is 1-based
208
+ static openConfigTab(tabIndex) {
209
+ return this.getConfigTab(tabIndex).click();
210
+ }
211
+
212
+ // Note the index is 1-based
213
+ static getConfigTab(tabIndex) {
214
+ return cy.getByTestId(`graph-config-tab-${tabIndex}`);
215
+ }
216
+
167
217
  // Visual graph settings form field access
168
218
 
169
219
  static openPredicatesTab() {
@@ -251,12 +301,32 @@ export class VisualGraphSteps extends BaseSteps {
251
301
  return cy.get('.create-graph-config').should('be.visible');
252
302
  }
253
303
 
304
+ static createCustomGraph() {
305
+ this.getCreateCustomGraphLink().click();
306
+ }
307
+
254
308
  static getGraphConfigName() {
255
309
  return cy.get('.graph-config-name').should('be.visible');
256
310
  }
257
311
 
258
312
  static typeGraphConfigName(name) {
259
- this.getGraphConfigName().type(name);
313
+ this.getGraphConfigName().type(name, {force: true});
314
+ }
315
+
316
+ static typeGraphConfigDescription(description) {
317
+ return this.getGraphConfigDescription().type(description, {force: true});
318
+ }
319
+
320
+ static getGraphConfigDescription() {
321
+ return cy.get('.graph-config-description').should('be.visible');
322
+ }
323
+
324
+ static typeGraphConfigHint(hint) {
325
+ return this.getGraphConfigHint().type(hint, {force: true});
326
+ }
327
+
328
+ static getGraphConfigHint() {
329
+ return cy.get('.graph-config-example').should('be.visible');
260
330
  }
261
331
 
262
332
  static getSaveConfigButton() {
@@ -337,6 +407,10 @@ export class VisualGraphSteps extends BaseSteps {
337
407
  return this.getTruncateLabelsCheckbox().click();
338
408
  }
339
409
 
410
+ static getInvalidLinksMessage() {
411
+ return this.getByTestId('invalid-links-limit');
412
+ }
413
+
340
414
  static openVisualGraphHome() {
341
415
  cy.get('.toolbar-holder').should('be.visible')
342
416
  .find('.return-home-btn').should('be.visible').click();
@@ -429,6 +503,10 @@ export class VisualGraphSteps extends BaseSteps {
429
503
  .find('#auto-complete-results-wrapper .result-item').eq(index).click();
430
504
  }
431
505
 
506
+ static clickOnAutocompleteElement(elementText) {
507
+ cy.get('.result-item').contains(elementText).click();
508
+ }
509
+
432
510
  static getSelectedStartNodeUri() {
433
511
  return this.getStartNodeSelectorComponent().find('.selected-node code');
434
512
  }
@@ -35,8 +35,29 @@ export class YasqeSteps {
35
35
  return YasqeSteps.getYasqe().find('.yasqe_queryButton');
36
36
  }
37
37
 
38
+ /**
39
+ * Clicks on the execute query button and hides the tooltip, which is sometimes overlapping the button and prevents
40
+ * it from being clicked.
41
+ * @param force - whether to force the click and mouseleave events. This is needed when testing a guide, because the
42
+ * shepherd's overlay is overlapping the button and prevents it from being clicked. In other scenarios, it is better
43
+ * not to force the click, because we want to make sure that the button is actually clickable by the user.
44
+ */
45
+ static clickExecuteQueryButtonAndHideTooltip(force = false) {
46
+ this.getExecuteQueryButton().click({force});
47
+ this.getExecuteQueryButton().trigger('mouseleave', {force: true});
48
+ }
49
+
38
50
  static executeQuery() {
39
- this.getExecuteQueryButton().click();
51
+ this.clickExecuteQueryButtonAndHideTooltip();
52
+ YasrSteps.getResponseInfo()
53
+ .should('not.have.class', 'hidden')
54
+ .should('not.have.class', 'empty')
55
+ .should('be.visible');
56
+ }
57
+
58
+ // This step is needed when testing a guide. The shepherd's overlay is overlapping somehow the button.
59
+ static forceExecuteQuery() {
60
+ this.clickExecuteQueryButtonAndHideTooltip(true);
40
61
  YasrSteps.getResponseInfo()
41
62
  .should('not.have.class', 'hidden')
42
63
  .should('not.have.class', 'empty')
@@ -44,11 +65,11 @@ export class YasqeSteps {
44
65
  }
45
66
 
46
67
  static executeQueryWithoutWaiteResult() {
47
- this.getExecuteQueryButton().click();
68
+ this.clickExecuteQueryButtonAndHideTooltip();
48
69
  }
49
70
 
50
71
  static executeErrorQuery() {
51
- this.getExecuteQueryButton().click();
72
+ this.clickExecuteQueryButtonAndHideTooltip();
52
73
  // Wait a wile for the response information to be present.
53
74
  cy.get('.error-response-plugin').should('be.visible');
54
75
  }
@@ -95,7 +116,11 @@ export class YasqeSteps {
95
116
  return cy.waitUntil(() =>
96
117
  this.getEditor().find('.CodeMirror')
97
118
  .then((codeMirrorEl) => {
98
- return codeMirrorEl && codeMirrorEl[0].CodeMirror.getValue().indexOf(query) !== -1;
119
+ if (codeMirrorEl && codeMirrorEl[0].CodeMirror.getValue().indexOf(query) !== -1) {
120
+ return true;
121
+ } else {
122
+ cy.fail('Query in editor is not as expected. Expected query:\n' + query + '\nActual query:\n' + codeMirrorEl[0].CodeMirror.getValue());
123
+ }
99
124
  }));
100
125
  }
101
126
 
@@ -1,8 +1,14 @@
1
- export class YasrSteps {
1
+ import {BaseSteps} from "../base-steps.js";
2
+
3
+ export class YasrSteps extends BaseSteps {
2
4
  static getYasr() {
3
5
  return cy.get('.tabPanel.active .yasr');
4
6
  }
5
7
 
8
+ static waitUntilResultsIsVisible() {
9
+ return cy.waitUntil(() => this.getYasr().should('be.visible'));
10
+ }
11
+
6
12
  static getResultHeader() {
7
13
  return cy.get('.yasr_header');
8
14
  }
@@ -63,6 +69,10 @@ export class YasrSteps {
63
69
  this.getResultCell(rowNumber, cellNumber).realHover();
64
70
  }
65
71
 
72
+ static clickOnResource(rowNumber, cellNumber) {
73
+ this.getResultCell(rowNumber, cellNumber).find('.uri-link').click({force: true});
74
+ }
75
+
66
76
  static getCopyResourceLink(rowNumber, cellNumber) {
67
77
  return this.getResultCell(rowNumber, cellNumber)
68
78
  .realHover()
@@ -103,10 +113,6 @@ export class YasrSteps {
103
113
  return YasrSteps.getYasr().find('.yasr-toolbar');
104
114
  }
105
115
 
106
- static getVisualButton() {
107
- return YasrSteps.getYasrToolbar().find('.explore-visual-graph-button');
108
- }
109
-
110
116
  static getNoDataElement() {
111
117
  return cy.get('.dataTables_empty');
112
118
  }
@@ -114,4 +120,24 @@ export class YasrSteps {
114
120
  static getNoResultsMessage() {
115
121
  return YasrSteps.getYasr().find('.alert-success');
116
122
  }
123
+
124
+ static getPivotTablePlugin() {
125
+ return YasrSteps.getYasr().find('.pivot-table-plugin');
126
+ }
127
+
128
+ static getGoogleChartPlugin() {
129
+ return YasrSteps.getYasr().find('.google-visualization-table');
130
+ }
131
+
132
+ static getExtendedTablePlugin() {
133
+ return YasrSteps.getYasr().find('.dataTables_wrapper');
134
+ }
135
+
136
+ static getFullscreenButton() {
137
+ return cy.get('.yasr-fullscreen-button');
138
+ }
139
+
140
+ static toggleFullscreen() {
141
+ YasrSteps.getFullscreenButton().click();
142
+ }
117
143
  }
@@ -0,0 +1,17 @@
1
+ import {Stubs} from './stubs.js';
2
+
3
+ export class GraphConfigStubs extends Stubs {
4
+ static stubGetEmptyGraphConfigs() {
5
+ cy.intercept('GET', '/rest/explore-graph/config', {
6
+ statusCode: 200,
7
+ body: [],
8
+ }).as('getEmptyGraphConfigs');
9
+ }
10
+
11
+ static stubGetGraphConfigs(fixture = '/graph/graph-configurations.json') {
12
+ GraphConfigStubs.stubQueryResponse(
13
+ '/rest/explore-graph/config',
14
+ fixture,
15
+ 'getGraphConfigs');
16
+ }
17
+ }
@@ -47,10 +47,50 @@ export class GuidesStubs {
47
47
  GuidesStubs.stubWithFixture('../fixtures/guides/main-menu/main-menu-guide.json');
48
48
  }
49
49
 
50
+ static stubExecuteSparqlQueryGuide() {
51
+ GuidesStubs.stubWithFixture('../fixtures/guides/execute-sparql-query/execute-sparql-query-guide.json');
52
+ }
53
+
50
54
  static stubDownloadResource(resourcePath, resourceFile) {
51
55
  cy.intercept('GET', `/rest/guides/download/${resourcePath}/${resourceFile}`, {
52
56
  fixture: `guides/download-resource.ttl`,
53
- }).as('resource-download');;
57
+ }).as('resource-download');
58
+ }
59
+
60
+ static stubImportRDFFileGuide() {
61
+ GuidesStubs.stubWithFixture('../fixtures/guides/import-rdf-file/import-rdf-file-guide.json');
62
+ }
63
+
64
+ static stubConfirmDuplicatedRDFFileGuide() {
65
+ GuidesStubs.stubWithFixture('../fixtures/guides/import-rdf-file/confirm-duplicate-rdf-file-guide.json');
66
+ }
67
+
68
+ static stubRDFRankGuide() {
69
+ GuidesStubs.stubWithFixture('../fixtures/guides/rdf-rank/rdf-rank-guide.json');
70
+ }
71
+
72
+ static stubTableGraphExploreWithoutSubstepsGuide() {
73
+ GuidesStubs.stubWithFixture('../fixtures/guides/table-graph-explore/table-graph-explore-without-substeps-guide.json');
74
+ }
75
+
76
+ static stubTableGraphExploreGuide() {
77
+ GuidesStubs.stubWithFixture('../fixtures/guides/table-graph-explore/table-graph-explore-guide.json');
78
+ }
79
+ static stubWelcomGuide() {
80
+ GuidesStubs.stubWithFixture('../fixtures/guides/welcome/welcome-guide.json');
81
+ }
82
+
83
+
84
+ static stubVisualGraphGuide() {
85
+ GuidesStubs.stubWithFixture('../fixtures/guides/visual-graph/visual-graph-guide.json');
86
+ }
87
+
88
+ static stubVisualGraphConfigGuide() {
89
+ GuidesStubs.stubWithFixture('../fixtures/guides/visual-graph/visual-graph-config-guide.json');
90
+ }
91
+
92
+ static stubNavigationGuide() {
93
+ GuidesStubs.stubWithFixture('../fixtures/guides/navigation/navigation-guide.json');
54
94
  }
55
95
 
56
96
  static stubWithFixture(fixturePath) {
@@ -8,6 +8,7 @@ import './user-commands';
8
8
  import './security-command';
9
9
  import './connector-commands';
10
10
  import 'cypress-wait-until';
11
+ import './url-commands.js';
11
12
 
12
13
  /**
13
14
  * Loads fixtures from the given paths recursively and returns them as an array.