graphdb-workbench-tests 2.0.0-TR10 → 2.0.0-TR11

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.
@@ -55,7 +55,7 @@ describe('User and Access', () => {
55
55
  cy.get('@user').find('.edit-user-btn').should('be.visible')
56
56
  .and('not.be.disabled');
57
57
  // And cannot be deleted
58
- cy.get('@user').find('.delete-user-btn').should('not.be.visible');
58
+ cy.get('@user').find('.delete-user-btn').should('not.exist');
59
59
  // Date created should be visible
60
60
  cy.get('@user').find('.date-created').should('be.visible');
61
61
  });
@@ -91,22 +91,26 @@ describe('User and Access', () => {
91
91
  cy.get('.ot-splash').should('not.be.visible');
92
92
  getUsersTable().should('be.visible');
93
93
  //delete repository manager
94
- deleteUser("repo-manager");
95
- //create a custom admin
96
- createUser("second-admin", PASSWORD, ROLE_CUSTOM_ADMIN);
97
- logout();
98
- //login with custom admin
99
- loginWithUser("second-admin", PASSWORD);
100
- cy.url().should('include', '/users');
101
- logout();
102
- //login with admin
103
- loginWithUser("admin", DEFAULT_ADMIN_PASSWORD);
104
- cy.get('.ot-splash').should('not.be.visible');
105
- getUsersTable().should('be.visible');
106
- //delete custom admin
107
- deleteUser("second-admin");
108
- //disable security
109
- getToggleSecuritySwitch().click();
94
+ deleteUser("repo-manager")
95
+ .then(() => {
96
+ //create a custom admin
97
+ createUser("second-admin", PASSWORD, ROLE_CUSTOM_ADMIN);
98
+ logout();
99
+ //login with custom admin
100
+ loginWithUser("second-admin", PASSWORD);
101
+ cy.url().should('include', '/users');
102
+ logout();
103
+ //login with admin
104
+ loginWithUser("admin", DEFAULT_ADMIN_PASSWORD);
105
+ cy.get('.ot-splash').should('not.be.visible');
106
+ getUsersTable().should('be.visible');
107
+ //delete custom admin
108
+ deleteUser("second-admin")
109
+ .then(() => {
110
+ //disable security
111
+ getToggleSecuritySwitch().click();
112
+ });
113
+ });
110
114
  });
111
115
  it('Warn users when setting no password when creating new user admin', () => {
112
116
  getUsersTable().should('be.visible');
@@ -188,10 +192,19 @@ describe('User and Access', () => {
188
192
  }
189
193
 
190
194
  function deleteUser(username) {
191
- cy.get('#wb-users-userInUsers tr').contains(username).parent().parent().within(() => {
192
- cy.get('.icon-trash').click();
193
- });
194
- cy.get('.confirm-btn').click();
195
+ findUserInTable(username);
196
+ cy.get('@user')
197
+ .should('have.length', 1)
198
+ .within(() => {
199
+ cy.get('.delete-user-btn')
200
+ .as('deleteBtn');
201
+ });
202
+ return cy.waitUntil(() =>
203
+ cy.get('@deleteBtn')
204
+ .then(deleteBtn => deleteBtn && Cypress.dom.isAttached(deleteBtn) && deleteBtn.trigger('click')))
205
+ .then(() => {
206
+ cy.get('.confirm-btn').click();
207
+ });
195
208
  }
196
209
 
197
210
  function loginWithUser(username, password) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphdb-workbench-tests",
3
- "version": "2.0.0-TR10",
3
+ "version": "2.0.0-TR11",
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
 
@@ -53,7 +53,7 @@ function getQueryTextArea() {
53
53
  }
54
54
 
55
55
  function waitUntilQueryIsVisible() {
56
- cy.waitUntil(() =>
56
+ return cy.waitUntil(() =>
57
57
  getQueryArea()
58
58
  .then(codeMirrorEl =>
59
59
  codeMirrorEl && codeMirrorEl[0].CodeMirror.getValue().trim().length > 0));