Skip to content

Commit

Permalink
Try fix connect tests in trunk env.
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdharmesh committed Aug 9, 2024
1 parent 3921ba6 commit 4fe1d6e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions tests/cypress/e2e/connect.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,18 @@ describe('Admin can connect to "Mailchimp" Account', () => {
cy.get('#mailchimp_sf_oauth_connect').click();
cy.wait(6000);

cy.popup().find('input#username').clear().type(Cypress.env('MAILCHIMP_USERNAME'));
cy.popup().find('input#password').clear().type(Cypress.env('MAILCHIMP_PASSWORD'));
cy.popup().find('button[type="submit"]').click();
cy.popup()
.find('input#username')
.clear()
.type(Cypress.env('MAILCHIMP_USERNAME'), { force: true });
cy.popup()
.find('input#password')
.clear()
.type(Cypress.env('MAILCHIMP_PASSWORD'), { force: true });
cy.popup().find('button[type="submit"]').click({ force: true });
cy.wait(10000); // Not a best practice, but did not find a better way to handle this.

cy.popup().find('input#submitButton').click();
cy.popup().find('input#submitButton').click({ force: true });
cy.wait(10000); // Not a best practice, but did not find a better way to handle this.

cy.get('.mc-user h3').contains('Logged in as: ');
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-undef */
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
Expand Down Expand Up @@ -44,7 +45,6 @@ Cypress.Commands.add('capturePopup', () => {
* Returns a wrapped body of a captured popup
*/
Cypress.Commands.add('popup', () => {
console.log('state', state.popup);
const popup = Cypress.$(state.popup.document);
return cy.wrap(popup.contents().find('body'));
});

0 comments on commit 4fe1d6e

Please sign in to comment.