graphdb-workbench-tests 2.0.0-TR7 → 2.0.0

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.
@@ -43,7 +43,7 @@ describe('Similarity screen validation', () => {
43
43
 
44
44
  context('Creating similarity index', () => {
45
45
  beforeEach(() => {
46
- initRepositoryAndVisitSimilarityView()
46
+ initRepositoryAndVisitSimilarityView();
47
47
  });
48
48
 
49
49
  it('Create default text similarity index and view SPARQL query', () => {
@@ -93,7 +93,7 @@ describe('Similarity screen validation', () => {
93
93
 
94
94
  context('Index operations', () => {
95
95
  beforeEach(() => {
96
- initRepositoryAndVisitSimilarityView()
96
+ initRepositoryAndVisitSimilarityView();
97
97
  });
98
98
 
99
99
  it('Change Data query in Create index', () => {
@@ -156,7 +156,7 @@ describe('Similarity screen validation', () => {
156
156
 
157
157
  context('Searching in index', () => {
158
158
  beforeEach(() => {
159
- initRepositoryAndVisitSimilarityView()
159
+ initRepositoryAndVisitSimilarityView();
160
160
  });
161
161
 
162
162
  it('Search for entity in index', () => {
@@ -56,8 +56,8 @@ describe('Visual graph screen validation', () => {
56
56
  getSearchField().should('be.visible').type('.invalid_resource');
57
57
  // There are two buttons rendered in the DOM where one of them is hidden. We need the visible one.
58
58
  cy.get('.autocomplete-visual-btn:visible').click();
59
- // Verify that an "Invalid URI" message is displayed
60
- cy.get('#toast-container').should('contain', 'Invalid URI');
59
+ // Verify that an "Invalid IRI" message is displayed
60
+ cy.get('#toast-container').should('contain', 'Invalid IRI');
61
61
  });
62
62
 
63
63
  it('Test search for a valid resource', () => {
@@ -108,6 +108,36 @@ describe('Visual graph screen validation', () => {
108
108
  });
109
109
  });
110
110
 
111
+ it('Test invalid links limit should show error to user ', () => {
112
+ searchForResource(VALID_RESOURCE);
113
+ openVisualGraphSettings();
114
+
115
+ cy.get('.filter-sidepanel').as('sidepanel').should('be.visible').within(() => {
116
+ // Verify that the default settings are as follows:
117
+ // Maximum links to show: 20
118
+ getLinksNumberField().and('have.value', '20');
119
+ // Update default 20
120
+ updateLinksLimitField('1001')
121
+ .then(() => {
122
+ // Try to put invalid value such as 1001
123
+ cy.get('.idError')
124
+ .should('be.visible')
125
+ .and('contain.text', 'Invalid links limit');
126
+ });
127
+ // Try to save the invalid value
128
+ getSaveSettingsButton().and('not.be.disabled')
129
+ .click();
130
+ // Then reset to default settings
131
+ getResetSettingsButton().and('not.be.disabled')
132
+ .click()
133
+ .then(() => {
134
+ getLinksNumberField().and('have.value', '20');
135
+ cy.get('.idError')
136
+ .should('not.exist');
137
+ });
138
+ });
139
+ });
140
+
111
141
  it('Test search for a valid resource with links', () => {
112
142
  searchForResource(VALID_RESOURCE);
113
143
  // Check include inferred
@@ -269,14 +299,14 @@ describe('Visual graph screen validation', () => {
269
299
 
270
300
  openVisualGraphSettings();
271
301
  // Set maximum links to 2
272
- getLinksNumberField().clear().type('2');
302
+ updateLinksLimitField('2');
273
303
  saveSettings();
274
304
  // Verify that the diagram is updated
275
305
  getPredicates().should('have.length', 2);
276
306
 
277
307
  openVisualGraphSettings();
278
308
  // Set maximum links to 100
279
- getLinksNumberField().clear().type('100');
309
+ updateLinksLimitField('100');
280
310
  saveSettings();
281
311
  // Verify that the diagram is updated
282
312
  getPredicates().should('have.length', 36);
@@ -333,11 +363,10 @@ describe('Visual graph screen validation', () => {
333
363
  getNodes().and('contain', 'Zinfandel');
334
364
 
335
365
  openVisualGraphSettings();
336
- // Go to Settings and set "vin:Zinfandel" as an ignored type
337
- getIgnoredTypesField().clear().type('vin:Zinfandel');
338
-
339
366
  // Set the connections limit to 10
340
- getLinksNumberField().clear().type('10');
367
+ updateLinksLimitField('10');
368
+ // Go to Settings and set "vin:Zinfandel" as an ignored type
369
+ getIgnoredTypesField().clear().type('vin:Zinfandel').type('{enter}');
341
370
 
342
371
  saveSettings();
343
372
  // Verify that "vin:Zinfandel" has been removed from the diagram
@@ -370,11 +399,12 @@ describe('Visual graph screen validation', () => {
370
399
  openVisualGraphSettings();
371
400
  // Go to predicates tab
372
401
  openPredicatesTab();
373
- // Set "vin:hasSugar" as an ignored predicate
374
- getIgnoredPredicatesField().clear().type('vin:hasSugar');
375
402
 
376
403
  // Set the connections limit to 10
377
- getLinksNumberField().clear().type('10');
404
+ updateLinksLimitField('10');
405
+ // Set "vin:hasSugar" as an ignored predicate
406
+ getIgnoredPredicatesField().clear().type('vin:hasSugar').type('{enter}');
407
+
378
408
  saveSettings();
379
409
 
380
410
  // Verify that "vin:hasSugar" has been removed from the diagram
@@ -388,7 +418,7 @@ describe('Visual graph screen validation', () => {
388
418
  openVisualGraphSettings();
389
419
  // Verify that the default settings are as follows:
390
420
  // Maximum links to show: 20
391
- getLinksNumberField().clear().type('10')
421
+ updateLinksLimitField('10')
392
422
  .should('have.value', '10');
393
423
  // Preferred lang: en
394
424
  cy.get('.preferred-languages .tag-item').should('have.length', 1)
@@ -677,4 +707,8 @@ describe('Visual graph screen validation', () => {
677
707
  cy.get('.modal-footer .confirm-btn').click();
678
708
  cy.get('.modal').should('not.exist');
679
709
  }
710
+
711
+ function updateLinksLimitField(value) {
712
+ return getLinksNumberField().invoke('val', value).trigger('change', {force: true});
713
+ }
680
714
  });
@@ -35,7 +35,7 @@ describe('Help / REST API', () => {
35
35
  verifyControllerListIsCollapsed(getRDF4JAPI());
36
36
 
37
37
  // Examine the import controller
38
- verifyControllerOptions('repositories', 'Repository management');
38
+ verifyControllerOptions('repository-management-controller', 'Repository management');
39
39
  });
40
40
 
41
41
  function getSwaggerFrame() {
@@ -0,0 +1,45 @@
1
+ import HomeSteps from '../../steps/home-steps';
2
+ import SparqlSteps from '../../steps/sparql-steps';
3
+
4
+ describe('Home screen language validation', () => {
5
+ let repositoryId;
6
+
7
+ beforeEach(() => {
8
+ HomeSteps.visitAndWaitLoader();
9
+ repositoryId = '23repo' + Date.now();
10
+ });
11
+
12
+ afterEach(() => {
13
+ cy.deleteRepository(repositoryId);
14
+
15
+ // Change the language back to English
16
+ SparqlSteps.changeLanguage('en');
17
+ });
18
+
19
+ context('Language change label checks', () => {
20
+ it('Default language should be active and language change should affect labels', () => {
21
+ cy.createRepository({id: repositoryId});
22
+ cy.initializeRepository(repositoryId);
23
+ cy.enableAutocomplete(repositoryId);
24
+ cy.presetRepository(repositoryId);
25
+
26
+ HomeSteps.declineTutorial();
27
+
28
+ // When I visit home page with selected repository
29
+ HomeSteps.visitAndWaitLoader();
30
+ // Check some labels are in default language
31
+ HomeSteps.getViewResourceAsLabel().should('have.text', 'View resource');
32
+ HomeSteps.getActiveRepoAsLabel().should('have.text', 'Active repository');
33
+ HomeSteps.getSavedSparqlQueriesAsLabel().should('have.text', 'Saved SPARQL queries');
34
+ HomeSteps.getLicenseAsLabel().should('have.text', 'License');
35
+
36
+ SparqlSteps.changeLanguage('fr');
37
+
38
+ // The text in the labels should change
39
+ HomeSteps.getViewResourceAsLabel().should('have.text', 'Voir la ressource');
40
+ HomeSteps.getActiveRepoAsLabel().should('have.text', 'Répertoire actif');
41
+ HomeSteps.getSavedSparqlQueriesAsLabel().should('have.text', 'Requêtes SPARQL sauvegardées');
42
+ HomeSteps.getLicenseAsLabel().should('have.text', 'Licence');
43
+ });
44
+ });
45
+ })
@@ -11,7 +11,9 @@ describe('Home screen validation', () => {
11
11
  'foaf:name "Green Goblin" .\n';
12
12
  const GOBLIN_URI = 'http://example.org/#green-goblin';
13
13
 
14
- beforeEach(() => cy.viewport(1280, 1000));
14
+ beforeEach(() => {
15
+ cy.viewport(1280, 1000);
16
+ });
15
17
 
16
18
  context('RDF resource search', () => {
17
19
  it('Search button should not be present when no repo is selected', () => {
@@ -281,6 +283,19 @@ describe('Home screen validation', () => {
281
283
  });
282
284
  });
283
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
+
284
299
  function getRDFResourceSearchBox() {
285
300
  return cy.get('rdf-resource-search').should('be.visible');
286
301
  }
@@ -36,10 +36,16 @@ describe('Repositories', () => {
36
36
  " ex:age 12.1 ;\n" +
37
37
  ".";
38
38
 
39
+ const GDB_REPOSITORY_TYPE = 'gdb';
40
+ const REPO_LIST_ID = '#wb-repositories-repositoryInGetRepositories';
41
+
39
42
  beforeEach(() => {
40
43
  repositoryId = 'repo-' + Date.now();
44
+ cy.intercept('/rest/locations').as('getLocations');
41
45
 
42
46
  cy.visit('/repository');
47
+ waitLoader();
48
+ cy.wait('@getLocations');
43
49
  cy.window();
44
50
 
45
51
  waitUntilRepositoriesPageIsLoaded();
@@ -57,16 +63,29 @@ describe('Repositories', () => {
57
63
  getCreateRepositoryButton().should('be.visible').and('not.be.disabled');
58
64
  }
59
65
 
66
+ it('create repository page should list available repository types options', () => {
67
+ let expectedRepoTypes = ['GraphDB Repository', 'Ontop Virtual SPARQL', 'FedX Virtual SPARQL'];
68
+ createRepository();
69
+ cy.url().should('include', '/repository/create');
70
+
71
+ cy.get('.create-buttons')
72
+ .find('.repo-type')
73
+ .should('have.length', 3)
74
+ .then((repoTypes) => {
75
+ repoTypes.each(($index, $repoType) => {
76
+ expect($repoType.innerText).to.equal(expectedRepoTypes[$index]);
77
+ });
78
+ });
79
+ });
80
+
60
81
  it('should allow creation of repositories with default settings', () => {
61
82
  // There should be a default repository location
62
- getLocationsList()
63
- .should('have.length', 1)
64
- .and('contain', 'Local');
83
+ getLocationsList();
65
84
 
66
85
  createRepository();
67
86
  cy.url().should('include', '/repository/create');
68
87
 
69
- chooseRepositoryType();
88
+ chooseRepositoryType(GDB_REPOSITORY_TYPE);
70
89
  cy.url().should('include', '/repository/create/');
71
90
 
72
91
  // Create a repository by supplying only an identifier
@@ -136,7 +155,7 @@ describe('Repositories', () => {
136
155
 
137
156
  it('should disallow creation of repositories without mandatory settings', () => {
138
157
  createRepository();
139
- chooseRepositoryType();
158
+ chooseRepositoryType(GDB_REPOSITORY_TYPE);
140
159
  cy.url().should('include', '/repository/create/');
141
160
 
142
161
  saveRepository();
@@ -154,7 +173,7 @@ describe('Repositories', () => {
154
173
  const repoTitle = 'Repo title for ' + repositoryId;
155
174
 
156
175
  createRepository();
157
- chooseRepositoryType();
176
+ chooseRepositoryType(GDB_REPOSITORY_TYPE);
158
177
  cy.url().should('include', '/repository/create/');
159
178
 
160
179
  getRepositoryIdField().type(repositoryId);
@@ -201,14 +220,15 @@ describe('Repositories', () => {
201
220
  it('should allow to switch between repositories', () => {
202
221
  const secondRepoId = 'second-repo-' + Date.now();
203
222
  createRepository();
204
- chooseRepositoryType();
223
+ chooseRepositoryType(GDB_REPOSITORY_TYPE);
205
224
  cy.url().should('include', '/repository/create/');
206
225
 
207
226
  typeRepositoryId(repositoryId);
208
227
  saveRepository();
228
+ cy.wait('@getLocations');
209
229
 
210
230
  createRepository();
211
- chooseRepositoryType();
231
+ chooseRepositoryType(GDB_REPOSITORY_TYPE);
212
232
  cy.url().should('include', '/repository/create/');
213
233
 
214
234
  typeRepositoryId(secondRepoId);
@@ -259,6 +279,7 @@ describe('Repositories', () => {
259
279
  // The currently selected repository is kept in local storage
260
280
  cy.visit('/repository');
261
281
  cy.window();
282
+
262
283
  // Should automatically select the default repository
263
284
  getRepositoriesDropdown()
264
285
  .find('.active-repository')
@@ -274,13 +295,13 @@ describe('Repositories', () => {
274
295
  const newTitle = 'Title edit';
275
296
 
276
297
  createRepository();
277
- chooseRepositoryType();
298
+ chooseRepositoryType(GDB_REPOSITORY_TYPE);
278
299
  cy.url().should('include', '/repository/create/');
279
300
 
280
301
  typeRepositoryId(repositoryId);
281
302
  typeRepositoryTitle('Title');
282
303
  saveRepository();
283
-
304
+ cy.wait('@getLocations');
284
305
  editRepository(repositoryId);
285
306
 
286
307
  // Some fields should be disabled
@@ -290,10 +311,13 @@ describe('Repositories', () => {
290
311
  typeRepositoryTitle(newTitle);
291
312
  getRepositoryContextIndexCheckbox().check();
292
313
 
293
- getSaveRepositoryButton().click();
294
- confirmModal();
295
- waitLoader();
296
-
314
+ getSaveRepositoryButton()
315
+ .click()
316
+ .then(() => {
317
+ confirmModal();
318
+ waitLoader();
319
+ });
320
+ cy.wait('@getLocations');
297
321
  // See the title is rendered in the repositories list
298
322
  getRepositoryFromList(repositoryId).should('contain', newTitle);
299
323
 
@@ -306,12 +330,12 @@ describe('Repositories', () => {
306
330
 
307
331
  it('should allow to delete existing repository', () => {
308
332
  createRepository();
309
- chooseRepositoryType();
333
+ chooseRepositoryType(GDB_REPOSITORY_TYPE);
310
334
  cy.url().should('include', '/repository/create/');
311
335
 
312
336
  typeRepositoryId(repositoryId);
313
337
  saveRepository();
314
-
338
+ cy.wait('@getLocations');
315
339
  selectRepoFromDropdown(repositoryId);
316
340
 
317
341
  getRepositoryFromList(repositoryId)
@@ -323,7 +347,7 @@ describe('Repositories', () => {
323
347
 
324
348
  confirmModal();
325
349
 
326
- getRepositoriesList().should('not.contain', repositoryId);
350
+ getRepositoriesList().should('not.exist');
327
351
 
328
352
  // Check the repo has been deselected and is not present in the repo dropdown menu
329
353
  getRepositoriesDropdown().click().within(() => {
@@ -354,7 +378,7 @@ describe('Repositories', () => {
354
378
  let obdaFileUpload = '';
355
379
  let ontologyFileUpload = '';
356
380
  let propertiesFileUpload = '';
357
- const url = 'http://localhost:9000/rest/repositories/uploadFile';
381
+ const url = 'http://localhost:9000/rest/repositories/file/upload';
358
382
  const fileType = '';
359
383
  const virtualRepoName = 'virtual-repo-' + Date.now();
360
384
 
@@ -362,7 +386,7 @@ describe('Repositories', () => {
362
386
  cy.fixture('ontop/university-complete.obda', 'binary').then((file) => {
363
387
  Cypress.Blob.binaryStringToBlob(file, fileType).then((blob) => {
364
388
  const formData = new FormData();
365
- formData.set('uploadFile', blob, 'university-complete.obda');
389
+ formData.set('file', blob, 'university-complete.obda');
366
390
 
367
391
  cy.form_request(url, formData).then(response => {
368
392
  return obdaFileUpload = response.response.body.fileLocation;
@@ -373,7 +397,7 @@ describe('Repositories', () => {
373
397
  cy.fixture('ontop/university-complete.ttl', 'binary').then((file) => {
374
398
  Cypress.Blob.binaryStringToBlob(file, fileType).then((blob) => {
375
399
  const formData = new FormData();
376
- formData.set('uploadFile', blob, 'university-complete.ttl');
400
+ formData.set('file', blob, 'university-complete.ttl');
377
401
 
378
402
  cy.form_request(url, formData).then(response => {
379
403
  return ontologyFileUpload = response.response.body.fileLocation;
@@ -384,7 +408,7 @@ describe('Repositories', () => {
384
408
  cy.fixture('ontop/university-complete.properties', 'binary').then((file) => {
385
409
  Cypress.Blob.binaryStringToBlob(file, fileType).then((blob) => {
386
410
  const formData = new FormData();
387
- formData.set('uploadFile', blob, 'university-complete.properties');
411
+ formData.set('file', blob, 'university-complete.properties');
388
412
 
389
413
  cy.form_request(url, formData).then(response => {
390
414
  return propertiesFileUpload = response.response.body.fileLocation;
@@ -477,9 +501,7 @@ describe('Repositories', () => {
477
501
 
478
502
  it('should verify different virtual repository RDBMS provider elements', () => {
479
503
  // There should be a default repository location
480
- getLocationsList()
481
- .should('have.length', 1)
482
- .and('contain', 'Local');
504
+ getLocationsList();
483
505
 
484
506
  createRepository();
485
507
  cy.url().should('include', '/repository/create');
@@ -593,7 +615,7 @@ describe('Repositories', () => {
593
615
  it('should restart an existing repository', () => {
594
616
 
595
617
  createRepository();
596
- chooseRepositoryType();
618
+ chooseRepositoryType(GDB_REPOSITORY_TYPE);
597
619
 
598
620
  cy.url().should('include', '/repository/create');
599
621
 
@@ -659,7 +681,7 @@ describe('Repositories', () => {
659
681
  it('should create SHACL repo and test shapes validation', () => {
660
682
  //Prepare repository by enabling SHACL
661
683
  createRepository();
662
- chooseRepositoryType();
684
+ chooseRepositoryType(GDB_REPOSITORY_TYPE);
663
685
  cy.url().should('include', '/repository/create/');
664
686
  typeRepositoryId(repositoryId);
665
687
  getSHACLRepositoryCheckbox().check();
@@ -702,17 +724,20 @@ describe('Repositories', () => {
702
724
  .then($el => $el && $el.text() === status));
703
725
  }
704
726
 
705
- const REPO_LIST_ID = '#wb-repositories-repositoryInGetRepositories';
706
-
707
727
  function getRepositoriesList() {
708
728
  return cy.get(REPO_LIST_ID);
709
729
  }
710
730
 
711
731
  function getLocationsList() {
712
- return cy.get('.locations-table tr');
732
+ return cy.get('#wb-locations-locationInGetLocations')
733
+ .find('tr.location')
734
+ .should('have.length', 1)
735
+ .and('contain', 'Repositories from: ')
736
+ .and('contain', 'Local');
713
737
  }
714
738
 
715
739
  function getRepositoryFromList(repository) {
740
+ waitLoader();
716
741
  return getRepositoriesList()
717
742
  .find('.repository')
718
743
  .contains(repository)
@@ -29,18 +29,21 @@ describe('Setup / Connectors - Lucene', () => {
29
29
  it('Create, copy and delete a lucene connector', () => {
30
30
  getNewLuceneConnectorButton()
31
31
  .click();
32
+
32
33
  getCreateLuceneConnectorPage()
33
- .should('be.visible')
34
- .and('contain', 'Create new Lucene Connector');
35
- getConnectorNameField()
36
- .type(luceneConnectorName);
37
- getFieldNameField()
38
- .type(fieldName, {force:true});
39
- getPropertyChainField()
40
- .type(connectorPropertyChain, {force:true});
41
- getUriTypes()
42
- .type(uriType);
43
- confirmCreateConnector();
34
+ .should('contain', 'Create new Lucene Connector')
35
+ .within(() => {
36
+ getConnectorNameField()
37
+ .type(luceneConnectorName);
38
+ getFieldNameField()
39
+ .type(fieldName, {force: true});
40
+ getPropertyChainField()
41
+ .type(connectorPropertyChain, {force: true});
42
+ getUriTypes()
43
+ .type(uriType);
44
+ confirmCreateConnector();
45
+ });
46
+
44
47
  verifyStatusToastMessage(connectorCreateToastMessage);
45
48
  verifyConnectorExists(luceneConnectorName);
46
49
  //copy connector
@@ -49,7 +52,10 @@ describe('Setup / Connectors - Lucene', () => {
49
52
  .should('be.visible')
50
53
  .click()
51
54
  .then(() => {
52
- confirmCreateConnector();
55
+ getCreateLuceneConnectorPage()
56
+ .within(() => {
57
+ confirmCreateConnector();
58
+ });
53
59
  verifyStatusToastMessage(connectorCreateToastMessage + '-copy');
54
60
  verifyConnectorExists(luceneConnectorName + '-copy');
55
61
  //delete connector copy
@@ -59,9 +65,11 @@ describe('Setup / Connectors - Lucene', () => {
59
65
  .click();
60
66
  getConfirmConnectorDeletebutton()
61
67
  .should('be.visible')
62
- .click();
63
- verifyStatusToastMessage(connectorDeleteToastMessage + '-copy');
64
- });
68
+ .click()
69
+ .then(() => {
70
+ verifyStatusToastMessage(connectorDeleteToastMessage + '-copy');
71
+ });
72
+ });
65
73
  });
66
74
 
67
75
  function getConnectorsPage() {
@@ -73,35 +81,32 @@ describe('Setup / Connectors - Lucene', () => {
73
81
  }
74
82
 
75
83
  function getCreateLuceneConnectorPage() {
76
- return cy.get('.modal-content').should('be.visible');
84
+ return cy.get('.modal-content').scrollIntoView().should('be.visible');
77
85
  }
78
86
 
79
87
  function getConnectorNameField() {
80
- return getCreateLuceneConnectorPage().find('.connector-name-field input');
88
+ return cy.get('.connector-name-field input');
81
89
  }
82
90
 
83
91
  function getFieldNameField() {
84
- return getCreateLuceneConnectorPage().find('.child-property-fieldName input');
92
+ return cy.get('.child-property-fieldName input');
85
93
  }
86
94
 
87
95
  function getPropertyChainField() {
88
- return getCreateLuceneConnectorPage().find('.child-property-propertyChain input');
96
+ return cy.get('.child-property-propertyChain input');
89
97
  }
90
98
 
91
99
  function getUriTypes() {
92
- return getCreateLuceneConnectorPage().find('.property-types input');
100
+ return cy.get('.property-types input');
93
101
  }
94
102
 
95
103
  function confirmCreateConnector() {
96
- getCreateLuceneConnectorPage()
97
- .within(() => {
98
- cy.get('.create-connector-btn')
99
- .scrollIntoView()
100
- .should('be.visible')
101
- .then((btn) => {
102
- cy.wrap(btn).click();
103
- });
104
- });
104
+ cy.get('.create-connector-btn')
105
+ .scrollIntoView()
106
+ .should('be.visible')
107
+ .then((btn) => {
108
+ cy.wrap(btn).click();
109
+ });
105
110
  }
106
111
 
107
112
  function verifyConnectorExists(connectorName) {
@@ -133,6 +138,6 @@ describe('Setup / Connectors - Lucene', () => {
133
138
  */
134
139
  function hideToastContainer() {
135
140
  cy.get('.toast-success')
136
- .then(toastContainer => toastContainer.hide());
141
+ .then(toastContainer => toastContainer && toastContainer.remove());
137
142
  }
138
143
  });
@@ -222,6 +222,23 @@ describe('My Settings', () => {
222
222
  });
223
223
  });
224
224
 
225
+ it('Saving administrator credentials with checked unset password should show modal window to warn user about' +
226
+ ' unsetting the' +
227
+ ' password', () => {
228
+ // User role is administrator
229
+ cy.get('#noPassword:checkbox').check()
230
+ .then(() => {
231
+ cy.get('#noPassword:checkbox')
232
+ .should('be.checked');
233
+ });
234
+ getSaveButton().click()
235
+ .then(() => {
236
+ cy.get('.modal-dialog').find('.lead').contains('If you unset the password and then enable security,' +
237
+ ' this administrator will not be able to log into GraphDB through the workbench.');
238
+ }
239
+ )
240
+ });
241
+
225
242
  function getUserRepositoryTable() {
226
243
  return cy.get('.user-repositories .table');
227
244
  }
@@ -0,0 +1,69 @@
1
+ describe('Plugins', () => {
2
+
3
+ let repositoryId;
4
+
5
+ function createRepository() {
6
+ repositoryId = 'plugin-' + Date.now();
7
+ cy.createRepository({id: repositoryId});
8
+ cy.presetRepository(repositoryId);
9
+ cy.initializeRepository(repositoryId);
10
+ }
11
+
12
+ function waitUntilPluginsPageIsLoaded() {
13
+ // Workbench loading screen should not be visible
14
+ cy.get('.ot-splash').should('not.be.visible');
15
+
16
+ // No active loader
17
+ cy.get('.ot-loader').should('not.exist');
18
+ }
19
+
20
+ beforeEach(() => {
21
+ createRepository();
22
+ cy.visit('/plugins');
23
+ cy.window();
24
+ waitUntilPluginsPageIsLoaded();
25
+ });
26
+
27
+ afterEach(() => {
28
+ cy.visit('/plugins');
29
+ cy.window();
30
+ // re-enable historyplugin
31
+ getPluginsHeader()
32
+ .should('be.visible').parent().within(() => {
33
+ cy.get('.switch').then((elem) => {
34
+ var value = elem.val();
35
+ if (!value.checked) {
36
+ getPluginsSwitch().click();
37
+ }
38
+ });
39
+ });
40
+ cy.deleteRepository(repositoryId);
41
+ });
42
+
43
+ it('should allow to enable and disable the plugins', () => {
44
+ // Verify initial status is ON
45
+ getPluginsHeader()
46
+ .should('be.visible').parent().within(() => {
47
+ cy.get('.tag-primary')
48
+ .contains('ON');
49
+
50
+ cy.get('.switch').should('be.checked');
51
+ getPluginsSwitch().click();
52
+ });
53
+ cy.visit('/plugins');
54
+ cy.window();
55
+
56
+ getPluginsHeader()
57
+ .should('be.visible').parent().within(() => {
58
+ cy.get('.switch').should('not.be.checked');
59
+ });
60
+ });
61
+
62
+ function getPluginsHeader() {
63
+ return cy.get('.plugins-header').contains("history");
64
+ }
65
+
66
+ function getPluginsSwitch() {
67
+ return cy.get('.plugins-switch');
68
+ }
69
+ });