graphdb-workbench-tests 4.0.0-TR7 → 4.0.0-TR9

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "4.0.0-TR7",
3
+ "version": "4.0.0-TR9",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -57,5 +57,14 @@
57
57
  "minimist": "^1.2.8",
58
58
  "mocha-junit-reporter": "^2.2.1",
59
59
  "path-browserify": "^1.0.1"
60
+ },
61
+ "overrides": {
62
+ "js-yaml@^3": "^3.15.2",
63
+ "istanbul-lib-processinfo": {
64
+ "uuid": "^11.1.1"
65
+ },
66
+ "@actions/http-client": {
67
+ "undici": "^6.29.0"
68
+ }
60
69
  }
61
70
  }
@@ -26,4 +26,8 @@ export class BaseSteps {
26
26
  static validateUrl(url) {
27
27
  this.getUrl().should('include', url);
28
28
  }
29
+
30
+ static buildTestIdAttr(testId) {
31
+ return `[data-test="${testId}"]`;
32
+ }
29
33
  }
@@ -86,6 +86,50 @@ export class GraphsOverviewSteps {
86
86
  return this.getGraphsOverviewComponent().find('.search-graphs');
87
87
  }
88
88
 
89
+ static getGraphsSearchLabel() {
90
+ return this.getGraphsOverviewComponent().find('label[for="search-graphs"]');
91
+ }
92
+
93
+ static getResultsHeader() {
94
+ return this.getResultsElement().find('thead');
95
+ }
96
+
97
+ static getSelectAllGraphsCheckbox() {
98
+ return this.getResultsHeader().find('.select-all-graphs-checkbox');
99
+ }
100
+
101
+ static getExportSelectedGraphsButton() {
102
+ return this.getResultsHeader().find('.export-selected-graphs-btn');
103
+ }
104
+
105
+ static getDeleteSelectedGraphsButton() {
106
+ return this.getResultsHeader().find('.delete-selected-graphs-btn');
107
+ }
108
+
109
+ static getActionsColumnHeader() {
110
+ return this.getResultsHeader().find('#actionsColumn');
111
+ }
112
+
113
+ static getGraphRow(graphName) {
114
+ return this.getResultsElement().find(`tbody a[title="${graphName}"]`).closest('tr');
115
+ }
116
+
117
+ static getDefaultGraphRow() {
118
+ return cy.getByTestId('graph-is-not-shaql').contains('The default graph').closest('tr');
119
+ }
120
+
121
+ static getSelectGraphCheckbox(graphName) {
122
+ return this.getGraphRow(graphName).find('.select-graph-checkbox');
123
+ }
124
+
125
+ static getExportGraphButton(graphName) {
126
+ return this.getGraphRow(graphName).find('.export-graph');
127
+ }
128
+
129
+ static getDeleteGraphButton(graphName) {
130
+ return this.getGraphRow(graphName).find('.delete-graph-btn');
131
+ }
132
+
89
133
  static getGraphsPaginator() {
90
134
  return this.getGraphsOverviewComponent().find('.graphs-overview-paginator');
91
135
  }
@@ -84,6 +84,10 @@ class ImportSteps {
84
84
  return this.getResourcesTable().find('#fileQuery');
85
85
  }
86
86
 
87
+ static getFilterFieldLabel() {
88
+ return this.getResourcesTable().find('label[for="fileQuery"]');
89
+ }
90
+
87
91
  static typeInFilterField(query) {
88
92
  return this.getFilterField().type(query);
89
93
  }
@@ -140,9 +144,13 @@ class ImportSteps {
140
144
  return this.getImportUserDataHelp().find('.copy-btn').click();
141
145
  }
142
146
 
147
+ static getHelpToggleButton() {
148
+ return this.getView().find('.toggle-help-btn');
149
+ }
150
+
143
151
  static toggleHelpMessage() {
144
152
  // For some reason the page info box opens unexpectedly and covers the help info icon.
145
- this.getView().find('.toggle-help-btn').click({force: true});
153
+ this.getHelpToggleButton().click({force: true});
146
154
  }
