https://cypress.io logo
Hello, I'm trying to do salesforce ui automation w...
# e2e-testing
j
Hello, I'm trying to do salesforce ui automation with Cypress, but the test stops abruptly without any logs or error messages. I suspected it was due to cross-domain, but I'm not sure. Sharing the code as well as the error video.
Copy code
login.spec.ts file
import SalesforceLoginPage from "../../pages/salesforceLogin";
describe('Logging in to salesforce', () => {
    before('visit the sign in page', () => {
        SalesforceLoginPage.open();
    });
    it('log in to salesforce', () => {
        cy.log(Cypress.env("salesforce_username"));
        SalesforceLoginPage.typeUsername(Cypress.env("salesforce_username"));
        SalesforceLoginPage.typePassword(Cypress.env("salesforce_password"));
        SalesforceLoginPage.pressSignIn();
    });
});
----------------------------------------------------------------------------
salesforceLogin.ts file
const USERNAME_FIELD = '#username';
const PASSWORD_FIELD = '#password';
const SUBMIT_BUTTON = 'input[type=submit]';
const APP_LAUNCHER = '.salesforceIdentityAppLauncherHeader';
class SalesforceLoginPage {
    static open() {
        cy.visit(Cypress.env('salesforce_login_url'));
    }
    static typeUsername(username: string) {
        cy.get(USERNAME_FIELD).type(username)
    }
    static typePassword(password: string) {
        cy.get(PASSWORD_FIELD).type(password)
    }
    static pressSignIn() {
       return cy.get(SUBMIT_BUTTON).click()
    }
    static appLauncher(){
        cy.get(APP_LAUNCHER).click();
    }
}
export default SalesforceLoginPage;
salesforce_login_url is the instanceUrl of the salesforce of my account. I can see the test running until the login happens, and then it just stops abruptly before it gets to the App Launcher button. Please help. https://app.usebubbles.com/gcK8SrcSxvEFeNmKDBkfWz/cypress-salesforce-login-s-video-recording