graphdb-workbench-tests 3.3.3-TR1 → 3.4.0-migrated-guide-services

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 (57) 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/explore/visual-graph/visual.graph.spec.js +2 -7
  11. package/e2e-legacy/guides/execute-sparql-query/execute-sparql-query-guide.spec.js +92 -0
  12. package/e2e-legacy/guides/import-rdf-file/confirm-duplicate-rdf-file.spec.js +63 -0
  13. package/e2e-legacy/guides/import-rdf-file/import-rdf-file.spec.js +105 -0
  14. package/e2e-legacy/guides/navigation/navigation-guide.spec.js +64 -0
  15. package/e2e-legacy/guides/rdf-rank/rdf-rank-guide.spec.js +42 -0
  16. package/e2e-legacy/guides/table-graph-explore/table-graph-explore-guide.spec.js +167 -0
  17. package/e2e-legacy/guides/ttyg/edit-agent/edit-ttyg-agent-guide.spec.js +2 -2
  18. package/e2e-legacy/guides/visual-graph/visual-graph-guide.spec.js +388 -0
  19. package/e2e-legacy/guides/welcome/welcome-guide.spec.js +36 -0
  20. package/e2e-legacy/help/guides/guides-autostart.spec.js +36 -3
  21. package/e2e-legacy/help/guides/guides-confirm-cancel-dialog.js +83 -0
  22. package/e2e-legacy/help/guides/movies-interactive-guide.spec.js +47 -49
  23. package/e2e-legacy/repository/url-with-repository-id-parameter.spec.js +1 -0
  24. package/e2e-legacy/resource/resource.spec.js +1 -6
  25. package/e2e-legacy/setup/aclmanagement/create-rule.spec.js +3 -0
  26. package/e2e-legacy/setup/connectors-lucene.spec.js +24 -8
  27. package/e2e-legacy/sparql-editor/actions/expand-results-over-sameas.spec.js +1 -1
  28. package/e2e-legacy/sparql-editor/actions/show-saved-queries.spec.js +1 -6
  29. package/e2e-legacy/sparql-editor/yasgui-tabs.spec.js +2 -12
  30. package/e2e-legacy/sparql-editor/yasr/pagination.spec.js +5 -18
  31. package/e2e-legacy/sparql-editor/yasr/table-plugin.spec.js +1 -6
  32. package/e2e-legacy/sparql-editor/yasr/toolbar/visual-graph-button.spec.js +1 -6
  33. package/e2e-legacy/ttyg/chat-list.spec.js +2 -12
  34. package/e2e-legacy/ttyg/create-agent.spec.js +8 -48
  35. package/e2e-legacy/ttyg/edit-agent.spec.js +2 -12
  36. package/e2e-security/setup/users-and-access/turn-on-security-and-password-change.spec.js +73 -61
  37. package/fixtures/guides/confirm-cancel-dialog/confirm-cancel-dialog-guide.json +15 -0
  38. package/fixtures/guides/execute-sparql-query/execute-sparql-query-guide.json +54 -0
  39. package/fixtures/guides/import-rdf-file/confirm-duplicate-rdf-file-guide.json +30 -0
  40. package/fixtures/guides/import-rdf-file/import-rdf-file-guide.json +21 -0
  41. package/fixtures/guides/navigation/navigation-guide.json +60 -0
  42. package/fixtures/guides/rdf-rank/rdf-rank-guide.json +18 -0
  43. package/fixtures/guides/table-graph-explore/table-graph-explore-guide.json +51 -0
  44. package/fixtures/guides/table-graph-explore/table-graph-explore-without-substeps-guide.json +25 -0
  45. package/fixtures/guides/visual-graph/visual-graph-config-guide.json +39 -0
  46. package/fixtures/guides/visual-graph/visual-graph-guide.json +85 -0
  47. package/fixtures/guides/welcome/welcome-guide.json +18 -0
  48. package/npm-shrinkwrap.json +317 -263
  49. package/package.json +1 -1
  50. package/steps/guides/guide-dialog-steps.js +60 -2
  51. package/steps/main-menu-steps.js +1 -0
  52. package/steps/setup/acl-management-steps.js +4 -0
  53. package/steps/sparql-steps.js +13 -1
  54. package/steps/visual-graph-steps.js +72 -2
  55. package/steps/yasgui/yasqe-steps.js +29 -4
  56. package/steps/yasgui/yasr-steps.js +4 -0
  57. package/stubs/guides/guides-stubs.js +41 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "3.3.3-TR1",
