graphdb-workbench-tests 3.5.1-TR3 → 4.0.0-SPARQL12

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 (50) hide show
  1. package/cypress-guides.config.js +45 -0
  2. package/e2e-flaky/import/import-server-files-operations.spec.js +8 -30
  3. package/e2e-flaky/import/import-user-data-batch-operations.spec.js +7 -7
  4. package/e2e-flaky/import/import-user-data-url.spec.js +1 -1
  5. package/e2e-legacy/cluster/cluster-configuration/cluster-configuration-multi-region.spec.js +7 -0
  6. package/e2e-legacy/cluster/edit-cluster-nodes-modal.spec.js +1 -1
  7. package/e2e-legacy/explore/visual-graph/visual.graph.spec.js +45 -9
  8. package/e2e-legacy/guides/import-rdf-file/confirm-duplicate-rdf-file.spec.js +1 -1
  9. package/e2e-legacy/guides/main-menu/main-menu-guide.spec.js +6 -14
  10. package/e2e-legacy/guides/ttyg/configure-agent/configure-agent-guide.spec.js +27 -32
  11. package/e2e-legacy/guides/ttyg/edit-agent/edit-ttyg-agent-guide.spec.js +12 -20
  12. package/e2e-legacy/import/import-server-files-batch-operations.spec.js +5 -5
  13. package/e2e-legacy/import/import-server-files.spec.js +20 -22
  14. package/e2e-legacy/import/import-user-data-file-upload.spec.js +21 -22
  15. package/e2e-legacy/import/import-user-data-text-snippet.spec.js +6 -45
  16. package/e2e-legacy/import/import-user-data-url.spec.js +9 -6
  17. package/e2e-legacy/import/import-view.spec.js +2 -2
  18. package/e2e-legacy/repository/ontop-repository.spec.js +2 -1
  19. package/e2e-legacy/repository/rename-repository-restrictions.spec.js +129 -0
  20. package/e2e-legacy/repository/repositories.spec.js +3 -3
  21. package/e2e-legacy/resource/resource.spec.js +160 -35
  22. package/e2e-legacy/setup/aclmanagement/create-rule.spec.js +14 -25
  23. package/e2e-legacy/setup/aclmanagement/delete-rule.spec.js +6 -6
  24. package/e2e-legacy/setup/aclmanagement/edit-rule.spec.js +15 -15
  25. package/e2e-legacy/setup/aclmanagement/render-rules.spec.js +1 -1
  26. package/e2e-legacy/setup/aclmanagement/reorder-rules.spec.js +2 -2
  27. package/e2e-legacy/setup/aclmanagement/revert-rules.spec.js +2 -2
  28. package/e2e-legacy/setup/aclmanagement/update-rules.spec.js +3 -3
  29. package/e2e-legacy/setup/aclmanagement/validate-uri.spec.js +152 -0
  30. package/e2e-legacy/setup/users-and-access/user-and-access.spec.js +21 -20
  31. package/e2e-legacy/sparql-editor/yasr/download-as.spec.js +4 -7
  32. package/e2e-legacy/ttyg/edit-agent.spec.js +8 -0
  33. package/e2e-legacy/ttyg/ttyg-initial-state-with-configured-api-key.spec.js +1 -1
  34. package/e2e-legacy/ttyg/ttyg-initial-state-with-selected-repository.spec.js +1 -1
  35. package/e2e-legacy/ttyg/ttyg-initial-state-without-repositories.spec.js +1 -1
  36. package/eslint.config.js +5 -0
  37. package/fixtures/cluster/cluster-config-with-tag.json +17 -0
  38. package/fixtures/graphdb-import/wine.rdf +279 -285
  39. package/npm-shrinkwrap.json +138 -497
  40. package/package.json +3 -2
  41. package/steps/import/import-steps.js +26 -6
  42. package/steps/import/import-test-constants.js +1 -1
  43. package/steps/main-menu-steps.js +5 -14
  44. package/steps/resource/resource-steps.js +64 -5
  45. package/steps/setup/acl-management-steps.js +3 -23
  46. package/stubs/cluster/cluster-stubs.js +7 -0
  47. package/stubs/repositories/repositories-stubs.js +4 -0
  48. package/fixtures/graphdb-import/test-trigstar.trigs +0 -32
  49. package/fixtures/graphdb-import/test_turtlestar.ttls +0 -6
  50. package/fixtures/graphdb-import/turtlestar-data.ttls +0 -77
