jolly-dusk-6729
10/07/2022, 1:02 AMlogin.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