graphdb-workbench-tests 2.6.4 → 2.7.0-RC10

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 +147 -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
@@ -1,338 +0,0 @@
1
- import ImportSteps from '../../steps/import-steps';
2
-
3
- describe('Import screen validation - user data', () => {
4
-
5
- let repositoryId;
6
- const INITIAL_DATA = "<urn:s1> <urn:p1> <urn:o1>.";
7
- const REPLACEMENT_DATA = "<urn:replaced-s1> <urn:replaced-p1> <urn:replaced-o1>.";
8
- const PRE_DEFINED_INITIAL_GRAPH_DATA = "<urn:graph1> {<urn:s1-custom> <urn:p1-custom> <urn:o1-custom>.}";
9
- const PRE_DEFINED_REPLACED_GRAPH_DATA = "<urn:graph1> {<urn:replaced-s1-custom> <urn:replaced-p1-custom> <urn:replaced-o1-custom>.}";
10
-
11
- const RDF_TEXT_SNIPPET_1 = '@prefix d:<http://learningsparql.com/ns/data#>.\n' +
12
- '@prefix dm:<http://learningsparql.com/ns/demo#>.\n\n' +
13
- 'd:item342 dm:shipped "2011-02-14"^^<http://www.w3.org/2001/XMLSchema#date>.\n' +
14
- 'd:item342 dm:quantity 4.\n' +
15
- 'd:item342 dm:invoiced true.\n' +
16
- 'd:item342 dm:costPerItem 3.50.';
17
-
18
- const RDF_TEXT_SNIPPET_2 = '@prefix ab:<http://learningsparql.com/ns/addressbook#>.\n\n' +
19
- 'ab:richard ab:homeTel "(229)276-5135".\n' +
20
- 'ab:richard ab:email "richard49@hotmail.com".\n' +
21
- 'ab:richard ab:email "richard491@hotmail.com".';
22
-
23
- const TURTLESTAR_SNIPPET = '@prefix ex:<http:/base.org/> .\n' +
24
- 'ex:foo ex:pred ex:obj .\n' +
25
- '<<ex:foo rdfs:label "label">> ex:author "guest" .\n' +
26
- 'ex:obj ex:quote <<ex:meta ex:data ex:foo>> .\n' +
27
- '<<<<ex:foo rdfs:label "label">> ex:data ex:foo>> ex:recursive true .';
28
- const TRIGSTAR_SNIPPET = '@prefix ex: <http://example.com/> .\n' +
29
- '@prefix dct: <http://purl.org/dc/terms/> .\n' +
30
- '@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n' +
31
- '@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n' +
32
- 'graph ex:rdfstar {\n' +
33
- ' ex:bob foaf:knows << ex:alice foaf:knows<<ex:bob dct:created ex:book>> >> .\n' +
34
- ' <<<< ex:bob dct:created ex:book >> foaf:knows ex:alice >> dct:source ex:otherbook .\n' +
35
- ' ex:bobshomepage dct:source<< ex:book dct:creator ex:alice >> .\n' +
36
- ' << ex:book dct:creator ex:alice >> dct:source ex:bobshomepage .\n' +
37
- ' << ex:book dct:creator ex:alice >> dct:requires << ex:alice dct:created ex:book >> .\n' +
38
- ' <<<http://example.org/a>ex:b ex:c>>ex:valid "1999-08-16"^^xsd:date .\n' +
39
- '}';
40
-
41
- const BASE_URI = 'http://purl.org/dc/elements/1.1/';
42
- const CONTEXT = 'http://example.org/graph';
43
-
44
- const IMPORT_URL = 'https://www.w3.org/TR/owl-guide/wine.rdf';
45
- const TEXT_SNIPPET = 'Text snippet';
46
- const INVALID_URL_RDF_FORMAT = 'JSON-LD';
47
- const VALID_URL_RDF_FORMAT = 'RDF/XML';
48
- const VALID_SNIPPET_TURTLESTAR_FORMAT = 'Turtle*';
49
- const VALID_SNIPPET_TRIGSTAR_FORMAT = 'TriG*';
50
- const VALID_SNIPPET_RDF_FORMAT = 'Turtle';
51
- const RDF_ERROR_MESSAGE = 'RDF Parse Error:';
52
- const SUCCESS_MESSAGE = 'Imported successfully';
53
-
54
- beforeEach(() => {
55
- repositoryId = 'user-import-' + Date.now();
56
- cy.createRepository({id: repositoryId});
57
- ImportSteps.visitUserImport(repositoryId);
58
- });
59
-
60
- afterEach(() => {
61
- cy.deleteRepository(repositoryId);
62
- });
63
-
64
- it('Test import file via URL successfully with Auto format selected', () => {
65
- ImportSteps
66
- .openImportURLDialog(IMPORT_URL)
67
- .clickImportUrlButton()
68
- // Without changing settings
69
- .importFromSettingsDialog()
70
- .verifyImportStatus(IMPORT_URL, SUCCESS_MESSAGE);
71
- });
72
-
73
- it('Test import file via URL with invalid RDF format selected', () => {
74
- ImportSteps
75
- .openImportURLDialog(IMPORT_URL)
76
- .selectRDFFormat(INVALID_URL_RDF_FORMAT)
77
- .clickImportUrlButton()
78
- .importFromSettingsDialog()
79
- .verifyImportStatus(IMPORT_URL, RDF_ERROR_MESSAGE);
80
- });
81
-
82
- it('Test import file via URL successfully with valid RDF format selected', () => {
83
- ImportSteps
84
- .openImportURLDialog(IMPORT_URL)
85
- .selectRDFFormat(VALID_URL_RDF_FORMAT)
86
- .clickImportUrlButton()
87
- .importFromSettingsDialog()
88
- .verifyImportStatus(IMPORT_URL, SUCCESS_MESSAGE);
89
- });
90
-
91
- it('Test import RDF text snippet successfully with Auto format selected', () => {
92
- ImportSteps
93
- .openImportTextSnippetDialog()
94
- .fillRDFTextSnippet(RDF_TEXT_SNIPPET_1)
95
- .clickImportTextSnippetButton()
96
- .importFromSettingsDialog()
97
- .verifyImportStatus(TEXT_SNIPPET, SUCCESS_MESSAGE);
98
- });
99
-
100
- it('Test import RDF text snippet with invalid RDF format selected', () => {
101
- ImportSteps
102
- .openImportTextSnippetDialog()
103
- .fillRDFTextSnippet(RDF_TEXT_SNIPPET_1)
104
- .selectRDFFormat(INVALID_URL_RDF_FORMAT)
105
- .clickImportTextSnippetButton()
106
- .importFromSettingsDialog()
107
- .verifyImportStatus(TEXT_SNIPPET, RDF_ERROR_MESSAGE);
108
- });
109
-
110
- it('Test import RDF text snippet successfully with valid RDF format selected', () => {
111
- ImportSteps
112
- .openImportTextSnippetDialog()
113
- .fillRDFTextSnippet(RDF_TEXT_SNIPPET_1)
114
- .selectRDFFormat(VALID_SNIPPET_RDF_FORMAT)
115
- .clickImportTextSnippetButton()
116
- .importFromSettingsDialog()
117
- .verifyImportStatus(TEXT_SNIPPET, SUCCESS_MESSAGE);
118
- });
119
-
120
- it('Test import Turtle* text snippet successfully with valid RDF star format selected', () => {
121
- ImportSteps
122
- .openImportTextSnippetDialog()
123
- .fillRDFTextSnippet(TURTLESTAR_SNIPPET)
124
- .selectRDFFormat(VALID_SNIPPET_TURTLESTAR_FORMAT)
125
- .clickImportTextSnippetButton()
126
- .importFromSettingsDialog()
127
- .verifyImportStatus(TEXT_SNIPPET, SUCCESS_MESSAGE);
128
- });
129
- it('Test import TriG* text snippet successfully with valid RDF star format selected', () => {
130
- ImportSteps
131
- .openImportTextSnippetDialog()
132
- .fillRDFTextSnippet(TRIGSTAR_SNIPPET)
133
- .selectRDFFormat(VALID_SNIPPET_TRIGSTAR_FORMAT)
134
- .clickImportTextSnippetButton()
135
- .importFromSettingsDialog()
136
- .verifyImportStatus(TEXT_SNIPPET, SUCCESS_MESSAGE);
137
- });
138
-
139
- it('Test import RDF text snippet successfully with filled base URI and context', () => {
140
- ImportSteps
141
- .openImportTextSnippetDialog()
142
- .fillRDFTextSnippet(RDF_TEXT_SNIPPET_2)
143
- .clickImportTextSnippetButton()
144
- .fillBaseURI(BASE_URI)
145
- .selectNamedGraph()
146
- .fillNamedGraph(CONTEXT)
147
- .importFromSettingsDialog()
148
- .verifyImportStatus(TEXT_SNIPPET, SUCCESS_MESSAGE);
149
-
150
- // Go to Graphs overview
151
- cy.visit('/graphs');
152
- cy.get('.ot-splash').should('not.be.visible');
153
-
154
- let graphName = CONTEXT.slice(0, CONTEXT.lastIndexOf('.'));
155
-
156
- // Verify that created graph can be found
157
- cy.get('.search-graphs').type(graphName).should('have.value', graphName);
158
- cy.get('#export-graphs').should('be.visible').should('contain', graphName);
159
- });
160
-
161
- it('should allow to delete uploaded files', () => {
162
- ImportSteps
163
- .openImportURLDialog(IMPORT_URL)
164
- .clickImportUrlButton()
165
- .importFromSettingsDialog()
166
- .verifyImportStatus(IMPORT_URL, SUCCESS_MESSAGE)
167
- .removeUploadedFiles();
168
- });
169
-
170
- it('Import RDF snippet in the default graph (from data) and replace data in the default graph', () => {
171
- ImportSteps
172
- .openImportTextSnippetDialog()
173
- .fillRDFTextSnippet(INITIAL_DATA)
174
- .selectRDFFormat("TriG")
175
- .clickImportTextSnippetButton();
176
- importFromData(false, "http://www.openrdf.org/schema/sesame#nil");
177
- getDeleteImportEntryButton().click();
178
- verifyGraphData("The default graph", "urn:s1", "urn:p1", "urn:o1", "http://www.ontotext.com/explicit", false, "urn:s1");
179
- ImportSteps.visitUserImport(repositoryId);
180
- ImportSteps
181
- .openImportTextSnippetDialog()
182
- .fillRDFTextSnippet(REPLACEMENT_DATA)
183
- .selectRDFFormat("TriG")
184
- .clickImportTextSnippetButton();
185
- importFromData(true, "http://www.openrdf.org/schema/sesame#nil")
186
- verifyGraphData("The default graph", "urn:replaced-s1", "urn:replaced-p1", "urn:replaced-o1", "http://www.ontotext.com/explicit", true, "urn:s1");
187
- });
188
-
189
- it('Import RDF snippet with a custom graph (from data) and replace data in the custom graph', () => {
190
- ImportSteps
191
- .openImportTextSnippetDialog()
192
- .fillRDFTextSnippet(PRE_DEFINED_INITIAL_GRAPH_DATA)
193
- .selectRDFFormat("TriG")
194
- .clickImportTextSnippetButton();
195
- importFromData(false, "http://www.openrdf.org/schema/sesame#nil");
196
- getDeleteImportEntryButton().click();
197
- verifyGraphData("urn:graph1", "urn:s1-custom", "urn:p1-custom", "urn:o1-custom", "urn:graph1", false, "urn:s1-custom");
198
- ImportSteps.visitUserImport(repositoryId);
199
- ImportSteps
200
- .openImportTextSnippetDialog()
201
- .fillRDFTextSnippet(PRE_DEFINED_REPLACED_GRAPH_DATA)
202
- .selectRDFFormat("TriG")
203
- .clickImportTextSnippetButton();
204
- importFromData(true, "urn:graph1")
205
- verifyGraphData("urn:graph1", "urn:replaced-s1-custom", "urn:replaced-p1-custom", "urn:replaced-o1-custom", "urn:graph1", true, "urn:s1-custom");
206
- });
207
-
208
- it('Import RDF snippet in the default graph (The default graph) and replace data in the default graph', () => {
209
- ImportSteps
210
- .openImportTextSnippetDialog()
211
- .fillRDFTextSnippet(INITIAL_DATA)
212
- .selectRDFFormat("TriG")
213
- .clickImportTextSnippetButton();
214
- importInTheDefaultGraph(false);
215
- getDeleteImportEntryButton().click();
216
- verifyGraphData("The default graph", "urn:s1", "urn:p1", "urn:o1", "http://www.ontotext.com/explicit", false, "urn:s1");
217
- ImportSteps.visitUserImport(repositoryId);
218
- ImportSteps
219
- .openImportTextSnippetDialog()
220
- .fillRDFTextSnippet(REPLACEMENT_DATA)
221
- .selectRDFFormat("TriG")
222
- .clickImportTextSnippetButton();
223
- importInTheDefaultGraph(true);
224
- verifyGraphData("The default graph", "urn:replaced-s1", "urn:replaced-p1", "urn:replaced-o1", "http://www.ontotext.com/explicit", true, "urn:s1");
225
- });
226
-
227
- it('Import RDF snippet in a named graph (Named graph) and replace data in the named graph', () => {
228
- ImportSteps
229
- .openImportTextSnippetDialog()
230
- .fillRDFTextSnippet(INITIAL_DATA)
231
- .selectRDFFormat("TriG")
232
- .clickImportTextSnippetButton();
233
- importInNamedGraph(false, "http://graph1");
234
- getDeleteImportEntryButton().click();
235
- verifyGraphData("http://graph1", "urn:s1", "urn:p1", "urn:o1", "http://graph1", false, "urn:s1");
236
- ImportSteps.visitUserImport(repositoryId);
237
- ImportSteps
238
- .openImportTextSnippetDialog()
239
- .fillRDFTextSnippet(REPLACEMENT_DATA)
240
- .selectRDFFormat("TriG")
241
- .clickImportTextSnippetButton();
242
- importInNamedGraph(true, "http://graph1");
243
- verifyGraphData("http://graph1", "urn:replaced-s1", "urn:replaced-p1", "urn:replaced-o1", "http://graph1", true, "urn:s1");
244
- });
245
-
246
- function getImportFromDataRadioButton() {
247
- return cy.get('.from-data-btn');
248
- }
249
-
250
- function getImportInDefaultGraphRadioButton() {
251
- return cy.get('.default-graph-btn');
252
- }
253
-
254
- function getImportInNamedGraphRadioButton() {
255
- return cy.get('.named-graph-btn');
256
- }
257
-
258
- function getExistingDataReplacementCheckbox() {
259
- return cy.get('.existing-data-replacement');
260
- }
261
-
262
- function getReplacedGraphsInputField() {
263
- return cy.get('.replaced-graphs-input');
264
- }
265
-
266
- function getAddGraphToReplaceButton() {
267
- return cy.get('.add-graph-btn');
268
- }
269
-
270
- function getImportSettingsImportButton() {
271
- return cy.get('.import-settings-import-button');
272
- }
273
-
274
- function getReplaceGraphConfirmationCheckbox() {
275
- return cy.get('.graph-replace-confirm-checkbox');
276
- }
277
-
278
- function getNamedGraphInputField() {
279
- return cy.get('.named-graph-input');
280
- }
281
-
282
- function getImportSuccessMessage() {
283
- return cy.get('.text-success');
284
- }
285
-
286
- function getDeleteImportEntryButton() {
287
- return cy.get('.icon-trash');
288
- }
289
-
290
- //verifies that the data has been inserted in the given graph and that the new data has replaced the old one.
291
- function verifyGraphData(graphName, s, p, o, c, checkForReplacedData, oldData) {
292
- cy.visit('/graphs');
293
- // wait a bit to give chance page loaded.
294
- cy.wait(1000);
295
- cy.get(`#export-graphs td a:contains(${graphName})`).click();
296
- cy.get(`.uri-cell:contains(${s})`).should('be.visible');
297
- cy.get(`.uri-cell:contains(${p})`).should('be.visible');
298
- cy.get(`.uri-cell:contains(${o})`).should('be.visible');
299
- cy.get(`.uri-cell:contains(${c})`).should('be.visible');
300
-
301
- if (checkForReplacedData) {
302
- cy.get(`.uri-cell:contains(${oldData})`).should('not.exist');
303
- }
304
- }
305
-
306
- function importFromData(shouldReplaceGraph, graphToReplace) {
307
- getImportFromDataRadioButton().click();
308
- if (shouldReplaceGraph) {
309
- getExistingDataReplacementCheckbox().click();
310
- getReplacedGraphsInputField().type(graphToReplace);
311
- getAddGraphToReplaceButton().click();
312
- getReplaceGraphConfirmationCheckbox().click();
313
- }
314
- getImportSettingsImportButton().click();
315
- getImportSuccessMessage().should('be.visible').and('contain', 'Imported successfully in')
316
- }
317
-
318
- function importInTheDefaultGraph(shouldReplaceGraph) {
319
- getImportInDefaultGraphRadioButton().click();
320
- if (shouldReplaceGraph) {
321
- getExistingDataReplacementCheckbox().click();
322
- getReplaceGraphConfirmationCheckbox().click();
323
- }
324
- getImportSettingsImportButton().click();
325
- getImportSuccessMessage().should('be.visible').and('contain', 'Imported successfully in')
326
- }
327
-
328
- function importInNamedGraph(shouldReplaceGraph, graph) {
329
- getImportInNamedGraphRadioButton().click();
330
- getNamedGraphInputField().type(graph);
331
- if (shouldReplaceGraph) {
332
- getExistingDataReplacementCheckbox().click();
333
- getReplaceGraphConfirmationCheckbox().click();
334
- }
335
- getImportSettingsImportButton().click();
336
- getImportSuccessMessage().should('be.visible').and('contain', 'Imported successfully in')
337
- }
338
- });
@@ -1,277 +0,0 @@
1
- import {ModalDialogSteps} from "./modal-dialog-steps";
2
-
3
- /**
4
- * Reusable functions for interacting with the import page.
5
- */
6
- class ImportSteps {
7
-
8
- static visitUserImport(repository) {
9
- ImportSteps.visitImport('user', repository);
10
- }
11
-
12
- static verifyUserImportUrl() {
13
- cy.url().should('include', '/import#user');
14
- }
15
-
16
- static visitServerImport(repository) {
17
- ImportSteps.visitImport('server', repository);
18
- }
19
-
20
- static visitImport(type, repository) {
21
- if (repository) {
22
- cy.presetRepository(repository);
23
- }
24
-
25
- cy.visit('/import#' + type);
26
-
27
- cy.get('.ot-splash').should('not.be.visible');
28
-
29
- cy.get('#import-' + type).should('be.visible');
30
-
31
- cy.get('.ot-loader').should('not.be.visible');
32
-
33
- return ImportSteps;
34
- }
35
-
36
- static openImportURLDialog(importURL) {
37
- cy.get('#import-user .import-from-url-btn').click()
38
- // Forces the popover to disappear as it covers the modal and Cypress refuses to continue
39
- .trigger('mouseleave', {force: true});
40
- ImportSteps.getModal()
41
- .find('.url-import-form input[name="dataUrl"]')
42
- .type(importURL)
43
- .should('have.value', importURL);
44
-
45
- return ImportSteps;
46
- }
47
-
48
- static openImportTextSnippetDialog() {
49
- cy.get('#import-user .import-rdf-snippet-btn').click()
50
- // Forces the popover to disappear as it covers the modal and Cypress refuses to continue
51
- .trigger('mouseleave', {force: true});
52
- ImportSteps.getModal().find('#wb-import-textarea').should('be.visible');
53
-
54
- return ImportSteps;
55
- }
56
-
57
- static clickImportUrlButton() {
58
- cy.get('#wb-import-importUrl').click();
59
-
60
- return ImportSteps;
61
- }
62
-
63
- static selectRDFFormat(rdfFormat) {
64
- cy.get('.modal-footer .import-format-dropdown').within(() => {
65
- cy.get('.import-format-dropdown-btn').click();
66
- cy.get('.dropdown-item').contains(rdfFormat).click().should('not.be.visible');
67
- });
68
-
69
- return ImportSteps;
70
- }
71
-
72
- static fillRDFTextSnippet(snippet) {
73
- ImportSteps.getSnippetTextarea().type(snippet, { parseSpecialCharSequences: false }).should('have.value', snippet);
74
-
75
- return ImportSteps;
76
- }
77
-
78
- static pasteRDFTextSnippet(snippet) {
79
- ImportSteps.getSnippetTextarea().invoke('val', snippet).trigger('change');
80
-
81
- return ImportSteps;
82
- }
83
-
84
- static clickImportTextSnippetButton() {
85
- cy.get('#wb-import-importText').click();
86
-
87
- return ImportSteps;
88
- }
89
-
90
- static removeUploadedFiles() {
91
- ImportSteps.selectAllUserFiles();
92
- cy.get('#wb-import-removeEntries').click();
93
- ModalDialogSteps.getDialog().should('be.visible');
94
- ModalDialogSteps.clickOnConfirmButton();
95
- cy.get('#wb-import-fileInFiles').should('be.hidden');
96
- return ImportSteps;
97
- }
98
-
99
- static selectAllUserFiles() {
100
- cy.get('#import-user .select-all-files').check();
101
-
102
- return ImportSteps;
103
- }
104
-
105
- static getImportRdfFileElement() {
106
- return cy.get('#import-user');
107
- }
108
-
109
- static getImportStatusMessage() {
110
- return cy.get('.import-status-message');
111
- }
112
-
113
- static getImportFileRow(fileName) {
114
- return cy.contains('tr', fileName);
115
- }
116
-
117
- static getSnippetTextarea() {
118
- return cy.get('#wb-import-textarea');
119
- }
120
-
121
- static selectServerFile(filename) {
122
- // Forcing it because often times cypress sees it with zero width and height although it's
123
- // clearly visible.
124
- ImportSteps.getServerFileElement(filename).find('.import-file-checkbox').click({force: true});
125
-
126
- return ImportSteps;
127
- }
128
-
129
- static selectAllServerFiles() {
130
- cy.get('#import-server .select-all-files').check();
131
-
132
- return ImportSteps;
133
- }
134
-
135
- static importServerFiles(changeSettings) {
136
- if (changeSettings) {
137
- // TODO: Check for dialog?
138
- cy.get('#import-server .import-btn').scrollIntoView().click();
139
- } else {
140
- cy.get('#import-server .import-dropdown-btn').scrollIntoView().click()
141
- .should('have.attr', 'aria-expanded', 'true');
142
- cy.get('#import-server .import-without-change-btn').scrollIntoView().click();
143
- }
144
-
145
- return ImportSteps;
146
- }
147
-
148
- static importFromSettingsDialog() {
149
- // Dialog should disappear
150
- ImportSteps.getModal().
151
- find('.modal-footer > .btn-primary')
152
- .should('exist')
153
- .click()
154
- .should('not.exist');
155
-
156
- return ImportSteps;
157
- }
158
-
159
- static getSettingsForm() {
160
- return ImportSteps.getModal().find('.settings-form');
161
- }
162
-
163
- static fillBaseURI(baseURI) {
164
- ImportSteps.getSettingsForm().find('input[name="baseURI"]').type(baseURI).should('have.value', baseURI);
165
-
166
- return ImportSteps;
167
- }
168
-
169
- static selectNamedGraph() {
170
- ImportSteps.getSettingsForm().find('.named-graph-btn').check();
171
-
172
- return ImportSteps;
173
- }
174
-
175
- static fillNamedGraph(namedGraph) {
176
- ImportSteps.getSettingsForm().find('.named-graph-input').type(namedGraph).should('have.value', namedGraph);
177
-
178
- return ImportSteps;
179
- }
180
-
181
- static expandAdvancedSettings() {
182
- ImportSteps.getSettingsForm().within(() => {
183
- cy.get('.toggle-advanced-settings').click();
184
- cy.get('.advanced-settings').should('be.visible');
185
- });
186
-
187
- return ImportSteps;
188
- }
189
-
190
- static enablePreserveBNodes() {
191
- ImportSteps.getSettingsForm().find('input[name="preserveBNodeIDs"]').check();
192
-
193
- return ImportSteps;
194
- }
195
-
196
- static resetStatusOfUploadedFiles() {
197
- // Button should disappear
198
- cy.get('#import-server #wb-import-clearStatuses')
199
- .click()
200
- .then((el) => {
201
- cy.waitUntil(() => cy.wrap(el).should('not.be.visible'));
202
- })
203
-
204
- return ImportSteps;
205
- }
206
-
207
- static resetStatusOfUploadedFile(filename) {
208
- // List is re-rendered -> ensure it is detached
209
- ImportSteps
210
- .getServerFileElement(filename)
211
- .find('.import-status .import-status-reset')
212
- .click()
213
- .should('not.exist');
214
-
215
- return ImportSteps;
216
- }
217
-
218
- static verifyImportStatusDetails(fileToSelect, details) {
219
- ImportSteps.getServerFileElement(fileToSelect).find('.import-status .import-status-info').then(infoIconEl => {
220
- cy.wrap(infoIconEl).should('be.visible');
221
- cy.wrap(infoIconEl).trigger('mouseenter');
222
-
223
- cy.get('.popover-content').then(content => {
224
- cy.wrap(content).should('be.visible');
225
- if (details instanceof Array) {
226
- details.forEach(text => {
227
- cy.wrap(content).should('contain', text);
228
- })
229
- } else {
230
- cy.wrap(content).should('contain', details);
231
- }
232
- cy.wrap(infoIconEl).trigger('mousemove', {clientX: 0, clientY: 0});
233
-
234
- // set timeout in order to yield the mousemove
235
- cy.wait(0);
236
- }).should('not.exist');
237
- });
238
-
239
- return ImportSteps;
240
- }
241
-
242
- static verifyImportStatus(filename, message) {
243
- cy.waitUntil(() =>
244
- ImportSteps
245
- .getServerFileElement(filename)
246
- .find('.import-status .import-status-message')
247
- .then(status => status && status.text().indexOf(message) > -1));
248
-
249
- return ImportSteps;
250
- }
251
-
252
- static verifyNoImportStatus(filename) {
253
- ImportSteps
254
- .getServerFileElement(filename)
255
- .find('.import-status')
256
- .should('not.be.visible');
257
-
258
- return ImportSteps;
259
- }
260
-
261
- static getServerFileElement(filename) {
262
- // Find the element containing the filename and get then the parent row element
263
- return cy.get('#wb-import-fileInFiles .import-file-header')
264
- .contains(filename)
265
- .parentsUntil('.import-file-row')
266
- .parent();
267
- }
268
-
269
- static getModal() {
270
- return cy.get('.modal')
271
- .should('be.visible')
272
- .and('not.have.class', 'ng-animate')
273
- .and('have.class', 'in');
274
- }
275
- }
276
-
277
- export default ImportSteps;