graphdb-workbench-tests 2.6.4 → 2.7.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 (73) hide show
  1. package/Dockerfile +3 -1
  2. package/fixtures/cluster/3-nodes-cluster-group-status-receiving-snapshot.json +7 -7
  3. package/fixtures/graphdb-import/0007-import-file.jsonld +27 -0
  4. package/fixtures/graphdb-import/more-files/jsonld-file.jsonld +8 -0
  5. package/fixtures/graphdb-import/more-files/rdfxml.rdf +15 -0
  6. package/fixtures/graphdb-import/more-files-with-error/import-resource-with-correct-data.jsonld +8 -0
  7. package/fixtures/graphdb-import/more-files-with-error/import-resource-with-incorrect-data.rdf +13 -0
  8. package/fixtures/graphdb-import/more-files-with-error/import-resource-with-long-error.rdf +13 -0
  9. package/fixtures/graphdb-import/sample-jsonld.json +8 -0
  10. package/fixtures/locale-en.json +251 -111
  11. package/fixtures/url-import-template.json +1 -0
  12. package/integration/cluster/cluster-legend.spec.js +36 -0
  13. package/integration/cluster/cluster-management.spec.js +4 -92
  14. package/integration/cluster/cluster-states.spec.js +117 -0
  15. package/integration/explore/graphs.overview.spec.js +62 -0
  16. package/integration/explore/similarity.spec.js +20 -2
  17. package/integration/guides/movies-interactive-guide.spec.js +1 -1
  18. package/integration/guides/star-wars-interactive-guide.js +1 -0
  19. package/integration/import/import-server-files-batch-operations.spec.js +121 -0
  20. package/integration/import/import-server-files.spec.js +145 -0
  21. package/integration/import/import-user-data-file-upload.spec.js +194 -0
  22. package/integration/import/import-user-data-settings-dialog.spec.js +70 -0
  23. package/integration/import/import-user-data-text-snippet.spec.js +246 -0
  24. package/integration/import/import-user-data-url.spec.js +70 -0
  25. package/integration/import/import-user-data.spec.js +119 -0
  26. package/integration/import/import-view.spec.js +108 -0
  27. package/integration/monitor/global-operation-statuses-component.spec.js +2 -2
  28. package/integration/repository/repositories.spec.js +20 -17
  29. package/integration/resource/resource.spec.js +40 -0
  30. package/integration/setup/aclmanagement/create-rule.spec.js +15 -0
  31. package/integration/setup/sparql-template-create.js +4 -4
  32. package/integration/setup/user-and-access.spec.js +98 -138
  33. package/integration/sparql-editor/internationalization.spec.js +62 -12
  34. package/integration/sparql-editor/yasgui-tabs.spec.js +15 -1
  35. package/integration/sparql-editor/yasr/download-as.spec.js +71 -0
  36. package/integration-flaky/import/import-server-files-operations.spec.js +142 -0
  37. package/integration-flaky/import/import-user-data-batch-operations.spec.js +185 -0
  38. package/integration-flaky/import/import.server.files.spec.js +3 -2
  39. package/integration-flaky/setup/sparql-template-create.js +1 -1
  40. package/integration-flaky/sparql-editor/actions/share-query.spec.js +1 -1
  41. package/npm-shrinkwrap.json +3198 -0
  42. package/package.json +10 -11
  43. package/steps/cluster/cluster-configuration-steps.js +17 -0
  44. package/steps/cluster/cluster-page-steps.js +20 -8
  45. package/steps/cluster/cluster-view-steps.js +6 -2
  46. package/steps/explore/graphs-overview-steps.js +32 -0
  47. package/steps/explore/similarity-indexes-steps.js +26 -0
  48. package/steps/guides/guide-steps.js +5 -19
  49. package/steps/home-steps.js +4 -0
  50. package/steps/import/file-overwrite-dialog-steps.js +16 -0
  51. package/steps/import/import-resource-message-dialog.js +46 -0
  52. package/steps/import/import-server-files-steps.js +36 -0
  53. package/steps/import/import-settings-dialog-steps.js +60 -0
  54. package/steps/import/import-steps.js +463 -0
  55. package/steps/import/import-user-data-steps.js +167 -0
  56. package/steps/json-ld-modal-steps.js +41 -0
  57. package/steps/language-selector-steps.js +12 -0
  58. package/steps/main-menu-steps.js +4 -0
  59. package/steps/resource/resource-steps.js +7 -2
  60. package/steps/setup/acl-management-steps.js +4 -0
  61. package/steps/setup/user-and-access-steps.js +189 -0
  62. package/steps/sparql-steps.js +1 -1
  63. package/steps/yasgui/yasgui-steps.js +6 -0
  64. package/steps/yasgui/yasr-steps.js +5 -0
  65. package/stubs/yasgui/query-stubs.js +4 -0
  66. package/support/commands.js +23 -0
  67. package/support/import-commands.js +10 -0
  68. package/support/sparql-commands.js +1 -1
  69. package/bin/graphdb-workbench-cypress +0 -29
  70. package/integration/help/rest-api.spec.js +0 -121
  71. package/integration/import/import.server.files.spec.js +0 -69
  72. package/integration/import/import.user.data.spec.js +0 -338
  73. package/steps/import-steps.js +0 -277