147
155
 
148
156
  static closeHelpMessage() {
@@ -186,12 +194,32 @@ class ImportSteps {
186
194
  this.getResourceTitleRow(index).find('.select-checkbox').click();
187
195
  }
188
196
 
197
+ static getResourceSelectCheckbox(name) {
198
+ return this.getResourceByName(name).find('.select-checkbox');
199
+ }
200
+
201
+ static getResourceImportButton(name) {
202
+ return this.getResourceByName(name).find('.import-resource-action-import-btn');
203
+ }
204
+
205
+ static getResourceRemoveButton(name) {
206
+ return this.getResourceByName(name).find('.import-resource-action-remove-btn');
207
+ }
208
+
209
+ static getResourceResetButton(name) {
210
+ return this.getResourceByName(name).find('.import-resource-action-reset-btn');
211
+ }
212
+
213
+ static getResourceContextLink(name) {
214
+ return this.getResourceByName(name).find('.uri-link');
215
+ }
216
+
189
217
  static selectFileByName(name) {
190
- this.getResourceByName(name).find('.select-checkbox').click();
218
+ this.getResourceSelectCheckbox(name).click();
191
219
  }
192
220
 
193
221
  static deselectFileByName(name) {
194
- this.getResourceByName(name).find('.select-checkbox').click();
222
+ this.getResourceSelectCheckbox(name).click();
195
223
  }
196
224
 
197
225
  static getResourceStatus(name) {
@@ -233,6 +261,10 @@ class ImportSteps {
233
261
  return this.getResourcesTable().find('.import-resource-status-dropdown');
234
262
  }
235
263
 
264
+ static getStatusSelectMenuToggle() {
265
+ return this.getStatusSelectMenu().find('.dropdown-toggle');
266
+ }
267
+
236
268
  static openStatusSelectMenu() {
237
269
  return this.getStatusSelectMenu().click().find('.dropdown-menu .dropdown-item');
238
270
  }
@@ -291,7 +323,7 @@ class ImportSteps {
291
323
  }
292
324
 
293
325
  static importResourceByName(name) {
294
- this.getResourceByName(name).find('.import-resource-action-import-btn').click();
326
+ this.getResourceImportButton(name).click();
295
327
  }
296
328
 
297
329
  static resetFileStatus(index) {
@@ -299,7 +331,7 @@ class ImportSteps {
299
331
  }
300
332
 
301
333
  static resetResourceStatusByName(name) {
302
- this.getResourceByName(name).find('.import-resource-action-reset-btn').click();
334
+ this.getResourceResetButton(name).click();
303
335
  }
304
336
 
305
337
  static getServerFilesTable() {
@@ -312,7 +344,8 @@ class ImportSteps {
312
344
 
313
345
  static selectFile(files) {
314
346
  cy.wait(1000)
315
- cy.get('#wb-import-uploadFile label').selectFile(files, { force: true });
347
+ // The file input is created by ng-file-upload and appended to the body.
348
+ cy.get('#ngf-wb-import-uploadFile').selectFile(files, { force: true });
316
349
  }
317
350
 
318
351
  static uploadFile(filePath) {
@@ -0,0 +1,24 @@
1
+ import {BaseSteps} from "./base-steps.js";
2
+
3
+ /**
4
+ * Steps for the restriction block (`app-page-restrictions`) that the new workbench shows instead of a
5
+ * page's content when the page is restricted. For its repository picker see {@link RepositoryPickerListSteps}.
6
+ */
7
+ export class PageRestrictionsSteps extends BaseSteps {
8
+
9
+ static getRestrictions() {
10
+ return this.getByTestId('page-restrictions');
11
+ }
12
+
13
+ static getMessages() {
14
+ return this.getRestrictions().find(this.buildTestIdAttr('page-restriction-message'));
15
+ }
16
+
17
+ static getInternalLink() {
18
+ return this.getMessages().find(this.buildTestIdAttr('restriction-internal-link'));
19
+ }
20
+
21
+ static getMessage(text) {
22
+ return this.getMessages().contains(text);
23
+ }
24
+ }
@@ -39,4 +39,78 @@ export class ReactodiaSteps extends BaseSteps {
39
39
  static getElement(text) {
40
40
  return ReactodiaSteps.getCanvas().find(`[data-element-id]`).contains(text).first();
41
41
  }
42
+
43
+ static getSettingsButton() {
44
+ return cy.get('[data-test="reactodia-settings-btn"]');
45
+ }
46
+
47
+ static openSettings() {
48
+ ReactodiaSteps.getSettingsButton().click();
49
+ }
50
+
51
+ static closeSettings() {
52
+ ReactodiaSteps.getCanvas().click('bottomLeft');
53
+ }
54
+
55
+ static getSettingsPopover() {
56
+ return cy.get('[data-test="reactodia-settings-popover"]');
57
+ }
58
+
59
+ static getSettingsFileInput() {
60
+ return this.getByTestId('reactodia-settings-upload').find('.p-fileupload-choose-button input[type=file]');
61
+ }
62
+
63
+ static selectSettingsFile(fileName = 'settings.ttl', contents = '@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .') {
64
+ // PrimeNG hides the file input (display: none), so force is needed to select a file on it.
65
+ this.getSettingsFileInput()
66
+ .selectFile({contents: Cypress.Buffer.from(contents), fileName, mimeType: 'text/turtle'}, {force: true});
67
+ }
68
+
69
+ static getSelectedSettingsFile(fileName = 'settings.ttl') {
70
+ return ReactodiaSteps.getSettingsPopover().contains(fileName);
71
+ }
72
+
73
+ static getUploadButton() {
74
+ return ReactodiaSteps.getSettingsPopover().find('.p-fileupload-upload-button');
75
+ }
76
+
77
+ static clickUpload() {
78
+ ReactodiaSteps.getUploadButton().click();
79
+ }
80
+
81
+ static clickCancelFile() {
82
+ ReactodiaSteps.getSettingsPopover().find('.p-fileupload-cancel-button').click();
83
+ }
84
+
85
+ static getBrowseButton() {
86
+ return ReactodiaSteps.getSettingsPopover().find('.p-fileupload-choose-button');
87
+ }
88
+
89
+ static clickExport() {
90
+ cy.get('[data-test="reactodia-settings-export-btn"] button').click();
91
+ }
92
+
93
+ static getResetButton() {
94
+ return cy.get('[data-test="reactodia-settings-reset-btn"] button');
95
+ }
96
+
97
+ static clickReset() {
98
+ ReactodiaSteps.getResetButton().click();
99
+ }
100
+
101
+ static getConfirmDialog() {
102
+ return cy.get('.modal-dialog');
103
+ }
104
+
105
+ static confirmDialog() {
106
+ ReactodiaSteps.getConfirmDialog().find('.confirm-btn').click();
107
+ }
108
+
109
+ static cancelDialog() {
110
+ ReactodiaSteps.getConfirmDialog().find('.cancel-btn').click();
111
+ }
112
+
113
+ static verifyFileDownloaded(fileName) {
114
+ cy.readFile('cypress/downloads/' + fileName);
115
+ }
42
116
  }
@@ -0,0 +1,40 @@
1
+ import {BaseSteps} from "./base-steps.js";
2
+
3
+ /**
4
+ * Steps for the repository picker list (`app-repository-picker-list`) of the new workbench, which lists the
5
+ * repositories the user can select and, when allowed, offers the creation of a new one.
6
+ */
7
+ export class RepositoryPickerListSteps extends BaseSteps {
8
+
9
+ static getRepositoryPickerList() {
10
+ return this.getByTestId('repository-picker-list');
11
+ }
12
+
13
+ static getRepositoryRows() {
14
+ return this.getRepositoryPickerList().find(this.buildTestIdAttr('repository-picker-row'));
15
+ }
16
+
17
+ static getRepositoryRow(repositoryId) {
18
+ return this.getRepositoryRows()
19
+ .contains(this.buildTestIdAttr('repository-picker-repository-id'), repositoryId)
20
+ .parents(this.buildTestIdAttr('repository-picker-row'));
21
+ }
22
+
23
+ static getRepositorySelectButton(repositoryId) {
24
+ return this.getRepositoryRow(repositoryId).find(this.buildTestIdAttr('repository-picker-select-btn'));
25
+ }
26
+
27
+ static selectRepository(repositoryId) {
28
+ // The select button is shown only while the row is hovered.
29
+ this.getRepositoryRow(repositoryId).realHover();
30
+ this.getRepositorySelectButton(repositoryId).click();
31
+ }
32
+
33
+ static getCreateRepositoryButton() {
34
+ return this.getRepositoryPickerList().find(this.buildTestIdAttr('repository-picker-create-btn'));
35
+ }
36
+
37
+ static clickCreateRepositoryButton() {
38
+ this.getCreateRepositoryButton().click();
39
+ }
40
+ }
@@ -20,6 +20,10 @@ export class RepositorySteps extends BaseSteps {
20
20
  cy.visit(`repository/edit/${repositoryId}?location=`);
21
21
  }
22
22
 
23
+ static verifyRepositoryCreateViewUrl() {
24
+ return cy.url().should('include', '/repository/create');
25
+ }
26
+
23
27
  static getRepositoryPage() {
24
28
  return cy.get('#wb-repository');
25
29
  }
@@ -29,6 +29,10 @@ export class SettingsSteps {
29
29
  return this.getSettingsPage().find('.login-credentials')
30
30
  }
31
31
 
32
+ static getUsernameLabel() {
33
+ return this.getLoginPanel().find('label[for="wb-user-username"]');
34
+ }
35
+
32
36
  static getPasswordField() {
33
37
  return this.getLoginPanel().find('#wb-user-password:password');
34
38
  }
@@ -62,6 +66,24 @@ export class SettingsSteps {
62
66
  return this.getSparqlEditorPanel().find('.inference-label');
63
67
  }
64
68
 
69
+ static getSchemaToggle() {
70
+ return this.getSparqlEditorPanel()
71
+ .find('#schema-on')
72
+ .find('.switch:checkbox');
73
+ }
74
+
75
+ static getSameAsToggleLabel() {
76
+ return this.getSparqlEditorPanel().find('label[for="sameAsCheck"]');
77
+ }
78
+
79
+ static getInferenceToggleLabel() {
80
+ return this.getSparqlEditorPanel().find('label[for="inferenceCheck"]');
81
+ }
82
+
83
+ static getSchemaToggleLabel() {
84
+ return this.getSparqlEditorPanel().find('label[for="schemaCheck"]');
85
+ }
86
+
65
87
  static getCountCheckbox() {
66
88
  return this.getSparqlEditorPanel().find('#defaultCount:checkbox');
67
89
  }
@@ -94,6 +116,26 @@ export class SettingsSteps {
94
116
  return this.getSettingsPage().find('.user-repositories .table');
95
117
  }
96
118
 
119
+ static getAnyRepositoryRow() {
120
+ return this.getUserRepositoryTable().find('.any-repo');
121
+ }
122
+
123
+ static getAnyRepositoryReadCheckbox() {
124
+ return this.getAnyRepositoryRow().find('.read:checkbox');
125
+ }
126
+
127
+ static getAnyRepositoryWriteCheckbox() {
128
+ return this.getAnyRepositoryRow().find('.write:checkbox');
129
+ }
130
+
131
+ static getAnyRepositoryMaintainCheckbox() {
132
+ return this.getAnyRepositoryRow().find('.maintain-repository:checkbox');
133
+ }
134
+
135
+ static getAnyRepositoryGraphqlCheckbox() {
136
+ return this.getAnyRepositoryRow().find('.graphql:checkbox');
137
+ }
138
+
97
139
  static getRepositoryRightsRows() {
98
140
  return this.getUserRepositoryTable().getByTestId('repository-rights-rows');
99
141
  }