graphdb-workbench-tests 2.7.6 → 2.8.0-RC1

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 (119) hide show
  1. package/cypress.config.js +3 -0
  2. package/fixtures/cluster/2-nodes-cluster-group-status-deleted.json +30 -0
  3. package/fixtures/cluster/2-nodes-cluster-group-status.json +30 -0
  4. package/fixtures/cluster/3-nodes-cluster-group-status-after-replace.json +44 -0
  5. package/fixtures/cluster/3-nodes-cluster-group-status-building-snapshot.json +4 -1
  6. package/fixtures/cluster/3-nodes-cluster-group-status-receiving-snapshot.json +4 -1
  7. package/fixtures/cluster/3-nodes-cluster-group-status-sending-snapshot.json +4 -1
  8. package/fixtures/cluster/3-nodes-cluster-group-status-waiting-for-snapshot.json +4 -1
  9. package/fixtures/cluster/3-nodes-cluster-group-status.json +12 -3
  10. package/fixtures/cluster/4-nodes-cluster-group-status.json +58 -0
  11. package/fixtures/cluster/cluster-config.json +1 -0
  12. package/fixtures/cluster/cluster-node-status.json +4 -1
  13. package/fixtures/connectors/get-connectors.json +8 -0
  14. package/fixtures/connectors/get-retrieval-connector-0.json +1 -0
  15. package/fixtures/connectors/get-retrieval-connector.json +29 -0
  16. package/fixtures/connectors/get-ttyg-chatgpt-connectors.json +188 -0
  17. package/fixtures/locale-en.json +630 -61
  18. package/fixtures/namespaces/get-repository-starwars-namespaces.json +252 -0
  19. package/fixtures/remote-location/get-0-remote-locations.json +1 -2
  20. package/fixtures/remote-location/get-1-remote-locations.json +2 -4
  21. package/fixtures/remote-location/get-2-remote-locations.json +3 -6
  22. package/fixtures/remote-location/get-3-remote-locations.json +4 -8
  23. package/fixtures/remote-location/get-4-remote-locations.json +54 -0
  24. package/fixtures/remote-location/remote-location-status-in-cluster.json +1 -2
  25. package/fixtures/remote-location/remote-location-status-not-in-cluster.json +1 -2
  26. package/fixtures/remote-location/remote-locations-filter.json +1 -2
  27. package/fixtures/repositories/get-locations.json +67 -0
  28. package/fixtures/repositories/get-repositories.json +106 -0
  29. package/fixtures/repositories/get-repository-config-starwars-disabled-fts.json +201 -0
  30. package/fixtures/repositories/get-repository-config-starwars-enabled-fts.json +201 -0
  31. package/fixtures/repositories/get-ttyg-repositories.json +74 -0
  32. package/fixtures/similarity/get-similarity-indexes-0.json +1 -0
  33. package/fixtures/similarity/get-similarity-indexes.json +15 -0
  34. package/fixtures/similarity/get-ttyg-similarity-connectors.json +46 -0
  35. package/fixtures/ttyg/agent/create-agent.json +20 -0
  36. package/fixtures/ttyg/agent/get-agent-defaults.json +42 -0
  37. package/fixtures/ttyg/agent/get-agent-list-0.json +1 -0
  38. package/fixtures/ttyg/agent/get-agent-list-after-deleted.json +56 -0
  39. package/fixtures/ttyg/agent/get-agent-list-new-agent.json +22 -0
  40. package/fixtures/ttyg/agent/get-agent-list.json +77 -0
  41. package/fixtures/ttyg/agent/get-agent.json +25 -0
  42. package/fixtures/ttyg/chats/ask-question.json +25 -0
  43. package/fixtures/ttyg/chats/create/create-chat-response.json +16 -0
  44. package/fixtures/ttyg/chats/create/get-chats-after-create.json +12 -0
  45. package/fixtures/ttyg/chats/create/get-chats-before-create.json +7 -0
  46. package/fixtures/ttyg/chats/deleted-chat.json +3 -0
  47. package/fixtures/ttyg/chats/explain-response-1.json +59 -0
  48. package/fixtures/ttyg/chats/explain-response-2.json +59 -0
  49. package/fixtures/ttyg/chats/export-chat.json +34 -0
  50. package/fixtures/ttyg/chats/get-chat-list-0.json +1 -0
  51. package/fixtures/ttyg/chats/get-chat-list-with-deleted-chat.json +17 -0
  52. package/fixtures/ttyg/chats/get-chat-list-with-renamed-chat.json +22 -0
  53. package/fixtures/ttyg/chats/get-chat-list.json +22 -0
  54. package/fixtures/ttyg/chats/get-chat.json +199 -0
  55. package/fixtures/ttyg/chats/renamed-chat.json +4 -0
  56. package/integration/cluster/cluster-management.spec.js +0 -170
  57. package/integration/cluster/edit-cluster-nodes-modal.spec.js +425 -0
  58. package/integration/explore/graphs.overview.spec.js +4 -0
  59. package/integration/home/cookie-policy.spec.js +65 -0
  60. package/integration/home/create-repository.spec.js +35 -0
  61. package/integration/home/documentation-link.spec.js +60 -0
  62. package/integration/home/google-analytics.spec.js +60 -0
  63. package/integration/home/language-selector.spec.js +19 -0
  64. package/integration/home/rdf-resource-search.spec.js +192 -0
  65. package/integration/home/view-resource-autocomplete.spec.js +52 -0
  66. package/integration/home/workbench.home.spec.js +1 -277
  67. package/integration/import/import-user-data-file-upload.spec.js +13 -0
  68. package/integration/import/import-user-data.spec.js +8 -2
  69. package/integration/import/import-view.spec.js +6 -1
  70. package/integration/repository/attach-remote-location.spec.js +203 -0
  71. package/integration/repository/ontop-repository.spec.js +87 -1
  72. package/integration/repository/repositories.spec.js +4 -19
  73. package/integration/setup/my-settings.spec.js +2 -0
  74. package/integration/ttyg/agent-list.spec.js +76 -0
  75. package/integration/ttyg/agent-select-menu.spec.js +141 -0
  76. package/integration/ttyg/chat-list.spec.js +286 -0
  77. package/integration/ttyg/chat-panel.spec.js +175 -0
  78. package/integration/ttyg/clone-agent.spec.js +75 -0
  79. package/integration/ttyg/create-agent.spec.js +560 -0
  80. package/integration/ttyg/create-chat.spec.js +69 -0
  81. package/integration/ttyg/delete-agent.spec.js +51 -0
  82. package/integration/ttyg/edit-agent.spec.js +54 -0
  83. package/integration/ttyg/ttyg-permission.spec.js +66 -0
  84. package/integration/ttyg/ttyg-view.spec.js +75 -0
  85. package/npm-shrinkwrap.json +215 -220
  86. package/package.json +5 -6
  87. package/steps/alert-dialog-steps.js +25 -0
  88. package/steps/cluster/cluster-page-steps.js +8 -0
  89. package/steps/cluster/custer-nodes-configuration-steps.js +107 -0
  90. package/steps/home-steps.js +48 -5
  91. package/steps/import/import-steps.js +11 -11
  92. package/steps/modal-dialog-steps.js +8 -0
  93. package/steps/ontop-repository-steps.js +26 -0
  94. package/steps/repositories/attach-repository-steps.js +118 -0
  95. package/steps/repository-steps.js +53 -5
  96. package/steps/setup/settings-steps.js +17 -0
  97. package/steps/ttyg/chat-panel-steps.js +62 -0
  98. package/steps/ttyg/ttyg-agent-settings-modal.steps.js +462 -0
  99. package/steps/ttyg/ttyg-view-steps.js +333 -0
  100. package/steps/window-steps.js +5 -0
  101. package/stubs/cluster/cluster-stubs.js +127 -7
  102. package/stubs/cluster/remote-location-stubs.js +46 -0
  103. package/stubs/connector-stubs.js +39 -0
  104. package/stubs/environment-stubs.js +27 -0
  105. package/stubs/license-stubs.js +101 -0
  106. package/stubs/repositories/repositories-stubs.js +133 -0
  107. package/stubs/repositories-stub.js +15 -0
  108. package/stubs/security-stubs.js +7 -0
  109. package/stubs/similarity-index-stubs.js +32 -0
  110. package/stubs/stubs.js +4 -0
  111. package/stubs/ttyg/ttyg-stubs.js +166 -0
  112. package/support/commands.js +2 -0
  113. package/support/index.js +17 -0
  114. package/support/security-command.js +25 -0
  115. package/support/settings-commands.js +4 -5
  116. package/support/user-commands.js +31 -0
  117. package/steps/cluster/add-remote-location-dialog-steps.js +0 -11
  118. package/steps/cluster/create-cluster-dialog-steps.js +0 -39
  119. package/steps/cluster/replace-nodes-dialog-steps.js +0 -39