@@ -0,0 +1,463 @@
1
+ import {ModalDialogSteps} from "../modal-dialog-steps";
2
+
3
+ /**
4
+ * Reusable functions for interacting with the import page.
5
+ */
6
+ class ImportSteps {
7
+
8
+ //
9
+ // Template methods.
10
+ //
11
+ static getResourcesTable() {}
12
+ static getHelpMessage() {}
13
+
14
+ static createFile(filename, content) {
15
+ return {
16
+ contents: Cypress.Buffer.from(content),
17
+ fileName: filename,
18
+ mimeType: 'text/plain',
19
+ lastModified: Date.now()
20
+ };
21
+ }
22
+
23
+ static visit() {
24
+ cy.visit('/import');
25
+ cy.url().should('include', '/import');
26
+ }
27
+
28
+ static getView() {
29
+ return cy.get('#wb-import');
30
+ }
31
+
32
+ static getPageInfoIcon() {
33
+ return this.getView().find('.page-info-icon');
34
+ }
35
+
36
+ static showPageInfoPopover() {
37
+ this.getPageInfoIcon().realHover();
38
+ }
39
+
40
+ static getPageInfoPopover() {
41
+ return cy.get('.help-info');
42
+ }
43
+
44
+ static visitUserImport(repository) {
45
+ this.visitImport('user', repository);
46
+ }
47
+
48
+ static verifyUserImportUrl() {
49
+ cy.url().should('include', '/import#user');
50
+ }
51
+
52
+ static visitServerImport(repository) {
53
+ this.visitImport('server', repository);
54
+ }
55
+
56
+ static getImportUrlInput() {
57
+ return this.getModal().find('.url-import-form input[name="dataUrl"]');
58
+ }
59
+
60
+ static visitImport(type, repository) {
61
+ if (repository) {
62
+ cy.presetRepository(repository);
63
+ }
64
+
65
+ cy.visit('/import#' + type);
66
+
67
+ // cy.get('.ot-splash').should('not.be.visible');
68
+
69
+ cy.get('#import-' + type).should('be.visible');
70
+
71
+ // cy.get('.ot-loader').should('not.be.visible');
72
+
73
+ return this;
74
+ }
75
+
76
+ static closePopover() {
77
+ cy.get('.popover.in').click();
78
+ }
79
+
80
+ static getFilterField() {
81
+ return this.getResourcesTable().find('#fileQuery');
82
+ }
83
+
84
+ static typeInFilterField(query) {
85
+ return this.getFilterField().type(query);
86
+ }
87
+
88
+ static getTabs() {
89
+ return this.getView().find('.nav-tabs .nav-item');
90
+ }
91
+
92
+ static getActiveTab() {
93
+ return this.getTabs().find('.nav-link.active');
94
+ }
95
+
96
+ static openUserDataTab() {
97
+ // cy.get('.ot-loader').should('not.be.visible');
98
+ return this.getTabs().eq(0).click();
99
+ }
100
+
101
+ static getUserDataTab() {
102
+ return this.getView().find('#import-user');
103
+ }
104
+
105
+ static getServerFilesTab() {
106
+ return this.getView().find('#import-server');
107
+ }
108
+
109
+ static openServerFilesTab() {
110
+ // cy.get('.ot-loader').should('not.be.visible');
111
+ return this.getTabs().eq(1).click();
112
+ }
113
+
114
+ static getUploadRdfFilesButton() {
115
+ return this.getView().find('.upload-rdf-files-btn');
116
+ }
117
+
118
+ static getUploadFromUrlButton() {
119
+ return this.getView().find('.import-from-url-btn');
120
+ }
121
+
122
+ static getUploadTextSnippetButton() {
123
+ return this.getView().find('.import-from-url-btn');
124
+ }
125
+
126
+ static getFileSizeLimitWarning() {
127
+ return this.getView().find('.file-size-limit-warning');
128
+ }
129
+
130
+ static openServerFilesTabFromWarning() {
131
+ this.getFileSizeLimitWarning().find('.server-files-tab-link').click();
132
+ }
133
+
134
+ static openAPIViewFromWarning() {
135
+ this.getFileSizeLimitWarning().find('.api-link').click();
136
+ }
137
+
138
+ static copyMaxFileSizeLimitProperty() {
139
+ return this.getImportUserDataHelp().find('.copy-btn').click();
140
+ }
141
+
142
+ static getClipboardTextContent() {
143
+ return cy.window().its('navigator.clipboard').invoke('readText').then((text) => text);
144
+ }
145
+
146
+ static toggleHelpMessage() {
147
+ // For some reason the page info box opens unexpectedly and covers the help info icon.
148
+ this.getView().find('.toggle-help-btn').click({force: true});
149
+ }
150
+
151
+ static closeHelpMessage() {
152
+ return this.getHelpMessage().find('button.close').click();
153
+ }
154
+
155
+ static getResources() {
156
+ return this.getResourcesTable().find('.row.title-row');
157
+ }
158
+
159
+ static getSelectedResources() {
160
+ return this.getResources().find('.select-checkbox:checked');
161
+ }
162
+
163
+ static getSelectedResourceName(index) {
164
+ return this.getSelectedResources().eq(index).closest('.title-row');
165
+ }
166
+
167
+ static getResource(index) {
168
+ return this.getResources().eq(index);
169
+ }
170
+
171
+ static getResourceByName(name) {
172
+ return this.getResources().find('.cell-title').contains(name)
173
+ .closest('.row.title-row');
174
+ }
175
+
176
+ static selectFileByIndex(index) {
177
+ this.getResource(index).find('.select-checkbox').click();
178
+ }
179
+
180
+ static selectFileByName(name) {
181
+ this.getResourceByName(name).find('.select-checkbox').click();
182
+ }
183
+
184
+ static deselectFileByName(name) {
185
+ this.getResourceByName(name).find('.select-checkbox').click();
186
+ }
187
+
188
+ static getResourceStatus(name) {
189
+ return this.getResourceByName(name).next().find('import-resource-message');
190
+ }
191
+
192
+ static openErrorDialog(name) {
193
+ this.getResourceStatus(name).find('.error-message .btn').click();
194
+ }
195
+
196
+ static getImportedResourcesStates() {
197
+ return this.getResources().find('.import-resource-message');
198
+ }
199
+
200
+ static checkImportedResource(index, resourceName, expectedStatus) {
201
+ if (expectedStatus === undefined) {}
202
+ const status = expectedStatus || 'Imported successfully';
203
+ this.getResourceByName(resourceName).should('contain', resourceName);
204
+ this.getResourceStatus(resourceName).should('contain', status);
205
+ }
206
+
207
+ static checkImportedStatusIsEmpty(resourceName) {
208
+ this.getResourceStatus(resourceName).find('.import-resource-message').children().should('have.length', 0);
209
+ }
210
+
211
+ static checkUserDataUploadedResource(index, resourceName) {
212
+ // this.getResource(index).should('contain', resourceName);
213
+ this.getResourceByName(resourceName).should('contain', resourceName);
214
+ this.getResourceStatus(resourceName).should('be.hidden');
215
+ }
216
+
217
+ static getStatusSelectMenu() {
218
+ return this.getResourcesTable().find('.import-resource-status-dropdown');
219
+ }
220
+
221
+ static openStatusSelectMenu() {
222
+ return this.getStatusSelectMenu().click().find('.dropdown-menu .dropdown-item');
223
+ }
224
+
225
+ static selectAllResources() {
226
+ this.openStatusSelectMenu().contains('All').click();
227
+ }
228
+
229
+ static deselectAllResources() {
230
+ this.openStatusSelectMenu().contains('None').click();
231
+ }
232
+
233
+ static selectImportedResources() {
234
+ this.openStatusSelectMenu().contains('Imported').click();
235
+ }
236
+
237
+ static selectNotImportedResources() {
238
+ this.openStatusSelectMenu().contains('Not imported').click();
239
+ }
240
+
241
+ static getBatchImportButton() {
242
+ return this.getResourcesTable().find('.batch-import-btn');
243
+ }
244
+
245
+ static batchImport() {
246
+ this.getBatchImportButton().click();
247
+ }
248
+
249
+ static batchImportWithoutChangingDefaultSettings() {
250
+ this.getResourcesTable().find('.batch-import-dropdown .dropdown-toggle').click();
251
+ this.getResourcesTable().find('.batch-import-without-change-btn').click();
252
+ }
253
+
254
+ static getBatchResetButton() {
255
+ return this.getResourcesTable().find('.batch-reset-btn');
256
+ }
257
+
258
+ static batchReset() {
259
+ this.getBatchResetButton().click();
260
+ }
261
+
262
+ static getRemoveResourcesButton() {
263
+ return this.getResourcesTable().find('.remove-resources-btn');
264
+ }
265
+
266
+ static removeSelectedResources() {
267
+ this.getRemoveResourcesButton().click();
268
+ }
269
+
270
+ static deleteUploadedFile(index) {
271
+ this.getResource(index).find('.import-resource-action-remove-btn').click();
272
+ }
273
+
274
+ static importFile(index) {
275
+ this.getResource(index).find('.import-resource-action-import-btn').click();
276
+ }
277
+
278
+ static importResourceByName(name) {
279
+ this.getResourceByName(name).find('.import-resource-action-import-btn').click();
280
+ }
281
+
282
+ static resetFileStatus(index) {
283
+ this.getResource(index).find('.import-resource-action-reset-btn').click();
284
+ }
285
+
286
+ static resetResourceStatusByName(name) {
287
+ this.getResourceByName(name).find('.import-resource-action-reset-btn').click();
288
+ }
289
+
290
+ static getServerFilesTable() {
291
+ return this.getView().find('#import-server table');
292
+ }
293
+
294
+ static openFileUploadDialog() {
295
+ this.getUploadRdfFilesButton().find('#wb-import-uploadFile').click();
296
+ }
297
+
298
+ static selectFile(files) {
299
+ cy.get('input[type=file]').selectFile(files, {force: true});
300
+ }
301
+
302
+ static uploadFile(filePath) {
303
+ const filePathsList = Array.isArray(filePath)? filePath : [filePath];
304
+ cy.fixtures(filePathsList).then((files) => {
305
+ const aliases = filePathsList.map((filePath, i) => `@file-${i}`);
306
+ // with force because the field is hidden
307
+ cy.get('input[type=file]').selectFile(aliases, {force: true});
308
+ });
309
+ }
310
+
311
+ static openImportURLDialog(importURL) {
312
+ cy.get('#import-user .import-from-url-btn').click();
313
+ // Forces the popover to disappear as it covers the modal and Cypress refuses to continue
314
+ this.closePopover();
315
+ this.getImportUrlInput().type(importURL).should('have.value', importURL);
316
+ this.closePopover();
317
+ return this;
318
+ }
319
+
320
+ static clickImportUrlButton() {
321
+ cy.get('#wb-import-importUrl').click();
322
+
323
+ return this;
324
+ }
325
+
326
+ static removeUploadedFiles() {
327
+ this.selectAllUserFiles();
328
+ cy.get('#wb-import-removeEntries').click();
329
+ ModalDialogSteps.getDialog().should('be.visible');
330
+ ModalDialogSteps.clickOnConfirmButton();
331
+ cy.get('#wb-import-fileInFiles').should('be.hidden');
332
+ return this;
333
+ }
334
+
335
+ static selectAllUserFiles() {
336
+ cy.get('#import-user .select-all-files').check();
337
+
338
+ return this;
339
+ }
340
+
341
+ static getImportRdfFileElement() {
342
+ return cy.get('#import-user');
343
+ }
344
+
345
+ static getImportStatusMessage() {
346
+ return cy.get('.import-status-message');
347
+ }
348
+
349
+ static getImportStatusRow(index = 0) {
350
+ return cy.get('.import-resource-message').eq(index);
351
+ }
352
+
353
+ static getSnippetTextarea() {
354
+ return cy.get('#wb-import-textarea');
355
+ }
356
+
357
+ static selectAllServerFiles() {
358
+ cy.get('#import-server .select-all-files').check();
359
+
360
+ return this;
361
+ }
362
+
363
+ static importServerFiles(changeSettings) {
364
+ if (changeSettings) {
365
+ // TODO: Check for dialog?
366
+ cy.get('#import-server .import-btn').scrollIntoView().click();
367
+ } else {
368
+ cy.get('#import-server .import-dropdown-btn').scrollIntoView().click()
369
+ .should('have.attr', 'aria-expanded', 'true');
370
+ cy.get('#import-server .import-without-change-btn').scrollIntoView().click();
371
+ }
372
+
373
+ return this;
374
+ }
375
+
376
+ static clickImportOnRow(row) {
377
+ cy.get('.import-file-btn').contains('Import').click();
378
+
379
+ return this;
380
+ }
381
+
382
+ static resetStatusOfUploadedFiles() {
383
+ // Button should disappear
384
+ cy.get('#import-server #wb-import-clearStatuses')
385
+ .click()
386
+ .then((el) => {
387
+ cy.waitUntil(() => cy.wrap(el).should('not.be.visible'));
388
+ });
389
+
390
+ return this;
391
+ }
392
+
393
+ static resetStatusOfUploadedFile(filename) {
394
+ // List is re-rendered -> ensure it is detached
395
+ this
396
+ .getServerFileElement(filename)
397
+ .find('.import-status .import-status-reset')
398
+ .click()
399
+ .should('not.exist');
400
+
401
+ return this;
402
+ }
403
+
404
+ static verifyImportStatusDetails(fileToSelect, details) {
405
+ this.getServerFileElement(fileToSelect).find('.import-status .import-status-info').then(infoIconEl => {
406
+ cy.wrap(infoIconEl).should('be.visible');
407
+ cy.wrap(infoIconEl).trigger('mouseenter');
408
+
409
+ cy.get('.popover-content').then(content => {
410
+ cy.wrap(content).should('be.visible');
411
+ if (details instanceof Array) {
412
+ details.forEach(text => {
413
+ cy.wrap(content).should('contain', text);
414
+ })
415
+ } else {
416
+ cy.wrap(content).should('contain', details);
417
+ }
418
+ cy.wrap(infoIconEl).trigger('mousemove', {clientX: 0, clientY: 0});
419
+
420
+ // set timeout in order to yield the mousemove
421
+ cy.wait(0);
422
+ }).should('not.exist');
423
+ });
424
+
425
+ return this;
426
+ }
427
+
428
+ static verifyImportStatus(filename, message) {
429
+ cy.waitUntil(() =>
430
+ this
431
+ .getServerFileElement(filename)
432
+ .find('.import-status .import-status-message')
433
+ .then(status => status && status.text().indexOf(message) > -1));
434
+
435
+ return this;
436
+ }
437
+
438
+ static verifyNoImportStatus(filename) {
439
+ this
440
+ .getServerFileElement(filename)
441
+ .find('.import-status')
442
+ .should('not.be.visible');
443
+
444
+ return this;
445
+ }
446
+
447
+ static getServerFileElement(filename) {
448
+ // Find the element containing the filename and get then the parent row element
449
+ return cy.get('#wb-import-fileInFiles .import-file-header')
450
+ .contains(filename)
451
+ .parentsUntil('.import-file-row')
452
+ .parent();
453
+ }
454
+
455
+ static getModal() {
456
+ return cy.get('.modal')
457
+ .should('be.visible')
458
+ .and('not.have.class', 'ng-animate')
459
+ .and('have.class', 'in');
460
+ }
461
+ }
462
+
463
+ export default ImportSteps;
@@ -0,0 +1,167 @@
1
+ import ImportSteps from "./import-steps";
2
+
3
+ export class ImportUserDataSteps extends ImportSteps {
4
+
5
+ static getResourcesTable() {
6
+ return ImportSteps.getView().find('#import-user import-resource-tree');
7
+ }
8
+
9
+ static getHelpMessage() {
10
+ return this.getView().find('.user-data-import-help');
11
+ }
12
+
13
+ static openImportTextSnippetDialog() {
14
+ cy.get('#import-user .import-rdf-snippet-btn').click()
15
+ // Forces the popover to disappear as it covers the modal and Cypress refuses to continue
16
+ .trigger('mouseleave', {force: true});
17
+ this.getModal().find('#wb-import-textarea').should('be.visible');
18
+ return this;
19
+ }
20
+
21
+ static fillRDFTextSnippet(snippet) {
22
+ this.getSnippetTextarea().type(snippet, {parseSpecialCharSequences: false}).should('have.value', snippet);
23
+ return this;
24
+ }
25
+
26
+ static pasteRDFTextSnippet(snippet) {
27
+ this.getSnippetTextarea().invoke('val', snippet).trigger('change');
28
+ }
29
+
30
+ static selectRDFFormat(rdfFormat) {
31
+ cy.get('.modal-footer .import-format-dropdown').within(() => {
32
+ cy.get('.import-format-dropdown-btn').click();
33
+ cy.get('.dropdown-item').contains(rdfFormat).click().should('not.be.visible');
34
+ });
35
+ return this;
36
+ }
37
+
38
+ static clickImportTextSnippetButton() {
39
+ cy.get('#wb-import-importText').click();
40
+ return this;
41
+ }
42
+
43
+ static stubPostJSONLDFromURL(repositoryId) {
44
+ cy.intercept('POST', `/rest/repositories/${repositoryId}/import/upload/url`).as('postJsonldUrl');
45
+ }
46
+
47
+ // ==========================================================================
48
+ // utilities from text snippet tests
49
+ // ==========================================================================
50
+
51
+ static getSnippetTextarea() {
52
+ return this.getModal().find('#wb-import-textarea');
53
+ }
54
+
55
+ static getImportFromDataRadioButton() {
56
+ return this.getModal().find('#wb-import-from-data');
57
+ }
58
+
59
+ static getImportInDefaultGraphRadioButton() {
60
+ return this.getModal().find('#wb-import-in-default-graph');
61
+ }
62
+
63
+ static getExistingDataReplacementCheckbox() {
64
+ return this.getModal().find('#wb-import-existing-data-replacement');
65
+ }
66
+
67
+ static getReplacedGraphsInputField() {
68
+ return this.getModal().find('#wb-import-replaced-graphs');
69
+ }
70
+
71
+ static getAddGraphToReplaceButton() {
72
+ return this.getModal().find('#wb-import-add-graph-to-replace');
73
+ }
74
+
75
+ //verifies that the data has been inserted in the given graph and that the new data has replaced the old one.
76
+ static verifyGraphData(graphName, s, p, o, c, checkForReplacedData, oldData) {
77
+ cy.visit('/graphs');
78
+ // wait a bit to give chance page loaded.
79
+ cy.wait(1000);
80
+ cy.get(`#export-graphs td a:contains(${graphName})`).click();
81
+ cy.get(`.uri-cell:contains(${s})`).should('be.visible');
82
+ cy.get(`.uri-cell:contains(${p})`).should('be.visible');
83
+ cy.get(`.uri-cell:contains(${o})`).should('be.visible');
84
+ cy.get(`.uri-cell:contains(${c})`).should('be.visible');
85
+
86
+ if (checkForReplacedData) {
87
+ cy.get(`.uri-cell:contains(${oldData})`).should('not.exist');
88
+ }
89
+ }
90
+
91
+ static importFromData(shouldReplaceGraph, graphToReplace) {
92
+ this.getImportFromDataRadioButton().click();
93
+ if (shouldReplaceGraph) {
94
+ this.getExistingDataReplacementCheckbox().click();
95
+ this.getReplacedGraphsInputField().type(graphToReplace);
96
+ this.getAddGraphToReplaceButton().click();
97
+ this.getReplaceGraphConfirmationCheckbox().click();
98
+ }
99
+ this.getImportSettingsImportButton().click();
100
+ this.getImportSuccessMessage().should('be.visible').and('contain', 'Imported successfully in')
101
+ }
102
+
103
+ static importInTheDefaultGraph(shouldReplaceGraph) {
104
+ this.getImportInDefaultGraphRadioButton().click();
105
+ if (shouldReplaceGraph) {
106
+ this.getExistingDataReplacementCheckbox().click();
107
+ this.getReplaceGraphConfirmationCheckbox().click();
108
+ }
109
+ this.getImportSettingsImportButton().click();
110
+ this.getImportSuccessMessage().should('be.visible').and('contain', 'Imported successfully in')
111
+ }
112
+
113
+ static importInNamedGraph(shouldReplaceGraph, graph) {
114
+ this.getImportInNamedGraphRadioButton().click();
115
+ this.getNamedGraphInputField().type(graph);
116
+ if (shouldReplaceGraph) {
117
+ this.getExistingDataReplacementCheckbox().click();
118
+ this.getReplaceGraphConfirmationCheckbox().click();
119
+ }
120
+ this.getImportSettingsImportButton().click();
121
+ this.getImportSuccessMessage().should('be.visible').and('contain', 'Imported successfully in')
122
+ }
123
+
124
+ static getImportFromDataRadioButton() {
125
+ return cy.get('.from-data-btn');
126
+ }
127
+
128
+ static getImportInDefaultGraphRadioButton() {
129
+ return cy.get('.default-graph-btn');
130
+ }
131
+
132
+ static getImportInNamedGraphRadioButton() {
133
+ return cy.get('.named-graph-btn');
134
+ }
135
+
136
+ static getExistingDataReplacementCheckbox() {
137
+ return cy.get('.existing-data-replacement');
138
+ }
139
+
140
+ static getReplacedGraphsInputField() {
141
+ return cy.get('.replaced-graphs-input');
142
+ }
143
+
144
+ static getAddGraphToReplaceButton() {
145
+ return cy.get('.add-graph-btn');
146
+ }
147
+
148
+ static getImportSettingsImportButton() {
149
+ return cy.get('.import-settings-import-button');
150
+ }
151
+
152
+ static getReplaceGraphConfirmationCheckbox() {
153
+ return cy.get('.graph-replace-confirm-checkbox');
154
+ }
155
+
156
+ static getNamedGraphInputField() {
157
+ return cy.get('.named-graph-input');
158
+ }
159
+
160
+ static getImportSuccessMessage() {
161
+ return cy.get('.text-success');
162
+ }
163
+
164
+ static getDeleteImportEntryButton() {
165
+ return cy.get('.icon-trash');
166
+ }
167
+ }
@@ -0,0 +1,41 @@
1
+ export class JsonLdModalSteps {
2
+ static getJSONLDModal() {
3
+ return cy.get('.modal-content');
4
+ }
5
+
6
+ static selectJSONLDMode(option) {
7
+ cy.get('[id=wb-JSONLD-mode]').select(option);
8
+ }
9
+
10
+ static getSelectedJSONLDModeField() {
11
+ return cy.get('#wb-JSONLD-mode option:checked');
12
+ }
13
+
14
+ static getJSONLDFrame() {
15
+ return cy.get('[id=wb-JSONLD-frame]');
16
+ }
17
+
18
+ static getJSONLDContext() {
19
+ return cy.get('[id=wb-JSONLD-context]');
20
+ }
21
+
22
+ static typeJSONLDFrame(text) {
23
+ this.getJSONLDFrame().type(text);
24
+ }
25
+
26
+ static typeJSONLDContext(text) {
27
+ this.getJSONLDContext().type(text);
28
+ }
29
+
30
+ static clickExportJSONLD() {
31
+ cy.get('[id=wb-export-JSONLD]').click();
32
+ }
33
+
34
+ static clickRestoreDefaultsJSONLD() {
35
+ cy.get('.restore-defaults').click();
36
+ }
37
+
38
+ static verifyFileExists(fileName) {
39
+ cy.readFile('cypress/downloads/' + fileName);
40
+ }
41
+ }
@@ -19,4 +19,16 @@ export class LanguageSelectorSteps {
19
19
  static switchToEn() {
20
20
  LanguageSelectorSteps.changeLanguage('en');
21
21
  }
22
+
23
+ static getLanguageChangeModal() {
24
+ return cy.get('.modal-dialog');
25
+ }
26
+
27
+ static confirmLanguageChange() {
28
+ this.getLanguageChangeModal().find('.confirm-btn').click();
29
+ }
30
+
31
+ static cancelLanguageChange() {
32
+ this.getLanguageChangeModal().find('.cancel-btn').click();
33
+ }
22
34
  }
@@ -4,6 +4,10 @@ export class MainMenuSteps {
4
4
  return cy.get('.main-menu');
5
5
  }
6
6
 
7
+ static openHomePage() {
8
+ MainMenuSteps.getMainMenu().find('.home-page').click();
9
+ }
10
+
7
11
  static getMenuButton(menuName) {
8
12
  return MainMenuSteps.getMainMenu().find('.menu-element').contains(menuName);
9
13
  }