3
+ "version": "3.4.0-migrated-guide-services",
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
  }
@@ -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
  }
@@ -165,6 +165,10 @@ export class AclManagementSteps {
165
165
  this.getRoleField(index).clear().type(value);
166
166
  }
167
167
 
168
+ static blurRole(index) {
169
+ this.getRoleField(index).blur();
170
+ }
171
+
168
172
  static getFieldError() {
169
173
  return cy.get('div.small');
170
174
  }
@@ -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
  }
@@ -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,27 @@ 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 closeSidePanel() {
200
+ this.getSidePanelCloseButton().click();
201
+ }
202
+
203
+ // Note the index is 1-based
204
+ static openConfigTab(tabIndex) {
205
+ return this.getConfigTab(tabIndex).click();
206
+ }
207
+
208
+ // Note the index is 1-based
209
+ static getConfigTab(tabIndex) {
210
+ return cy.getByTestId(`graph-config-tab-${tabIndex}`);
211
+ }
212
+
167
213
  // Visual graph settings form field access
168
214
 
169
215
  static openPredicatesTab() {
@@ -251,12 +297,32 @@ export class VisualGraphSteps extends BaseSteps {
251
297
  return cy.get('.create-graph-config').should('be.visible');
252
298
  }
253
299
 
300
+ static createCustomGraph() {
301
+ this.getCreateCustomGraphLink().click();
302
+ }
303
+
254
304
  static getGraphConfigName() {
255
305
  return cy.get('.graph-config-name').should('be.visible');
256
306
  }
257
307
 
258
308
  static typeGraphConfigName(name) {
259
- this.getGraphConfigName().type(name);
309
+ this.getGraphConfigName().type(name, {force: true});
310
+ }
311
+
312
+ static typeGraphConfigDescription(description) {
313
+ return this.getGraphConfigDescription().type(description, {force: true});
314
+ }
315
+
316
+ static getGraphConfigDescription() {
317
+ return cy.get('.graph-config-description').should('be.visible');
318
+ }
319
+
320
+ static typeGraphConfigHint(hint) {
321
+ return this.getGraphConfigHint().type(hint, {force: true});
322
+ }
323
+
324
+ static getGraphConfigHint() {
325
+ return cy.get('.graph-config-example').should('be.visible');
260
326
  }
261
327
 
262
328
  static getSaveConfigButton() {
@@ -429,6 +495,10 @@ export class VisualGraphSteps extends BaseSteps {
429
495
  .find('#auto-complete-results-wrapper .result-item').eq(index).click();
430
496
  }
431
497
 
498
+ static clickOnAutocompleteElement(elementText) {
499
+ cy.get('.result-item').contains(elementText).click();
500
+ }
501
+
432
502
  static getSelectedStartNodeUri() {
433
503
  return this.getStartNodeSelectorComponent().find('.selected-node code');
434
504
  }
@@ -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
 
@@ -63,6 +63,10 @@ export class YasrSteps {
63
63
  this.getResultCell(rowNumber, cellNumber).realHover();
64
64
  }
65
65
 
66
+ static clickOnResource(rowNumber, cellNumber) {
67
+ this.getResultCell(rowNumber, cellNumber).find('.uri-link').click({force: true});
68
+ }
69
+
66
70
  static getCopyResourceLink(rowNumber, cellNumber) {
67
71
  return this.getResultCell(rowNumber, cellNumber)
68
72
  .realHover()
@@ -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) {