graphdb-workbench-tests 2.0.0-TR8 → 2.0.0-TR9

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.
@@ -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
  });
@@ -222,7 +222,8 @@ describe('My Settings', () => {
222
222
  });
223
223
  });
224
224
 
225
- it('Saving user credentials with checked unset password should show modal window to warn user about unsetting the' +
225
+ it('Saving administrator credentials with checked unset password should show modal window to warn user about' +
226
+ ' unsetting the' +
226
227
  ' password', () => {
227
228
  // User role is administrator
228
229
  cy.get('#noPassword:checkbox').check()
@@ -233,7 +234,7 @@ describe('My Settings', () => {
233
234
  getSaveButton().click()
234
235
  .then(() => {
235
236
  cy.get('.modal-dialog').find('.lead').contains('If you unset the password and then enable security,' +
236
- ' that user will not be able to log into GraphDB through the workbench.');
237
+ ' this administrator will not be able to log into GraphDB through the workbench.');
237
238
  }
238
239
  )
239
240
  });
@@ -22,6 +22,17 @@ describe('User and Access', () => {
22
22
  });
23
23
 
24
24
  after(() => {
25
+ cy.visit('/users');
26
+ getUsersTable().should('be.visible');
27
+ cy.get('#wb-users-userInUsers tr').then((table) => {
28
+ cy.get('table > tbody > tr').each(($el, index, $list) => {
29
+ getUsersTable().should('be.visible');
30
+ const username = $el.find('.username').text();
31
+ if (username !=='admin') {
32
+ deleteUser(username);
33
+ }
34
+ });
35
+ });
25
36
  cy.deleteRepository(repositoryId);
26
37
  });
27
38
 
@@ -93,10 +104,17 @@ describe('User and Access', () => {
93
104
  cy.get('.ot-splash').should('not.be.visible');
94
105
  getUsersTable().should('be.visible');
95
106
  //delete custom admin
96
- deleteUser("second-admin");
107
+ deleteUser("second-admin");
97
108
  //disable security
98
109
  getToggleSecuritySwitch().click();
99
110
  });
111
+ it('Warn users when setting no password when creating new user admin', () => {
112
+ getUsersTable().should('be.visible');
113
+ createUser("adminWithNoPassword", PASSWORD, ROLE_CUSTOM_ADMIN);
114
+ getUsersTable().should('be.visible');
115
+ cy.get('.ot-splash').should('not.be.visible');
116
+ deleteUser("adminWithNoPassword");
117
+ });
100
118
 
101
119
  function getCreateNewUserButton() {
102
120
  return cy.get('#wb-users-userCreateLink');
@@ -145,25 +163,39 @@ describe('User and Access', () => {
145
163
  getPasswordField().type(password);
146
164
  getConfirmPasswordField().type(password);
147
165
  getRoleRadioButton(role).click();
148
- if(role === "#roleUser") {
166
+ if (role === "#roleUser") {
149
167
  getRepoitoryRightsList().contains('Any data repository').nextUntil('.write').within(() => {
150
168
  cy.get('.write').click();
151
169
  });
170
+ getConfirmUserCreateButton().click();
171
+ } else if (role === "#roleAdmin" && username === "adminWithNoPassword") {
172
+ cy.get('#noPassword:checkbox').check()
173
+ .then(() => {
174
+ cy.get('#noPassword:checkbox')
175
+ .should('be.checked');
176
+ });
177
+ getConfirmUserCreateButton().click()
178
+ .then(() => {
179
+ cy.get('.modal-dialog').find('.lead').contains('If the password is unset and security is enabled, this administrator will not be ' +
180
+ 'able to log into GraphDB through the workbench. Are you sure that you want to continue?');
181
+ cy.get('.modal-dialog').find('.confirm-btn').click();
182
+ });
183
+ } else {
184
+ getConfirmUserCreateButton().click();
152
185
  }
153
- getConfirmUserCreateButton().click();
154
186
  cy.get('.ot-splash').should('not.be.visible');
155
- getUsersTable().should('contain',username);
187
+ getUsersTable().should('contain', username);
156
188
  }
157
189
 
158
190
  function deleteUser(username) {
159
191
  cy.get('#wb-users-userInUsers tr').contains(username).parent().parent().within(() => {
160
192
  cy.get('.icon-trash').click();
161
- })
193
+ });
162
194
  cy.get('.confirm-btn').click();
163
195
  }
164
196
 
165
197
  function loginWithUser(username, password) {
166
- cy.get('#wb-login-username').type(username)
198
+ cy.get('#wb-login-username').type(username);
167
199
  cy.get('#wb-login-password').type(password);
168
200
  cy.get('#wb-login-submitLogin').click();
169
201
  }
@@ -437,7 +437,7 @@ describe('SPARQL screen validation', () => {
437
437
  // Uncheck ‘Include inferred’
438
438
  cy.waitUntil(() =>
439
439
  getInferenceButton()
440
- .then(infBtn => infBtn && !infBtn.attr('disabled') && cy.wrap(infBtn).click()))
440
+ .then(infBtn => infBtn && cy.wrap(infBtn).click()))
441
441
  .then(() =>
442
442
  cy.get('.icon-inferred-off').should('be.visible'));
443
443
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "2.0.0-TR8",
3
+ "version": "2.0.0-TR9",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "scripts": {
6
6
  "start": "cypress open",