graphdb-workbench-tests 1.10.1 → 1.10.2

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.
@@ -44,7 +44,7 @@ describe('User and Access', () => {
44
44
  cy.get('@user').find('.edit-user-btn').should('be.visible')
45
45
  .and('not.be.disabled');
46
46
  // And cannot be deleted
47
- cy.get('@user').find('.delete-user-btn').should('not.be.visible');
47
+ cy.get('@user').find('.delete-user-btn').should('not.exist');
48
48
  // Date created should be visible
49
49
  cy.get('@user').find('.date-created').should('be.visible');
50
50
  });
@@ -80,22 +80,26 @@ describe('User and Access', () => {
80
80
  cy.get('.ot-splash').should('not.be.visible');
81
81
  getUsersTable().should('be.visible');
82
82
  //delete repository manager
83
- deleteUser("repo-manager");
84
- //create a custom admin
85
- createUser("second-admin", PASSWORD, ROLE_CUSTOM_ADMIN);
86
- logout();
87
- //login with custom admin
88
- loginWithUser("second-admin", PASSWORD);
89
- cy.url().should('include', '/users');
90
- logout();
91
- //login with admin
92
- loginWithUser("admin", DEFAULT_ADMIN_PASSWORD);
93
- cy.get('.ot-splash').should('not.be.visible');
94
- getUsersTable().should('be.visible');
95
- //delete custom admin
96
- deleteUser("second-admin");
97
- //disable security
98
- getToggleSecuritySwitch().click();
83
+ deleteUser("repo-manager")
84
+ .then(() => {
85
+ //create a custom admin
86
+ createUser("second-admin", PASSWORD, ROLE_CUSTOM_ADMIN);
87
+ logout();
88
+ //login with custom admin
89
+ loginWithUser("second-admin", PASSWORD);
90
+ cy.url().should('include', '/users');
91
+ logout();
92
+ //login with admin
93
+ loginWithUser("admin", DEFAULT_ADMIN_PASSWORD);
94
+ cy.get('.ot-splash').should('not.be.visible');
95
+ getUsersTable().should('be.visible');
96
+ //delete custom admin
97
+ deleteUser("second-admin")
98
+ .then(() => {
99
+ //disable security
100
+ getToggleSecuritySwitch().click();
101
+ });
102
+ });
99
103
  });
100
104
 
101
105
  function getCreateNewUserButton() {
@@ -156,10 +160,19 @@ describe('User and Access', () => {
156
160
  }
157
161
 
158
162
  function deleteUser(username) {
159
- cy.get('#wb-users-userInUsers tr').contains(username).parent().parent().within(() => {
160
- cy.get('.icon-trash').click();
161
- })
162
- cy.get('.confirm-btn').click();
163
+ findUserInTable(username);
164
+ cy.get('@user')
165
+ .should('have.length', 1)
166
+ .within(() => {
167
+ cy.get('.delete-user-btn')
168
+ .as('deleteBtn');
169
+ });
170
+ return cy.waitUntil(() =>
171
+ cy.get('@deleteBtn')
172
+ .then(deleteBtn => deleteBtn && Cypress.dom.isAttached(deleteBtn) && deleteBtn.trigger('click')))
173
+ .then(() => {
174
+ cy.get('.confirm-btn').click();
175
+ });
163
176
  }
164
177
 
165
178
  function loginWithUser(username, password) {
@@ -435,10 +435,11 @@ describe('SPARQL screen validation', () => {
435
435
  verifyResultsPageLength(74);
436
436
 
437
437
  // Uncheck ‘Include inferred’
438
- getInferenceButton()
439
- .click()
440
- .find('.icon-inferred-off')
441
- .should('be.visible');
438
+ cy.waitUntil(() =>
439
+ getInferenceButton()
440
+ .then(infBtn => infBtn && cy.wrap(infBtn).click()))
441
+ .then(() =>
442
+ cy.get('.icon-inferred-off').should('be.visible'));
442
443
 
443
444
  // Confirm that only inferred statements (only 2) are available
444
445
  executeQuery();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "1.10.1",
3
+ "version": "1.10.2",
4
4
  "description": "Cypress tests for GraphDB workbench",
5
5
  "scripts": {
6
6
  "start": "cypress open",
@@ -1,7 +1,7 @@
1
1
  Cypress.Commands.add('pasteQuery', (query) => {
2
2
  clearQuery();
3
3
  // Using force because the textarea is not visible
4
- getQueryTextArea().invoke('val', query).trigger('change', {force: true});
4
+ getQueryTextArea().invoke('val', query).trigger('change', {force: true}).should('have.value', query);
5
5
  waitUntilQueryIsVisible();
6
6
  });
7
7