On login page everything works perfect, I can select the inputs, select the submit button and click the submit button, the url changes like I expect, but after the login I can't select elements anymore from some reason.
// #1 login test
it('should send check in desktop', async () => {
await loginPage.login(environment.e2e.user.phone, environment.e2e.user.password);
await loginPage.verifySuccessfullLogin();
console.log('After verifySuccessfullLogin');
await browser.sleep(3000);
console.log('After sleep');
const sendBtn = $('#sendCheckBtnDesktop');
console.log(sendBtn);
await sendBtn.click();
// Not getting here
await browser.sleep(10000);
});
Rest of the Code:
navigateToLoginPage() {
return browser.get(environment.e2e.baseUrl);
}
getPhoneInput() {
return $('#phoneNumber');
}
getPasswordInput() {
return $('#login-password');
}
getSubmitButton() {
return $('#submitLoginBtn');
}
verifySuccessfullLogin() {
return browser.wait(browser.ExpectedConditions.urlContains('/user/personal'), 10000);
}
public async login(phone: string = environment.e2e.user.phone, password: string = environment.e2e.user.password) {
await this.navigateToLoginPage();
const phoneInput = this.getPhoneInput();
await phoneInput.sendKeys(phone);
const passInput = this.getPasswordInput();
await passInput.sendKeys(password);
const submitBtn = this.getSubmitButton();
await submitBtn.click();
}
