diff --git a/commands.js b/commands.js index d0551021ff30ff2660a645b2d2dcb0445a0c8370..1e4da15eaa50389022497d003d8545aa96a78d19 100644 --- a/commands.js +++ b/commands.js @@ -22,11 +22,13 @@ Cypress.Commands.add('login', (options) => { cy.get('#user-login-form').submit() }) -Cypress.Commands.add('createAndLogin', (username, role) => { +Cypress.Commands.add('createAndLogin', (username, ...roles) => { cy.rememberLatestTaxonomyTerm(); let password = 'random-password-' + Cypress._.random(0, 1e6); cy.drush('user:create ' + username + ' --password=' + password); - cy.drush('user:role:add ' + role + ' ' + username); + roles.forEach(role => { + cy.drush('user:role:add ' + role + ' ' + username); + }) cy.login({ path: 'user/login', username: username,