@@ -1,199 +1,13 @@
1
1
  import HomeSteps from '../../steps/home-steps';
2
2
 
3
- const FILE_TO_IMPORT = 'wine.rdf';
4
-
5
3
  describe('Home screen validation', () => {
6
4
 
7
- const FOAT_SNIPPET = '@base <http://example.org/> .\n' +
8
- '@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n' +
9
- '<#green-goblin>\n' +
10
- 'a foaf:Person ; # in the context of the Marvel universe\n' +
11
- 'foaf:name "Green Goblin" .\n';
12
- const GOBLIN_URI = 'http://example.org/#green-goblin';
13
-
14
5
  beforeEach(() => {
15
6
  cy.viewport(1280, 1000);
16
- });
17
-
18
- context('RDF resource search', () => {
19
- it('Search button should not be present when no repo is selected', () => {
20
- HomeSteps.visitAndWaitLoader();
21
- cy.get('.search-rdf-btn').should('not.exist');
22
- cy.get('.search-rdf-input').should('not.exist');
23
- });
24
-
25
- it('Search should be made from home page search when repo is set and on home page', () => {
26
- const repositoryId = '23repo' + Date.now();
27
- cy.createRepository({id: repositoryId});
28
- cy.initializeRepository(repositoryId);
29
- cy.enableAutocomplete(repositoryId);
30
- cy.presetRepository(repositoryId);
31
-
32
- // When I visit home page with selected repository
33
- HomeSteps.visitAndWaitLoader();
34
- // Search rdf button should be visible
35
- cy.get('.search-rdf-btn').should('be.visible');
36
- // When I click the button
37
- HomeSteps.doNotOpenRdfSearchBoxButFocusResourceSearch();
38
- // I should be able to type some text in the input on home page
39
- cy.get('#search-resource-input-home > #search-resource-box > input').type('hasPos');
40
- // And the autocomplete dropdown should become visible
41
- cy.get('#search-resource-input-home > #auto-complete-results-wrapper').should('be.visible');
42
- // // When I click the close button
43
- cy.get('#search-resource-input-home > #search-resource-box > .clear-icon').click();
44
- // // The input should be cleared
45
- cy.get('#search-resource-input-home > #search-resource-box > input').should('have.value', '');
46
-
47
- cy.deleteRepository(repositoryId);
48
- });
49
-
50
- it('Search should be present when repo is set', () => {
51
- const repositoryId = '23repo' + Date.now();
52
- cy.createRepository({id: repositoryId});
53
- cy.initializeRepository(repositoryId);
54
- cy.enableAutocomplete(repositoryId);
55
- cy.presetRepository(repositoryId);
56
-
57
- // When I visit not home page with selected repository
58
- cy.visit('/graphs');
59
- cy.get('.ot-splash').should('not.be.visible');
60
- cy.get('.ot-loader-new-content').should('not.exist');
61
- // Search rdf button should be visible
62
- cy.get('.search-rdf-btn').should('be.visible');
63
- // When I click the button
64
- HomeSteps.openRdfSearchBox();
65
- // I should be able to type some text in the input
66
- cy.get('.search-rdf-input search-resource-input .view-res-input').type('hasPos');
67
- // And the autocomplete dropdown should become visible
68
- cy.get('.search-rdf-input #auto-complete-results-wrapper').should('be.visible');
69
- // When I click the close button
70
- cy.get('.close-rdf-search-btn').click();
71
- // The input should not be cleared
72
- cy.get('.search-rdf-input search-resource-input .view-res-input').should('have.value', 'hasPos');
73
- // And the search bar should hide and not be visible
74
- cy.get('.search-rdf-input').should('not.be.visible');
75
- // And the suggestions list should not be visible
76
- cy.get('.search-rdf-input #auto-complete-results-wrapper').should('not.be.visible');
77
- // And the search button should be visible
78
- cy.get('.search-rdf-btn').should('be.visible');
79
- // When I open again the search box
80
- HomeSteps.openRdfSearchBox();
81
- // The input should have value 'hasPos'
82
- cy.get('.search-rdf-input search-resource-input .view-res-input').should('have.value', 'hasPos');
83
- // And dropdown should be visible
84
- cy.get('.search-rdf-input #auto-complete-results-wrapper').should('be.visible');
85
- // When I press 'escape'
86
- cy.get('.search-rdf-input search-resource-input .view-res-input').type('{esc}');
87
- // Search box should not be visible
88
- cy.get('.search-rdf-input').should('not.be.visible');
89
-
90
- cy.deleteRepository(repositoryId);
91
- });
92
-
93
- it('Search should be persisted on page reload', () => {
94
- const repositoryId = '23repo' + Date.now();
95
- cy.createRepository({id: repositoryId});
96
- cy.initializeRepository(repositoryId);
97
- cy.enableAutocomplete(repositoryId);
98
- cy.presetRepository(repositoryId);
99
-
100
- cy.visit('/graphs', {
101
- onBeforeLoad (win) {
102
- cy.stub(win, 'open').as('window.open');
103
- }
104
- });
105
- cy.get('.ot-splash').should('not.be.visible');
106
- cy.get('.ot-loader-new-content').should('not.exist');
107
- // Search rdf button should be visible
108
- cy.get('.search-rdf-btn').should('be.visible');
109
- // When I click the button
110
- HomeSteps.openRdfSearchBox();
111
- // I should be able to type some text in the input
112
- cy.get('.search-rdf-input search-resource-input .view-res-input')
113
- .type('hasPos').then(() => {
114
- // When I select option from suggestions
115
- cy.get(".search-rdf-input #auto-complete-results-wrapper p")
116
- .contains('hasPos')
117
- .click()
118
- .then(() => {
119
- // Search result should be opened in new window
120
- cy.get('@window.open').should('be.calledWith', 'resource?uri=http%3A%2F%2Fwww.w3.org%2Fns%2Forg%23hasPost');
121
- });
122
- });
123
-
124
- // When I revisit the home page
125
- cy.visit('/graphs');
126
- // When I open again the search box
127
- HomeSteps.openRdfSearchBox();
128
- // The input should have value 'hasPos' from previous search
129
- cy.get('.search-rdf-input search-resource-input .view-res-input').should('have.value', 'hasPos');
130
- // And dropdown should be visible
131
- cy.get('.search-rdf-input #auto-complete-results-wrapper').should('be.visible');
132
- // When I press 'escape'
133
- cy.get('.search-rdf-input search-resource-input .view-res-input')
134
- .type('{esc}')
135
- .then(() => {
136
- // Search box should not be visible
137
- cy.get('.search-rdf-input').should('not.be.visible');
138
- });
139
-
140
- cy.deleteRepository(repositoryId);
141
- });
142
-
143
- it('Should test RDF resource search box', () => {
144
- //Prepare repository, autocomplete and import data.
145
- const repositoryId = 'repository-' + Date.now();
146
- cy.createRepository({id: repositoryId});
147
- cy.initializeRepository(repositoryId);
148
- cy.presetRepository(repositoryId);
149
- cy.importServerFile(repositoryId, FILE_TO_IMPORT);
150
- cy.enableAutocomplete(repositoryId);
151
- HomeSteps.visitAndWaitLoader();
152
-
153
- //Verify that the main resource search box is focused
154
- getRDFResourceSearchBox().click();
155
- cy.focused().should('have.attr', 'placeholder', 'Search RDF resources...');
156
-
157
- //Navigate away from the Homepage, to be able to test the new resource search box
158
- cy.visit('/graphs', {
159
- onBeforeLoad (win) {
160
- cy.stub(win, 'open').as('window.open');
161
- }
162
- });
163
-
164
- cy.get('.ot-splash').should('not.be.visible');
165
- cy.get('.ot-loader-new-content').should('not.exist');
166
-
167
- getRDFResourceSearchBox().click();
168
- //Verify that the new resource search box is focused
169
- cy.focused().should('have.attr', 'placeholder', 'Search RDF resources...')
170
-
171
- //Verify autocomplete suggestions count
172
- cy.focused().then(() => {
173
- cy.get('#search-resource-box input')
174
- .should('be.visible')
175
- .type('Dry');
176
- cy.get('#auto-complete-results-wrapper')
177
- .should('be.visible')
178
- .children()
179
- .should('have.length', 7);
180
- })
181
-
182
- //Test table and visual buttons.
183
- cy.get("#auto_0").should('be.visible').click();
184
- // Search result should be opened in new window
185
- cy.get('@window.open').should('be.calledWith', 'resource?uri=http%3A%2F%2Fwww.w3.org%2FTR%2F2003%2FPR-owl-guide-20031209%2Fwine%23Dry');
186
-
187
- getVisualButton().click();
188
- cy.get("#auto_0").should('be.visible').click();
189
- cy.get('@window.open').should('be.calledWith', 'graphs-visualizations?uri=http%3A%2F%2Fwww.w3.org%2FTR%2F2003%2FPR-owl-guide-20031209%2Fwine%23Dry');
190
- cy.deleteRepository(repositoryId);
191
- });
7
+ HomeSteps.visitAndWaitLoader();
192
8
  });
193
9
 
194
10
  context('First visit', () => {
195
- beforeEach(() => HomeSteps.visitAndWaitLoader());
196
-
197
11
  it('Verify that tutorial panel exists', () => {
198
12
  HomeSteps.verifyTutorialVisible(true);
199
13
  });
@@ -213,94 +27,4 @@ describe('Home screen validation', () => {
213
27
  HomeSteps.verifyTutorialVisible(false);
214
28
  });
215
29
  });
216
-
217
- context('Creating repository', () => {
218
- beforeEach(() => HomeSteps.visitAndWaitLoader());
219
-
220
- it('Test create and select new repository via home page', () => {
221
- HomeSteps.verifyCreateRepositoryLink();
222
-
223
- const repositoryId = HomeSteps.createRepo();
224
- // Initializing the repository to speed up retrieving repository info
225
- cy.initializeRepository(repositoryId);
226
-
227
- HomeSteps.selectRepo(repositoryId);
228
- HomeSteps.verifyRepositoryIsSelected(repositoryId);
229
- HomeSteps.hasRepositoryInfo(repositoryId);
230
-
231
- cy.deleteRepository(repositoryId);
232
- });
233
-
234
- it('Test saved SPARQL queries links on home page and confirm dialog appearance', () => {
235
- const repositoryId = HomeSteps.createRepo();
236
- HomeSteps.selectRepo(repositoryId);
237
-
238
- HomeSteps.verifyQueryLink('Add statements', true);
239
- HomeSteps.verifyQueryLink('Clear graph', true);
240
- HomeSteps.verifyQueryLink('Remove statements', true);
241
- HomeSteps.verifyQueryLink('SPARQL Select template', false);
242
-
243
- cy.deleteRepository(repositoryId);
244
- });
245
- });
246
-
247
- context('"View resource" autocomplete', () => {
248
- it('Test homepage autocomplete when it is enabled', () => {
249
- const repositoryId = HomeSteps.createRepo();
250
- HomeSteps.selectRepo(repositoryId);
251
-
252
- // Type an invalid resource
253
- HomeSteps.getAutocompleteInput().type('hfsafa');
254
- HomeSteps.noAutocompleteToast();
255
-
256
- cy.importRDFTextSnippet(repositoryId, FOAT_SNIPPET);
257
- cy.enableAutocomplete(repositoryId);
258
-
259
- HomeSteps.visitAndWaitLoader(true).then((el) => el)
260
- .then(() => HomeSteps.getAutocompleteDisplayTypeButton('table').click())
261
- .then(() => HomeSteps.autocompleteText('Green', GOBLIN_URI))
262
- .then(() => HomeSteps.getAutocompleteResultElement(GOBLIN_URI).click())
263
- .then(() => // Search result should be opened in new window
264
- cy.get('@window.open').should('be.calledWith', 'resource?uri=http%3A%2F%2Fexample.org%2F%23green-goblin'))
265
- .then(() => HomeSteps.getAutocompleteDisplayTypeButton('visual').click())
266
- .then(() => HomeSteps.getAutocompleteResultElement(GOBLIN_URI).click())
267
- .then(() => // Search result should be opened in new window
268
- cy.get('@window.open').should('be.calledWith', 'graphs-visualizations?uri=http%3A%2F%2Fexample.org%2F%23green-goblin'));
269
- cy.deleteRepository(repositoryId);
270
- });
271
-
272
- it('should not suggest resources in "View resources" when autocomplete is not enabled', () => {
273
- const repositoryId = HomeSteps.createRepo();
274
- cy.importRDFTextSnippet(repositoryId, FOAT_SNIPPET);
275
-
276
- HomeSteps.visitAndWaitLoader();
277
- HomeSteps.selectRepo(repositoryId);
278
-
279
- HomeSteps.getAutocompleteInput().type('Green');
280
- HomeSteps.noAutocompleteToast();
281
-
282
- cy.deleteRepository(repositoryId);
283
- });
284
- });
285
-
286
- context('Set preferred language', () => {
287
- beforeEach(() => HomeSteps.visitAndWaitLoader());
288
- it('language button should be visible and actionable', () => {
289
- cy.get('#languageGroupDrop')
290
- .should('be.visible')
291
- .click()
292
- .then(() => {
293
- cy.get('.dropdown-menu .dropdown-item')
294
- .should('have.length.at.least', 1);
295
- });
296
- });
297
- });
298
-
299
- function getRDFResourceSearchBox() {
300
- return cy.get('rdf-resource-search').should('be.visible');
301
- }
302
-
303
- function getVisualButton() {
304
- return cy.get('.display-type-visual-btn').should('be.visible');
305
- }
306
30
  });
