In my test, I would like to simulate a tap in the "cancelUpgrade" button only if it is displayed:
it('should be in home menu', async () => {
await waitFor(element(by.id('cancelUpgrade')))
.toBeVisible()
.withTimeout(2000);
await element(by.id('cancelUpgrade')).tap();
});
It returns the expected error Error: Cannot find UI element.