Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add E2E tests #48

Merged
merged 18 commits into from
Aug 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Try fix connect tests in trunk env.
iamdharmesh committed Aug 9, 2024
commit 4fe1d6e88c0f8ecd792c6beb20987771fa0f7643
14 changes: 10 additions & 4 deletions tests/cypress/e2e/connect.test.js
Original file line number Diff line number Diff line change
@@ -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: ');
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
@@ -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'));
});