lundi 18 janvier 2021

TestCafe - How to increase maximum wait time for an If Statement or explicitly defined timeout for If Statement

I am trying to write 2 conditions in which if the conditions are coming alternately then my code is working fine but when both conditions true together then the second condition always fail because there is a time difference of 5-6 seconds after the first condition executed and even though second condition is valid ( waiting for a window to appear) it never went inside the second if-condition. I tried writing timeout but it didn't work in TestCafe. Someone please help if there is any inbuild function to be use for If-Condition just like it is there for assertion - // await t.expect('.boarding-pass', { timeout: 10000 }); Similar option is not working under If Condition - // if ( '.boarding-pass'.exists, { timeout: 10000 }){ do something} It is working only if the Boarding Pass Screen is appearing, if not then it is waiting for 10 seconds and skip second If Statement.
I am not putting the codes for now. If you really need that i will try to recreate it using some public application.

Aucun commentaire:

Enregistrer un commentaire