mardi 3 octobre 2017

detox: tap button only if exists

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 an expected error Error: Cannot find UI element.

http://ift.tt/2h4jLUT

Aucun commentaire:

Enregistrer un commentaire