@@ -99,11 +99,14 @@ describe('Import user data: File upload', () => {
99
99
  ImportUserDataSteps.getResourcesTable().should('be.hidden');
100
100
  // When I upload a file
101
101
  ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[0], bnodes));
102
+ // Then the import settings dialog should open automatically
103
+ ImportSettingsDialogSteps.getDialog().should('be.visible');
102
104
  ImportSettingsDialogSteps.import();
103
105
  // Then I should see the uploaded file
104
106
  ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl');
105
107
  // When I upload another file
106
108
  ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[1], jsonld));
109
+ ImportSettingsDialogSteps.getDialog().should('be.visible');
107
110
  ImportSettingsDialogSteps.import();
108
111
  // Then I should see the uploaded file - it becomes first in the list
109
112
  ImportUserDataSteps.checkImportedResource(0, 'jsonld.jsonld');
@@ -111,6 +114,7 @@ describe('Import user data: File upload', () => {
111
114
  // When I override the first file
112
115
  ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[0], bnodes));
113
116
  FileOverwriteDialogSteps.overwrite();
117
+ ImportSettingsDialogSteps.getDialog().should('be.visible');
114
118
  ImportSettingsDialogSteps.import();
115
119
  // Then I should see the uploaded file - it becomes first in the list
116
120
  // TODO: timestamps currently seems to not be changed on reimport