@@ -57,7 +57,7 @@ describe('Import server files - Batch operations', () => {
57
57
  // precondition for the next step
58
58
  ImportServerFilesSteps.importResourceByName(FILE_FOR_IMPORT);
59
59
  ImportSettingsDialogSteps.import();
60
- ImportServerFilesSteps.checkImportedResource(0, FILE_FOR_IMPORT);
60
+ ImportServerFilesSteps.checkImportedResourceByName(FILE_FOR_IMPORT);
61
61
  // When I select Imported from the menu
62
62
  ImportServerFilesSteps.selectImportedResources();
63
63
  // Then I should see only imported files selected
@@ -97,8 +97,8 @@ describe('Import server files - Batch operations', () => {
97
97
  // Then the files should be imported
98
98
  // We send only the files in the folder for import
99
99
  // ImportServerFilesSteps.checkImportedResource(0, 'more-files');
100
- ImportServerFilesSteps.checkImportedResource(0, 'jsonld-file.jsonld');
101
- ImportServerFilesSteps.checkImportedResource(0, 'rdfxml.rdf');
100
+ ImportServerFilesSteps.checkImportedResourceByName('jsonld-file.jsonld');
101
+ ImportServerFilesSteps.checkImportedResourceByName('rdfxml.rdf');
102
102
  ImportServerFilesSteps.deselectFileByName('more-files');
103
103
  // When I select the folder and click on the batch reset button
104
104
  ImportServerFilesSteps.selectFileByName('more-files');
@@ -116,7 +116,7 @@ describe('Import server files - Batch operations', () => {
116
116
  // Then the files should be imported
117
117
  // We send only the files in the folder for import
118
118
  // ImportServerFilesSteps.checkImportedResource(0, 'more-files');
119
- ImportServerFilesSteps.checkImportedResource(0, 'jsonld-file.jsonld');
120
- ImportServerFilesSteps.checkImportedResource(0, 'rdfxml.rdf');
119
+ ImportServerFilesSteps.checkImportedResourceByName('jsonld-file.jsonld');
120
+ ImportServerFilesSteps.checkImportedResourceByName('rdfxml.rdf');
121
121
  });
122
122
  });
@@ -87,8 +87,8 @@ describe('Import server files', () => {
87
87
  // Then I expect all files to be successfully imported.
88
88
  // TODO: this check is failing right now because the fix https://ontotext.atlassian.net/browse/GDB-10295 is not yet completed.
89
89
  // ImportServerFilesSteps.checkImportedResource(0, 'more-files', 'Imported successfully in');
90
- ImportServerFilesSteps.checkImportedResource(1, 'jsonld-file.jsonld', 'Imported successfully in');
91
- ImportServerFilesSteps.checkImportedResource(2, 'rdfxml.rdf', 'Imported successfully in');
90
+ ImportServerFilesSteps.checkImportedResourceByIndex(1, 'jsonld-file.jsonld', 'Imported successfully in');
91
+ ImportServerFilesSteps.checkImportedResourceByIndex(2, 'rdfxml.rdf', 'Imported successfully in');
92
92
 
93
93
  // When I try to import a directory that contains resources with incorrect rdf data.
94
94
  ImportServerFilesSteps.importResourceByName('more-files-with-error');
@@ -119,7 +119,7 @@ describe('Import server files', () => {
119
119
  ImportSettingsDialogSteps.import();
120
120
 
121
121
  // I expect only part of the error be displayed,
122
- ImportServerFilesSteps.checkImportedResource(0, importResourceName, 'RDF Parse Error: The element type ');
122
+ ImportServerFilesSteps.checkImportedResourceByName(importResourceName, 'RDF Parse Error: The element type ');
123
123
  // and when click on that error
124
124
  ImportServerFilesSteps.openErrorDialog(importResourceName);
125
125
 
@@ -152,39 +152,37 @@ describe('Import server files', () => {
152
152
  ImportServerFilesSteps.orderBySize();
153
153
 
154
154
  // Then I expect the directories to be sorted in ascending order,
155
- ImportServerFilesSteps.getResource(0).should('contain', "more-files");
156
- ImportServerFilesSteps.getResource(3).should('contain', "more-files-with-error");
155
+ ImportServerFilesSteps.getResourceTitleRow(0).should('contain', "more-files");
156
+ ImportServerFilesSteps.getResourceTitleRow(3).should('contain', "more-files-with-error");
157
157
 
158
158
  // and inner files to be sorted ascending as well.
159
159
  // checks first folder files
160
- ImportServerFilesSteps.getResource(1).should('contain', "jsonld-file.jsonld");
161
- ImportServerFilesSteps.getResource(2).should('contain', "rdfxml.rdf");
160
+ ImportServerFilesSteps.getResourceTitleRow(1).should('contain', "jsonld-file.jsonld");
161
+ ImportServerFilesSteps.getResourceTitleRow(2).should('contain', "rdfxml.rdf");
162
162
  // checks second folder files
163
- ImportServerFilesSteps.getResource(4).should('contain', "import-resource-with-correct-data.jsonld");
164
- ImportServerFilesSteps.getResource(5).should('contain', "import-resource-with-incorrect-data.rdf");
165
- ImportServerFilesSteps.getResource(6).should('contain', "import-resource-with-long-error.rdf");
163
+ ImportServerFilesSteps.getResourceTitleRow(4).should('contain', "import-resource-with-correct-data.jsonld");
164
+ ImportServerFilesSteps.getResourceTitleRow(5).should('contain', "import-resource-with-incorrect-data.rdf");
165
+ ImportServerFilesSteps.getResourceTitleRow(6).should('contain', "import-resource-with-long-error.rdf");
166
166
  // checks files in root
167
167
  ImportServerFilesSteps.getResource(7).should('contain', "bnodes.ttl");
168
- ImportServerFilesSteps.getResource(8).should('contain', "test_turtlestar.ttls");
169
- ImportServerFilesSteps.getResource(9).should('contain', "0007-import-file.jsonld");
168
+ ImportServerFilesSteps.getResource(8).should('contain', "0007-import-file.jsonld");
170
169
 
171
170
  // When I change the order by size.
172
171
  ImportServerFilesSteps.orderBySize();
173
172
 
174
173
  // Then I expect the directories to be sorted in descending order,
175
- ImportServerFilesSteps.getResource(0).should('contain', "more-files-with-error");
176
- ImportServerFilesSteps.getResource(4).should('contain', "more-files");
174
+ ImportServerFilesSteps.getResourceTitleRow(0).should('contain', "more-files-with-error");
175
+ ImportServerFilesSteps.getResourceTitleRow(4).should('contain', "more-files");
177
176
  // checks first folder files
178
- ImportServerFilesSteps.getResource(1).should('contain', "import-resource-with-long-error.rdf");
179
- ImportServerFilesSteps.getResource(2).should('contain', "import-resource-with-incorrect-data.rdf");
180
- ImportServerFilesSteps.getResource(3).should('contain', "import-resource-with-correct-data.jsonld");
177
+ ImportServerFilesSteps.getResourceTitleRow(1).should('contain', "import-resource-with-long-error.rdf");
178
+ ImportServerFilesSteps.getResourceTitleRow(2).should('contain', "import-resource-with-incorrect-data.rdf");
179
+ ImportServerFilesSteps.getResourceTitleRow(3).should('contain', "import-resource-with-correct-data.jsonld");
181
180
  // checks second folder files
182
- ImportServerFilesSteps.getResource(5).should('contain', "rdfxml.rdf");
183
- ImportServerFilesSteps.getResource(6).should('contain', "jsonld-file.jsonld");
181
+ ImportServerFilesSteps.getResourceTitleRow(5).should('contain', "rdfxml.rdf");
182
+ ImportServerFilesSteps.getResourceTitleRow(6).should('contain', "jsonld-file.jsonld");
184
183
  // checks files in root
185
- ImportServerFilesSteps.getResource(17).should('contain', "0007-import-file.jsonld");
186
- ImportServerFilesSteps.getResource(18).should('contain', "test_turtlestar.ttls");
187
- ImportServerFilesSteps.getResource(19).should('contain', "bnodes.ttl");
184
+ ImportServerFilesSteps.getResource(15).should('contain', "0007-import-file.jsonld");
185
+ ImportServerFilesSteps.getResource(16).should('contain', "bnodes.ttl");
188
186
  });
189
187
 
190
188
  it('should allow importing jsonld with empty "JSON-LD Context"', () => {
@@ -46,7 +46,7 @@ describe('Import user data: File upload', () => {
46
46
  ImportSettingsDialogSteps.getDialog().should('not.exist');
47
47
  // Then I should see the uploaded file
48
48
  ImportUserDataSteps.getResources().should('have.length', 1);
49
- ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl');
49
+ ImportUserDataSteps.checkImportedResourceByIndex(0, 'bnodes.ttl');
50
50
  // When I try to import the same file again
51
51
  ImportUserDataSteps.importFile(0);
52
52
  // Then I should not see the upload only option
@@ -56,7 +56,7 @@ describe('Import user data: File upload', () => {
56
56
  ImportSettingsDialogSteps.import();
57
57
  ImportSettingsDialogSteps.getDialog().should('not.exist');
58
58
  ImportUserDataSteps.getResources().should('have.length', 1);
59
- ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl');
59
+ ImportUserDataSteps.checkImportedResourceByIndex(0, 'bnodes.ttl');
60
60
  });
61
61
 
62
62
  it('Should be able to cancel the file upload', () => {
@@ -106,15 +106,15 @@ describe('Import user data: File upload', () => {
106
106
  ImportSettingsDialogSteps.getDialog().should('be.visible');
107
107
  ImportSettingsDialogSteps.import();
108
108
  // Then I should see the uploaded file
109
- ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl');
109
+ ImportUserDataSteps.checkImportedResourceByIndex(0, 'bnodes.ttl');
110
110
  // When I upload another file
111
111
  const file2 = ImportUserDataSteps.createFile(testFiles[1], jsonld);
112
112
  ImportUserDataSteps.selectFile(file2);
113
113
  ImportSettingsDialogSteps.getDialog().should('be.visible');
114
114
  ImportSettingsDialogSteps.import();
115
115
  // Then I should see the uploaded file - it becomes first in the list
116
- ImportUserDataSteps.checkImportedResource(0, 'jsonld.jsonld');
117
- ImportUserDataSteps.checkImportedResource(1, 'bnodes.ttl');
116
+ ImportUserDataSteps.checkImportedResourceByIndex(0, 'jsonld.jsonld');
117
+ ImportUserDataSteps.checkImportedResourceByIndex(1, 'bnodes.ttl');
118
118
  // When I override the first file
119
119
  const file3 = ImportUserDataSteps.createFile(testFiles[0], bnodes);
120
120
  ImportUserDataSteps.selectFile(file3);
@@ -122,17 +122,16 @@ describe('Import user data: File upload', () => {
122
122
  ImportSettingsDialogSteps.getDialog().should('be.visible');
123
123
  ImportSettingsDialogSteps.import();
124
124
  // Then I should see the uploaded file - it becomes first in the list
125
- // TODO: timestamps currently seems to not be changed on reimport
126
- ImportUserDataSteps.checkImportedResource(0, 'jsonld.jsonld');
127
- ImportUserDataSteps.checkImportedResource(1, 'bnodes.ttl');
125
+ ImportUserDataSteps.checkImportedResourceByIndex(0, 'bnodes.ttl');
126
+ ImportUserDataSteps.checkImportedResourceByIndex(1, 'jsonld.jsonld');
128
127
  // When I override the second file
129
128
  ImportUserDataSteps.selectFile(file2);
130
129
  FileOverwriteDialogSteps.overwrite();
131
130
  ImportSettingsDialogSteps.getDialog().should('be.visible');
132
131
  ImportSettingsDialogSteps.import();
133
132
  // Then I should see the uploaded file - it becomes first in the list
134
- ImportUserDataSteps.checkImportedResource(0, 'jsonld.jsonld');
135
- ImportUserDataSteps.checkImportedResource(1, 'bnodes.ttl');
133
+ ImportUserDataSteps.checkImportedResourceByIndex(0, 'jsonld.jsonld');
134
+ ImportUserDataSteps.checkImportedResourceByIndex(1, 'bnodes.ttl');
136
135
  });
137
136
 
138
137
  it('should be able to only upload a single file without importing it', () => {
@@ -165,8 +164,8 @@ describe('Import user data: File upload', () => {
165
164
  ImportSettingsDialogSteps.import();
166
165
  // Then I should see the uploaded file
167
166
  ImportUserDataSteps.getResources().should('have.length', 2);
168
- ImportUserDataSteps.checkImportedResource(0, 'jsonld.jsonld');
169
- ImportUserDataSteps.checkImportedResource(1, 'bnodes.ttl');
167
+ ImportUserDataSteps.checkImportedResourceByIndex(0, 'jsonld.jsonld');
168
+ ImportUserDataSteps.checkImportedResourceByIndex(1, 'bnodes.ttl');
170
169
  // And the files should really be there
171
170
  HeaderSteps.openHomePage();
172
171
  ImportUserDataSteps.visit();
@@ -182,7 +181,7 @@ describe('Import user data: File upload', () => {
182
181
  ImportSettingsDialogSteps.getDialog().should('be.visible');
183
182
  ImportSettingsDialogSteps.import();
184
183
  ImportUserDataSteps.getResources().should('have.length', 1);
185
- ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl');
184
+ ImportUserDataSteps.checkImportedResourceByIndex(0, 'bnodes.ttl');
186
185
  // When I upload a file with the same name
187
186
  ImportUserDataSteps.selectFile(file1);
188
187
  // Then I should see a file override confirmation dialog
@@ -193,7 +192,7 @@ describe('Import user data: File upload', () => {
193
192
  ImportSettingsDialogSteps.import();
194
193
  // Then The file should be overridden
195
194
  ImportUserDataSteps.getResources().should('have.length', 1);
196
- ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl');
195
+ ImportUserDataSteps.checkImportedResourceByIndex(0, 'bnodes.ttl');
197
196
  });
198
197
 
199
198
  it('Should be able to upload file with same name and preserve the existing file', () => {
@@ -205,7 +204,7 @@ describe('Import user data: File upload', () => {
205
204
  ImportSettingsDialogSteps.getDialog().should('be.visible');
206
205
  ImportSettingsDialogSteps.import();
207
206
  ImportUserDataSteps.getResources().should('have.length', 1);
208
- ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl');
207
+ ImportUserDataSteps.checkImportedResourceByIndex(0, 'bnodes.ttl');
209
208
  // When I upload a file with the same name
210
209
  ImportUserDataSteps.selectFile(file1);
211
210
  // Then I should see a file override confirmation dialog
@@ -215,8 +214,8 @@ describe('Import user data: File upload', () => {
215
214
  ImportSettingsDialogSteps.import();
216
215
  // Then The file should not be overridden but prefixed instead
217
216
  ImportUserDataSteps.getResources().should('have.length', 2);
218
- ImportUserDataSteps.checkImportedResource(0, 'bnodes-0.ttl');
219
- ImportUserDataSteps.checkImportedResource(1, 'bnodes.ttl');
217
+ ImportUserDataSteps.checkImportedResourceByIndex(0, 'bnodes-0.ttl');
218
+ ImportUserDataSteps.checkImportedResourceByIndex(1, 'bnodes.ttl');
220
219
  // When I upload two files, one with the same name and second new one
221
220
  const file2 = ImportUserDataSteps.createFile(testFiles[1], jsonld);
222
221
  ImportUserDataSteps.selectFile([file1, file2]);
@@ -225,10 +224,10 @@ describe('Import user data: File upload', () => {
225
224
  ImportSettingsDialogSteps.import();
226
225
  // Then The file should not be overridden but prefixed with increased index instead
227
226
  ImportUserDataSteps.getResources().should('have.length', 4);
228
- ImportUserDataSteps.checkImportedResource(0, 'jsonld.jsonld');
229
- ImportUserDataSteps.checkImportedResource(1, 'bnodes-1.ttl');
230
- ImportUserDataSteps.checkImportedResource(2, 'bnodes-0.ttl');
231
- ImportUserDataSteps.checkImportedResource(3, 'bnodes.ttl');
227
+ ImportUserDataSteps.checkImportedResourceByIndex(0, 'jsonld.jsonld');
228
+ ImportUserDataSteps.checkImportedResourceByIndex(1, 'bnodes-1.ttl');
229
+ ImportUserDataSteps.checkImportedResourceByIndex(2, 'bnodes-0.ttl');
230
+ ImportUserDataSteps.checkImportedResourceByIndex(3, 'bnodes.ttl');
232
231
  });
233
232
 
234
233
  it('should see error message when uploaded file has invalid format', () => {
@@ -242,6 +241,6 @@ describe('Import user data: File upload', () => {
242
241
  ImportSettingsDialogSteps.import();
243
242
  // Then I should see an error message
244
243
  ImportUserDataSteps.getResources().should('have.length', 1);
245
- ImportUserDataSteps.checkImportedResource(0, 'invalid-format.json', 'RDF Parse Error: Invalid file format');
244
+ ImportUserDataSteps.checkImportedResourceByIndex(0, 'invalid-format.json', 'RDF Parse Error: Invalid file format');
246
245
  });
247
246
  });
@@ -21,25 +21,6 @@ describe('Import user data: Text snippet', () => {
21
21
  'ab:richard ab:email "richard49@hotmail.com".\n' +
22
22
  'ab:richard ab:email "richard491@hotmail.com".';
23
23
 
24
- const TURTLESTAR_SNIPPET = '@prefix ex:<http:/base.org/> .\n' +
25
- 'ex:foo ex:pred ex:obj .\n' +
26
- '<<ex:foo rdfs:label "label">> ex:author "guest" .\n' +
27
- 'ex:obj ex:quote <<ex:meta ex:data ex:foo>> .\n' +
28
- '<<<<ex:foo rdfs:label "label">> ex:data ex:foo>> ex:recursive true .';
29
-
30
- const TRIGSTAR_SNIPPET = '@prefix ex: <http://example.com/> .\n' +
31
- '@prefix dct: <http://purl.org/dc/terms/> .\n' +
32
- '@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n' +
33
- '@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n' +
34
- 'graph ex:rdfstar {\n' +
35
- ' ex:bob foaf:knows << ex:alice foaf:knows<<ex:bob dct:created ex:book>> >> .\n' +
36
- ' <<<< ex:bob dct:created ex:book >> foaf:knows ex:alice >> dct:source ex:otherbook .\n' +
37
- ' ex:bobshomepage dct:source<< ex:book dct:creator ex:alice >> .\n' +
38
- ' << ex:book dct:creator ex:alice >> dct:source ex:bobshomepage .\n' +
39
- ' << ex:book dct:creator ex:alice >> dct:requires << ex:alice dct:created ex:book >> .\n' +
40
- ' <<<http://example.org/a>ex:b ex:c>>ex:valid "1999-08-16"^^xsd:date .\n' +
41
- '}';
42
-
43
24
  const JSONLD_TEXT_SNIPPET = '[\n' +
44
25
  ' {\n' +
45
26
  ' "@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",\n' +
@@ -55,8 +36,6 @@ describe('Import user data: Text snippet', () => {
55
36
  const CONTEXT = 'http://example.org/graph';
56
37
  const TEXT_SNIPPET = 'Text snippet';
57
38
  const JSONLD_FORMAT = 'JSON-LD';
58
- const VALID_SNIPPET_TURTLESTAR_FORMAT = 'Turtle*';
59
- const VALID_SNIPPET_TRIGSTAR_FORMAT = 'TriG*';
60
39
  const VALID_SNIPPET_RDF_FORMAT = 'Turtle';
61
40
  const RDF_ERROR_MESSAGE = 'RDF Parse Error:';
62
41
 
@@ -75,7 +54,7 @@ describe('Import user data: Text snippet', () => {
75
54
  ImportUserDataSteps.fillRDFTextSnippet(RDF_TEXT_SNIPPET_1);
76
55
  ImportUserDataSteps.clickImportTextSnippetButton();
77
56
  ImportSettingsDialogSteps.import();
78
- ImportUserDataSteps.checkImportedResource(0, TEXT_SNIPPET);
57
+ ImportUserDataSteps.checkImportedResourceByIndex(0, TEXT_SNIPPET);
79
58
  });
80
59
 
81
60
  it('Should import RDF text snippet with invalid RDF format selected', () => {
@@ -84,7 +63,7 @@ describe('Import user data: Text snippet', () => {
84
63
  ImportUserDataSteps.selectRDFFormat(JSONLD_FORMAT);
85
64
  ImportUserDataSteps.clickImportTextSnippetButton();
86
65
  ImportSettingsDialogSteps.import();
87
- ImportUserDataSteps.checkImportedResource(0, TEXT_SNIPPET, RDF_ERROR_MESSAGE);
66
+ ImportUserDataSteps.checkImportedResourceByIndex(0, TEXT_SNIPPET, RDF_ERROR_MESSAGE);
88
67
  });
89
68
 
90
69
  it('Should import RDF text snippet successfully with valid RDF format selected', () => {
@@ -93,25 +72,7 @@ describe('Import user data: Text snippet', () => {
93
72
  ImportUserDataSteps.selectRDFFormat(VALID_SNIPPET_RDF_FORMAT);
94
73
  ImportUserDataSteps.clickImportTextSnippetButton();
95
74
  ImportSettingsDialogSteps.import();
96
- ImportUserDataSteps.checkImportedResource(0, TEXT_SNIPPET);
97
- });
98
-
99
- it('Should import Turtle* text snippet successfully with valid RDF star format selected', () => {
100
- ImportUserDataSteps.openImportTextSnippetDialog();
101
- ImportUserDataSteps.fillRDFTextSnippet(TURTLESTAR_SNIPPET);
102
- ImportUserDataSteps.selectRDFFormat(VALID_SNIPPET_TURTLESTAR_FORMAT);
103
- ImportUserDataSteps.clickImportTextSnippetButton();
104
- ImportSettingsDialogSteps.import();
105
- ImportUserDataSteps.checkImportedResource(0, TEXT_SNIPPET);
106
- });
107
-
108
- it('Should import TriG* text snippet successfully with valid RDF star format selected', () => {
109
- ImportUserDataSteps.openImportTextSnippetDialog();
110
- ImportUserDataSteps.fillRDFTextSnippet(TRIGSTAR_SNIPPET);
111
- ImportUserDataSteps.selectRDFFormat(VALID_SNIPPET_TRIGSTAR_FORMAT);
112
- ImportUserDataSteps.clickImportTextSnippetButton();
113
- ImportSettingsDialogSteps.import();
114
- ImportUserDataSteps.checkImportedResource(0, TEXT_SNIPPET);
75
+ ImportUserDataSteps.checkImportedResourceByIndex(0, TEXT_SNIPPET);
115
76
  });
116
77
 
117
78
  it('Should import RDF text snippet successfully with filled base URI and context', () => {
@@ -123,7 +84,7 @@ describe('Import user data: Text snippet', () => {
123
84
  ImportSettingsDialogSteps.selectNamedGraph();
124
85
  ImportSettingsDialogSteps.fillNamedGraph(CONTEXT);
125
86
  ImportSettingsDialogSteps.import();
126
- ImportUserDataSteps.checkImportedResource(0, TEXT_SNIPPET);
87
+ ImportUserDataSteps.checkImportedResourceByIndex(0, TEXT_SNIPPET);
127
88
 
128
89
  // Go to Graphs overview
129
90
  cy.visit('/graphs');
@@ -211,7 +172,7 @@ describe('Import user data: Text snippet', () => {
211
172
  ImportSettingsDialogSteps.selectNamedGraph();
212
173
  ImportSettingsDialogSteps.fillNamedGraph(CONTEXT);
213
174
  ImportSettingsDialogSteps.import();
214
- ImportUserDataSteps.checkImportedResource(0, TEXT_SNIPPET);
175
+ ImportUserDataSteps.checkImportedResourceByIndex(0, TEXT_SNIPPET);
215
176
 
216
177
  // Go to Graphs overview
217
178
  cy.visit('/graphs');
@@ -235,7 +196,7 @@ describe('Import user data: Text snippet', () => {
235
196
  ImportSettingsDialogSteps.fillContextLink('https://w3c.github.io/json-ld-api/tests/compact/0007-context.jsonld');
236
197
  // ImportUserDataSteps.importFromSettingsDialog();
237
198
  ImportSettingsDialogSteps.import();
238
- ImportUserDataSteps.checkImportedResource(0, TEXT_SNIPPET);
199
+ ImportUserDataSteps.checkImportedResourceByIndex(0, TEXT_SNIPPET);
239
200
  const graphName = CONTEXT.slice(0, CONTEXT.lastIndexOf('.'));
240
201
  // Verify that created graph can be found
241
202
  ImportUserDataSteps.verifyGraphData(graphName, "rdf:Property", "rdf:Property", "rdf:Property", "http://example.org/graph", false);
@@ -54,27 +54,30 @@ describe('Import user data: URL import', () => {
54
54
  });
55
55
 
56
56
 
57
- it('Test import file via URL successfully with Auto format selected', () => {
57
+ // FIXME: wine.rdf contains DOCTYPE which is forbidden in the TR for GDB 12
58
+ it.skip('Test import file via URL successfully with Auto format selected', () => {
58
59
  ImportUserDataSteps.openImportURLDialog(IMPORT_URL);
59
60
  ImportUserDataSteps.clickImportUrlButton();
60
61
  // Without changing settings
61
62
  ImportSettingsDialogSteps.import();
62
- ImportUserDataSteps.checkImportedResource(0, IMPORT_URL);
63
+ ImportUserDataSteps.checkImportedResourceByIndex(0, IMPORT_URL);
63
64
  });
64
65
 
65
- it('Test import file via URL with invalid RDF format selected', () => {
66
+ // FIXME: wine.rdf contains DOCTYPE which is forbidden in the TR for GDB 12. Expected error message is different.
67
+ it.skip('Test import file via URL with invalid RDF format selected', () => {
66
68
  ImportUserDataSteps.openImportURLDialog(IMPORT_URL);
67
69
  ImportUserDataSteps.selectRDFFormat(JSONLD_FORMAT);
68
70
  ImportUserDataSteps.clickImportUrlButton();
69
71
  ImportSettingsDialogSteps.import();
70
- ImportUserDataSteps.checkImportedResource(0, IMPORT_URL, RDF_ERROR_MESSAGE);
72
+ ImportUserDataSteps.checkImportedResourceByIndex(0, IMPORT_URL, RDF_ERROR_MESSAGE);
71
73
  });
72
74
 
73
- it('Test import file via URL successfully with valid RDF format selected', () => {
75
+ // FIXME: wine.rdf contains DOCTYPE which is forbidden in the TR for GDB 12
76
+ it.skip('Test import file via URL successfully with valid RDF format selected', () => {
74
77
  ImportUserDataSteps.openImportURLDialog(IMPORT_URL);
75
78
  ImportUserDataSteps.selectRDFFormat(VALID_URL_RDF_FORMAT);
76
79
  ImportUserDataSteps.clickImportUrlButton();
77
80
  ImportSettingsDialogSteps.import();
78
- ImportUserDataSteps.checkImportedResource(0, IMPORT_URL);
81
+ ImportUserDataSteps.checkImportedResourceByIndex(0, IMPORT_URL);
79
82
  });
80
83
  });
@@ -46,7 +46,7 @@ describe('Import view', () => {
46
46
  // Then I should see the uploaded file
47
47
  ImportUserDataSteps.getResources().should('have.length', 1);
48
48
  ImportUserDataSteps.getResourceByName('bnodes.ttl').should('be.visible');
49
- ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl');
49
+ ImportUserDataSteps.checkImportedResourceByIndex(0, 'bnodes.ttl');
50
50
  });
51
51
 
52
52
  it('Should display/hide help message depends on resource result', () => {
@@ -108,7 +108,7 @@ describe('Import view', () => {
108
108
  ImportSettingsDialogSteps.getDialog().should('be.visible');
109
109
  ImportSettingsDialogSteps.import();
110
110
  ImportUserDataSteps.getResources().should('have.length', 1);
111
- ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl');
111
+ ImportUserDataSteps.checkImportedResourceByIndex(0, 'bnodes.ttl');
112
112
 
113
113
  // Then I expect the help message not exist, because user because there are resource displayed
114
114
  ImportUserDataSteps.getHelpMessage().should('not.exist');
@@ -242,7 +242,8 @@ describe('Ontop repositories', () => {
242
242
  OntopRepositorySteps.getUrlInput().should('have.value', 'jdbc:snowflake://someHostName.snowflakecomputing.com:1234/?warehouse=test_database');
243
243
  });
244
244
 
245
- context('Repository maintenance permission', () => {
245
+ // FIXME: Skipped until GDB with RDF/SPARQL 1.2 is rebased and includes the maintain permission for repositories
246
+ context.skip('Repository maintenance permission', () => {
246
247
 
247
248
  const PASSWORD = 'root';
248
249
  const REPOSITORY_MAINTAINER_USERNAME = 'repoMaintainer';
@@ -0,0 +1,129 @@
1
+ import {RepositorySteps} from "../../steps/repository-steps";
2
+ import {OntopRepositorySteps} from "../../steps/ontop-repository-steps";
3
+ import {ToasterSteps} from "../../steps/toaster-steps";
4
+ import {ModalDialogSteps} from "../../steps/modal-dialog-steps";
5
+ import {RepositoriesStubs} from '../../stubs/repositories/repositories-stubs.js';
6
+
7
+ describe('Repository rename restrictions', () => {
8
+
9
+ let repositoryId;
10
+ let memberRepositoryId;
11
+
12
+ beforeEach(() => {
13
+ repositoryId = 'repo-' + Date.now();
14
+ memberRepositoryId = 'member-' + Date.now();
15
+ });
16
+
17
+ afterEach(() => {
18
+ cy.deleteRepository(repositoryId);
19
+ cy.deleteRepository(memberRepositoryId);
20
+ });
21
+
22
+ it('should allow renaming of a GraphDB repository', () => {
23
+ // Given there is a GraphDB repository.
24
+ cy.createRepository({id: repositoryId});
25
+
26
+ // When I open its edit page.
27
+ RepositorySteps.visitEditPage(repositoryId);
28
+
29
+ // Then the repository id should be rendered as read only,
30
+ RepositorySteps.getGDBIdInput()
31
+ .should('have.value', repositoryId)
32
+ .and('be.disabled');
33
+ // and the action which unlocks the repository id field should be available.
34
+ RepositorySteps.getRepositoryIdEditElement().should('be.visible');
35
+ });
36
+
37
+ it('should not allow renaming of an Ontop repository', () => {
38
+ RepositoriesStubs.spyGetRepository(repositoryId);
39
+ // Given there is an Ontop repository.
40
+ createOntopRepository(repositoryId);
41
+
42
+ // When I open its edit page.
43
+ RepositorySteps.visit();
44
+ RepositorySteps.editRepository(repositoryId);
45
+ cy.wait('@getRepository');
46
+ // Then the repository id should be rendered as read only,
47
+ RepositorySteps.getGDBIdInput()
48
+ .should('have.value', repositoryId)
49
+ .and('be.disabled');
50
+ // and the action which unlocks the repository id field should not be available, because
51
+ // renaming is allowed only for GraphDB repositories.
52
+ RepositorySteps.getRepositoryIdEditElement().should('not.exist');
53
+
54
+ // When the repository id is changed despite the field being disabled,
55
+ forceChangeRepositoryId('renamed-' + repositoryId);
56
+ // and I try to save the configuration.
57
+ RepositorySteps.clickSaveEditedRepo();
58
+
59
+ // Then I expect to see an error message,
60
+ ToasterSteps.verifyError('Can not change the name of ontop repository');
61
+ // and the repository should keep its original id.
62
+ RepositorySteps.visit();
63
+ RepositorySteps.getRepositoryFromList(repositoryId).should('be.visible');
64
+ });
65
+
66
+ it('should not allow renaming of a FedX repository', () => {
67
+ RepositoriesStubs.spyGetRepository(repositoryId);
68
+ // Given there is a FedX repository.
69
+ cy.createRepository({id: memberRepositoryId});
70
+ createFedxRepository(repositoryId, memberRepositoryId);
71
+
72
+ // When I open its edit page.
73
+ RepositorySteps.visit();
74
+ RepositorySteps.editRepository(repositoryId);
75
+ cy.wait('@getRepository');
76
+
77
+ // Then the repository id should be rendered as read only,
78
+ RepositorySteps.getGDBIdInput()
79
+ .should('have.value', repositoryId)
80
+ .and('be.disabled');
81
+ // and the action which unlocks the repository id field should not be available, because
82
+ // renaming is allowed only for GraphDB repositories.
83
+ RepositorySteps.getRepositoryIdEditElement().should('not.exist');
84
+
85
+ // When I save the configuration.
86
+ RepositorySteps.getSaveRepositoryButton().click();
87
+ ModalDialogSteps.clickOnConfirmButton();
88
+
89
+ // Then the repository should keep its original id.
90
+ RepositorySteps.visit();
91
+ RepositorySteps.getRepositoryFromList(repositoryId).should('be.visible');
92
+ });
93
+
94
+ /**
95
+ * Changes the repository id field although it is disabled in order to verify that the restriction is
96
+ * enforced by the controller too and not only by the view.
97
+ *
98
+ * @param {string} newRepositoryId The new repository id.
99
+ */
100
+ const forceChangeRepositoryId = (newRepositoryId) => {
101
+ RepositorySteps.getGDBIdInput()
102
+ .clear({force: true})
103
+ .type(newRepositoryId, {force: true})
104
+ .should('have.value', newRepositoryId);
105
+ };
106
+
107
+ const createOntopRepository = (repositoryId) => {
108
+ OntopRepositorySteps.visitCreate();
109
+ RepositorySteps.typeRepositoryId(repositoryId);
110
+ OntopRepositorySteps.selectOracleDatabase();
111
+ OntopRepositorySteps.typeHostName('localhost');
112
+ OntopRepositorySteps.typePort(5423);
113
+ OntopRepositorySteps.typeDatabaseName('database-name');
114
+ OntopRepositorySteps.clickObdaFileUploadButton();
115
+ OntopRepositorySteps.uploadObdaFile('fixtures/ontop/university-complete.obda');
116
+ // Wait the OBDA edit button to become visible to ensure that the file is uploaded.
117
+ OntopRepositorySteps.getOBDAFileFieldEditButton().should('be.visible');
118
+ OntopRepositorySteps.clickOnCreateRepositoryButton();
119
+ };
120
+
121
+ const createFedxRepository = (repositoryId, memberRepositoryId) => {
122
+ RepositorySteps.visit();
123
+ RepositorySteps.createRepository();
124
+ RepositorySteps.createFedexRepositoryType();
125
+ RepositorySteps.typeRepositoryId(repositoryId);
126
+ RepositorySteps.selectFedexMember(memberRepositoryId);
127
+ RepositorySteps.saveRepository();
128
+ };
129
+ });
@@ -452,7 +452,7 @@ describe('Repositories', () => {
452
452
  .selectRDFFormat("TriG")
453
453
  .clickImportTextSnippetButton();
454
454
  ImportSettingsDialogSteps.import();
455
- ImportUserDataSteps.checkImportedResource(0, 'Text snippet');
455
+ ImportUserDataSteps.checkImportedResourceByIndex(0, 'Text snippet');
456
456
  // Import data that conforms with the shape - import is successfully
457
457
  // The newly imported file is first in the list
458
458
  ImportUserDataSteps
@@ -461,7 +461,7 @@ describe('Repositories', () => {
461
461
  .selectRDFFormat("Turtle")
462
462
  .clickImportTextSnippetButton();
463
463
  ImportSettingsDialogSteps.import();
464
- ImportUserDataSteps.checkImportedResource(0, 'Text snippet');
464
+ ImportUserDataSteps.checkImportedResourceByIndex(0, 'Text snippet');
465
465
  // Import data that does not conform with the shape - GraphDBShaclSailValidationException
466
466
  // The newly imported file is first in the list
467
467
  ImportUserDataSteps
@@ -470,7 +470,7 @@ describe('Repositories', () => {
470
470
  .selectRDFFormat("Turtle")
471
471
  .clickImportTextSnippetButton();
472
472
  ImportSettingsDialogSteps.import();
473
- ImportUserDataSteps.checkImportedResource(0, 'Text snippet', 'org.eclipse.rdf4j.sail.shacl.GraphDBShaclSailValidationException: Failed SHACL validation');
473
+ ImportUserDataSteps.checkImportedResourceByIndex(0, 'Text snippet', 'org.eclipse.rdf4j.sail.shacl.GraphDBShaclSailValidationException: Failed SHACL validation');
474
474
  });
475
475
 
476
476
  it('should allow editing of repository name if repository is in cluster', () => {