From 1b76c8f0cf9a9a919a63399ae87fb225d6506769 Mon Sep 17 00:00:00 2001 From: blockerabot Date: Sun, 17 Nov 2024 11:06:24 +0000 Subject: [PATCH] Sync shared packages from blockera-pro --- packages/dev-cypress/js/support/commands.js | 6 ++++++ packages/dev-cypress/js/support/e2e.js | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/dev-cypress/js/support/commands.js b/packages/dev-cypress/js/support/commands.js index 88868ed9b..06f989469 100644 --- a/packages/dev-cypress/js/support/commands.js +++ b/packages/dev-cypress/js/support/commands.js @@ -676,4 +676,10 @@ export const registerCommands = () => { }); }); }); + + Cypress.Commands.add('openRepeaterItem', (parentContainer, contains) => { + cy.getParentContainer(parentContainer).within(() => { + cy.getByDataCy('group-control-header').contains(contains).click(); + }); + }); }; diff --git a/packages/dev-cypress/js/support/e2e.js b/packages/dev-cypress/js/support/e2e.js index 45030c5f8..476a25dd4 100644 --- a/packages/dev-cypress/js/support/e2e.js +++ b/packages/dev-cypress/js/support/e2e.js @@ -44,15 +44,19 @@ Cypress.Commands.add('logout', () => { }); Cypress.Commands.add('addNewUser', (user, pass, role) => { - goTo('/wp-admin/users.php').then(() => { - cy.get('a').contains('Add New User').as('@addUser'); + goTo('/wp-admin/users.php', true).then(() => { + cy.get('a').contains('Add New User').as('addUser'); cy.get('@addUser').then(() => { cy.get('@addUser').click(); cy.wait(1000); + cy.get('input[name="user_login"').clear(); cy.get('input[name="user_login"').type(user); + cy.get('input[name="email"').clear(); cy.get('input[name="email"').type(user + '@' + user + '.com'); + cy.get('input[aria-describedby="pass-strength-result"]').clear(); cy.get('input[aria-describedby="pass-strength-result"]').type(pass); + cy.get('label').contains('Confirm use of weak password').click(); cy.get('label') .contains('Send the new user an email about their account') .click();