@@ -119,6 +123,7 @@ describe('Import user data: File upload', () => {
119
123
  // When I override the second file
120
124
  ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[1], jsonld));
121
125
  FileOverwriteDialogSteps.overwrite();
126
+ ImportSettingsDialogSteps.getDialog().should('be.visible');
122
127
  ImportSettingsDialogSteps.import();
123
128
  // Then I should see the uploaded file - it becomes first in the list
124
129
  ImportUserDataSteps.checkImportedResource(0, 'jsonld.jsonld');
@@ -131,6 +136,7 @@ describe('Import user data: File upload', () => {
131
136
  // When I start to upload a file
132
137
  ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[0], bnodes));
133
138
  // Then the import settings dialog should open automatically
139
+ ImportSettingsDialogSteps.getDialog().should('be.visible');
134
140
  ImportSettingsDialogSteps.uploadOnly();
135
141
  // Then I should see the uploaded file
136
142
  ImportUserDataSteps.getResources().should('have.length', 1);
@@ -149,6 +155,7 @@ describe('Import user data: File upload', () => {
149
155
  const file2 = ImportUserDataSteps.createFile(testFiles[1], jsonld);
150
156
  ImportUserDataSteps.selectFile([file1, file2]);
151
157
  // Then the import settings dialog should open automatically
158
+ ImportSettingsDialogSteps.getDialog().should('be.visible');
152
159
  ImportSettingsDialogSteps.import();
153
160
  // Then I should see the uploaded file
154
161
  ImportUserDataSteps.getResources().should('have.length', 2);
@@ -165,6 +172,8 @@ describe('Import user data: File upload', () => {
165
172
  ImportUserDataSteps.getResourcesTable().should('be.hidden');
166
173
  const file1 = ImportUserDataSteps.createFile(testFiles[0], bnodes);
167
174
  ImportUserDataSteps.selectFile(file1);
175
+ // Then the import settings dialog should open automatically
176
+ ImportSettingsDialogSteps.getDialog().should('be.visible');
168
177
  ImportSettingsDialogSteps.import();
169
178
  ImportUserDataSteps.getResources().should('have.length', 1);
170
179
  ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl');
@@ -186,6 +195,8 @@ describe('Import user data: File upload', () => {
186
195
  ImportUserDataSteps.getResourcesTable().should('be.hidden');
187
196
  const file1 = ImportUserDataSteps.createFile(testFiles[0], bnodes);
188
197
  ImportUserDataSteps.selectFile(file1);
198
+ // Then the import settings dialog should open automatically
199
+ ImportSettingsDialogSteps.getDialog().should('be.visible');
189
200
  ImportSettingsDialogSteps.import();
190
201
  ImportUserDataSteps.getResources().should('have.length', 1);
191
202
  ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl');
@@ -220,6 +231,8 @@ describe('Import user data: File upload', () => {
220
231
  // When I upload a file with invalid format
221
232
  const file1 = ImportUserDataSteps.createFile(testFiles[2], jsonld);
222
233
  ImportUserDataSteps.selectFile(file1);
234
+ // Then the import settings dialog should open automatically
235
+ ImportSettingsDialogSteps.getDialog().should('be.visible');
223
236
  ImportSettingsDialogSteps.import();
224
237
  // Then I should see an error message
225
238
  ImportUserDataSteps.getResources().should('have.length', 1);
@@ -1,6 +1,7 @@
1
1
  import {ModalDialogSteps} from "../../steps/modal-dialog-steps";
2
2
  import {ImportUserDataSteps} from "../../steps/import/import-user-data-steps";
3
3
  import {ImportSettingsDialogSteps} from "../../steps/import/import-settings-dialog-steps";
4
+ import {WindowSteps} from "../../steps/window-steps";
4
5
 
5
6
  const RDF_TEXT_SNIPPET = '@prefix ab:<http://learningsparql.com/ns/addressbook#>.\n\n' +
6
7
  'ab:richard ab:homeTel "(229)276-5135".\n' +
@@ -27,7 +28,12 @@ describe('Import user data', () => {
27
28
  cy.url().should('include', '/import#user');
28
29
  // Then I should see the user help icons
29
30
  ImportUserDataSteps.showPageInfoPopover();
30
- ImportUserDataSteps.getPageInfoPopover().should('be.visible');
31
+ ImportUserDataSteps.getPageInfoPopover()
32
+ .should('be.visible')
33
+ .find('a')
34
+ .should('have.attr', 'href', 'https://graphdb.ontotext.com/documentation/master/loading-data-using-the-workbench.html')
35
+ .and('contain.text', 'Learn more in the GraphDB documentation');
36
+ ImportUserDataSteps.hidePageInfoPopover();
31
37
  // And user data import tab should be selected by default
32
38
  ImportUserDataSteps.getActiveTab().should('have.text', 'User data');
33
39
  ImportUserDataSteps.getUserDataTab().should('be.visible');
@@ -114,6 +120,6 @@ describe('Import user data', () => {
114
120
  // And I click the copy button next to the max file size limit property
115
121
  ImportUserDataSteps.copyMaxFileSizeLimitProperty();
116
122
  // Then I should be able to copy the max file size limit property
117
- ImportUserDataSteps.getClipboardTextContent().should('equal', 'graphdb.workbench.maxUploadSize');
123
+ WindowSteps.getClipboardTextContent().should('equal', 'graphdb.workbench.maxUploadSize');
118
124
  });
119
125
  });
@@ -31,6 +31,8 @@ describe('Import view', () => {
31
31
  // Given I have opened the user data tab and uploaded a single file
32
32
  ImportUserDataSteps.getResourcesTable().should('be.hidden');
33
33
  ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[0], bnodes));
34
+ // Then the import settings dialog should open automatically
35
+ ImportSettingsDialogSteps.getDialog().should('be.visible');
34
36
  ImportSettingsDialogSteps.import();
35
37
  ImportUserDataSteps.getResources().should('have.length', 1);
36
38
  ImportUserDataSteps.getResourceByName('bnodes.ttl').should('be.visible');
@@ -43,6 +45,7 @@ describe('Import view', () => {
43
45
  // Then I should see the uploaded file
44
46
  ImportUserDataSteps.getResources().should('have.length', 1);
45
47
  ImportUserDataSteps.getResourceByName('bnodes.ttl').should('be.visible');
48
+ ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl');
46
49
  });
47
50
 
48
51
  it('Should display/hide help message depends on resource result', () => {
@@ -99,10 +102,12 @@ describe('Import view', () => {
99
102
  // When I go to user tab and upload a file
100
103
  ImportSteps.openUserDataTab();
101
104
  // And I wait for tab data to load
102
- cy.wait(100);
103
105
  ImportUserDataSteps.selectFile(ImportUserDataSteps.createFile(testFiles[0], bnodes));
106
+ // Then the import settings dialog should open automatically
107
+ ImportSettingsDialogSteps.getDialog().should('be.visible');
104
108
  ImportSettingsDialogSteps.import();
105
109
  ImportUserDataSteps.getResources().should('have.length', 1);
110
+ ImportUserDataSteps.checkImportedResource(0, 'bnodes.ttl');
106
111
 
107
112
  // Then I expect the help message not exist, because user because there are resource displayed
108
113
  ImportUserDataSteps.getHelpMessage().should('not.exist');
@@ -0,0 +1,203 @@
1
+ import {RepositorySteps} from "../../steps/repository-steps";
2
+ import {AttachRepositorySteps} from "../../steps/repositories/attach-repository-steps";
3
+ import {ModalDialogSteps} from "../../steps/modal-dialog-steps";
4
+ import {RepositoriesStubs} from "../../stubs/repositories/repositories-stubs";
5
+
6
+ describe('Attach remote location', () => {
7
+
8
+ it('Should create and delete remote instance', () => {
9
+ cy.visit('/repository');
10
+ RepositorySteps.waitLoader();
11
+ RepositorySteps.waitUntilRepositoriesPageIsLoaded();
12
+
13
+ // When I open the "Attach a remote instance" dialog.
14
+ AttachRepositorySteps.openAttachRemoteLocationDialog();
15
+
16
+ // Then I expect the "Attach" button to be disabled (not clickable), because location URL is mandatory
17
+ AttachRepositorySteps.getAttachBtn().should('be.disabled');
18
+ // and authentication type to be "None". This is default location type.
19
+ AttachRepositorySteps.getRemoteLocationDialog().should('contain', 'No authentication will be used with this location.');
20
+ // I expect GraphDB type be selected
21
+ AttachRepositorySteps.getGraphDBRadioBtn().should('be.checked');
22
+
23
+ // When I fill wrong location URL
24
+ AttachRepositorySteps.enterURL("Wrong URL");
25
+
26
+ // Then I expect to see error message
27
+ AttachRepositorySteps.getRemoteLocationDialog().should('contain', 'Note that the location should be a URL that points to a remote GraphDB installation,');
28
+
29
+ // When I clear the wrong URL
30
+ AttachRepositorySteps.clearURL();
31
+
32
+ // Then I expect to see an error message that states the location is required.
33
+ AttachRepositorySteps.getRemoteLocationDialog().should('contain', 'Location URL is required.');
34
+
35
+ // When I fill correct URL
36
+ AttachRepositorySteps.enterURL("http://loc");
37
+
38
+ // Then I expect the "Attach" button to be enabled
39
+ AttachRepositorySteps.getAttachBtn().should('be.enabled');
40
+
41
+ // When I switch to basic authentication
42
+ AttachRepositorySteps.selectBasicRadioBtn();
43
+
44
+ // Then I expect the "Attach" button to be disabled (not clickable), because Username and Password are mandatory
45
+ AttachRepositorySteps.getAttachBtn().should('be.disabled');
46
+
47
+ // When I fill Username
48
+ AttachRepositorySteps.enterUsername('username');
49
+
50
+ // Then I expect the "Attach" button to be disabled (not clickable), because Password is mandatory
51
+ AttachRepositorySteps.getAttachBtn().should('be.disabled');
52
+
53
+ // When I fill password
54
+ AttachRepositorySteps.enterPassword('password');
55
+ // Then I expect the "Attach" button to be enabled
56
+ AttachRepositorySteps.getAttachBtn().should('be.enabled');
57
+
58
+ // When I remove the Username and Password and
59
+ AttachRepositorySteps.clearUsername();
60
+ AttachRepositorySteps.clearPassword();
61
+ // switch to Signature authentication type
62
+ AttachRepositorySteps.selectSignatureRadioBtn();
63
+
64
+ // Then I expect the "Attach" button to be enabled, because only location URL is mandatory
65
+ AttachRepositorySteps.getAttachBtn().should('be.enabled');
66
+
67
+ // When I clear the location URL
68
+ AttachRepositorySteps.clearURL();
69
+
70
+ // Then I expect the "Attach" button to be disabled (not clickable), because Location URL is mandatory
71
+ AttachRepositorySteps.getAttachBtn().should('be.disabled');
72
+
73
+ // When I switch to Ontopic instance
74
+ AttachRepositorySteps.selectOntopicRadioBtn();
75
+ // Then I expect the "Attach" button to be disabled (not clickable), because Location URL, ClienatId and Secret are mandatory
76
+ AttachRepositorySteps.getAttachBtn().should('be.disabled');
77
+
78
+ // When I fill wrong location URL
79
+ AttachRepositorySteps.enterURL("Wrong URL");
80
+
81
+ // Then I expect to see error message
82
+ AttachRepositorySteps.getRemoteLocationDialog().should('contain', 'Note that the location should be a URL that points to a remote Ontopic installation,');
83
+
84
+ // When I clear the wrong URL
85
+ AttachRepositorySteps.clearURL();
86
+
87
+ // Then I expect to see an error message that states the location is required.
88
+ AttachRepositorySteps.getRemoteLocationDialog().should('contain', 'Location URL is required.');
89
+
90
+ // When I fill all mandatory fields
91
+ AttachRepositorySteps.enterURL('http://local');
92
+ AttachRepositorySteps.enterUsername("username");
93
+ AttachRepositorySteps.enterPassword('password');
94
+
95
+ // Then I expect the "Attach" button to be enabled
96
+ AttachRepositorySteps.getAttachBtn().should('be.enabled');
97
+
98
+ // When I click the "Attach" button
99
+ AttachRepositorySteps.attachRemoteLocation();
100
+
101
+ // Then I expect location with URL "http://local" to be created
102
+ RepositorySteps.getSparqlOntopicTable().should('contain', 'http://local');
103
+
104
+ // When delete the created location
105
+ RepositorySteps.deleteOntopicInstance('http://local');
106
+
107
+ // I expect to see deleting confirmation dialog.
108
+ ModalDialogSteps.getDialogBody().should('contain', 'Are you sure you want to detach the location \'http://local\'?');
109
+
110
+ // When I confirm
111
+ ModalDialogSteps.clickOnConfirmButton();
112
+
113
+ // Then I expect the location to be deleted.
114
+ RepositorySteps.getSparqlOntopicTable().should('not.exist');
115
+ });
116
+
117
+ it('Should render different location types in separate tables: error, location with and without repositories', () => {
118
+ RepositoriesStubs.stubRepositories();
119
+ RepositoriesStubs.stubLocations();
120
+ cy.visit('/repository');
121
+ cy.wait('@get-all-repositories');
122
+ RepositorySteps.waitLoader();
123
+ RepositorySteps.waitUntilRepositoriesPageIsLoaded();
124
+
125
+ // When I open the Repositories view that contains all possible kind of locations.
126
+ RepositorySteps.getLocalGraphDBTable().should('exist');
127
+ // Then I expect to see the repositories from location GraphDb instance
128
+ RepositorySteps.getLocalGraphDBTable().contains('test · RUNNING');
129
+ // and a remote GraphDB instance with no repositories in it
130
+ RepositorySteps.getRemoteGraphDBTable().contains('There are no repositories in the current location');
131
+ // and a remote GrapDB instance with repositories
132
+ RepositorySteps.getRemoteGraphDBTable().contains('repository-1716184200859 · RUNNI');
133
+ // and a remote GraphDB instance with error in it
134
+ RepositorySteps.getRemoteGraphDBTable().contains('Cannot connect to location Connect to localhost:7212 [localhost/127.0.0.1] fa');
135
+ // and a remote Ontopic instance
136
+ RepositorySteps.getSparqlOntopicTable().contains('http://local');
137
+ });
138
+
139
+ it('Should edit remote location dialog', () => {
140
+ cy.visit('/repository');
141
+ RepositorySteps.waitLoader();
142
+ RepositorySteps.waitUntilRepositoriesPageIsLoaded();
143
+
144
+ const locationId = 'http://local';
145
+ addRemoteSPARQLLocation(locationId, 'username', 'password');
146
+ RepositorySteps.getLocalGraphDBTable().should('exist');
147
+ // When I click to edit the SPARQL instance
148
+ RepositorySteps.editSparqlInstance(0);
149
+ // Then I expect to see that SPARQL instance is selected
150
+ AttachRepositorySteps.getSparqlEndpointRadioBtn().should('be.checked');
151
+ // And be disabled
152
+ AttachRepositorySteps.getSparqlEndpointRadioBtn().should('be.disabled');
153
+ // The location url be set
154
+ AttachRepositorySteps.getLocationURLInput().should('have.value', locationId);
155
+ // And be disabled for edit
156
+ AttachRepositorySteps.getLocationURLInput().should('be.disabled');
157
+ ModalDialogSteps.close();
158
+ // Then I can remove the new location
159
+ RepositorySteps.deleteSparqlLocation(locationId);
160
+ // When I confirm
161
+ ModalDialogSteps.clickOnConfirmButton();
162
+ });
163
+
164
+ it('Should create and delete SPARQL endpoint instance', () => {
165
+ cy.visit('/repository');
166
+ RepositorySteps.waitLoader();
167
+ RepositorySteps.waitUntilRepositoriesPageIsLoaded();
168
+
169
+ const locationId = 'http://endpoint/repo/ex';
170
+ addRemoteSPARQLLocation(locationId, 'username', 'password');
171
+ // Then the dialog has closed
172
+ ModalDialogSteps.getDialog().should('not.exist');
173
+ // And the SPARQL table should be visible
174
+ RepositorySteps.getSparqlOntopicTable().should('contain', locationId);
175
+ // Then I can remove the new location
176
+ RepositorySteps.deleteSparqlLocation(locationId);
177
+ // When I confirm
178
+ ModalDialogSteps.clickOnConfirmButton();
179
+ // Then the instance should be gone
180
+ RepositorySteps.getSparqlOntopicTable().should('not.exist');
181
+ });
182
+ });
183
+
184
+ function addRemoteSPARQLLocation(url, username, password) {
185
+ // When I open the "Attach a remote instance" dialog.
186
+ AttachRepositorySteps.openAttachRemoteLocationDialog();
187
+ // Then I expect the "Attach" button to be disabled (not clickable), because location URL is mandatory
188
+ AttachRepositorySteps.getAttachBtn().should('be.disabled');
189
+ // And authentication type to be "None". This is default location type.
190
+ AttachRepositorySteps.getRemoteLocationDialog().should('contain', 'No authentication will be used with this location.');
191
+ // I expect GraphDB type be selected
192
+ AttachRepositorySteps.getGraphDBRadioBtn().should('be.checked');
193
+ // When I select SPARQL Endpoint instance
194
+ AttachRepositorySteps.selectSparqlEndpointRadioBtn();
195
+ // When I fill correct URL, username and password
196
+ AttachRepositorySteps.enterURL(url);
197
+ AttachRepositorySteps.enterUsername(username);
198
+ AttachRepositorySteps.enterPassword(password);
199
+ // Then I expect the "Attach" button to be enabled
200
+ AttachRepositorySteps.getAttachBtn().should('be.enabled');
201
+ // And when I attach the location, it should be visible in the list
202
+ AttachRepositorySteps.attachRemoteLocation();
203
+ }