Skip to content
Snippets Groups Projects
Commit f90eef9a authored by jurgenhaas's avatar jurgenhaas
Browse files

Fix async custom command

parent 1906ee2f
No related branches found
No related tags found
No related merge requests found
Pipeline #1346913 passed
......@@ -22,11 +22,8 @@ Cypress.Commands.add('login', (options) => {
cy.get('#user-login-form').submit()
})
let password = '';
Cypress.Commands.add('createDrupalUser', (username, roles) => {
Cypress.Commands.add('createDrupalUser', (username, password, roles) => {
cy.rememberLatestTaxonomyTerm();
password = 'random-password-' + Cypress._.random(0, 1e6);
cy.drush('user:create ' + username + ' --password=' + password);
roles.split(',').forEach(role => {
cy.drush('user:role:add ' + role + ' ' + username);
......@@ -34,7 +31,8 @@ Cypress.Commands.add('createDrupalUser', (username, roles) => {
})
Cypress.Commands.add('createAndLogin', (username, role) => {
cy.createDrupalUser(username, role);
let password = 'random-password-' + Cypress._.random(0, 1e6);
cy.createDrupalUser(username, password, role);
cy.login({
path: 'user/login',
username: username,
......@@ -43,7 +41,8 @@ Cypress.Commands.add('createAndLogin', (username, role) => {
})
Cypress.Commands.add('createAndLoginDrush', (username, role) => {
cy.createDrupalUser(username, role);
let password = 'random-password-' + Cypress._.random(0, 1e6);
cy.createDrupalUser(username, password, role);
cy.drush('uli --uri ' + Cypress.config('baseUrl') + ' --name ' + username).then((result) => {
cy.visit(result.stdout);
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment