When using Protractor for E2E Testing, it seems as though every single line of code requires await when SELENIUM_PROMISE_MANAGER: false.
Is there a better way to do this example below?
Originally I was using the SELENIUM_PROMISE_MANAGER: false but ran into issues when needing to use conditionals WebElement.isPresent(). The promise manager was not able to resolve the promises of the isPresent() and just continued execution. So now considering using async/await.
describe('Home Page', async () => {
beforeAll(async () => {
await loginPage.loadPage(); // methods defined in Page Object
await loginPage.login(); // uses WebElement.sendKeys() and Webelement.submit()
await homePage.closeModal();
});
it('should fill a form', async () => {
await $('#field1').clear();
await $('#field1').sendKeys('hello');
await $('#field2').clear();
await $('#field2').sendKeys('world');
$('form').submit();
}
}
If almost every line needs an await, is there something i'm missing here?