jeudi 26 novembre 2020

How to use an OR (||) statement in TestCafe

I would like to check if one of two elements exists (different ways of navigation) but I'm not able to make it work in any way.

I tried like that:

((await t.expect(commonElements.navDropdown.exists).ok() || await t.expect(dashboard.dashboardHeader.exists).ok());

or like that

await t.expect(await commonElements.navDropdown.exists || await dashboard.dashboardHeader.exists).ok();

but it always evaluates as false (falsy).

I tried that also in many other ways but these two seems to me as the closest ones to a proper solution.

Is it even possible to use OR logical operator in such case?

Aucun commentaire:

Enregistrer un commentaire