After login, if the user is already logged on, a pop up is displayed. I want to use a do while loop. New to javascript and testcafe so this should probably be considered pseudo code...
do
{
try
{
if (await this.continueBtn.exists)
{
await t.click(this.continueBtn);
}
}
catch
{
break;
}
}
while (await this.longinName.exists);
So, I'm not sure if the awaits are right or needed, but hopefully you get the idea of what I'm trying to do. User enters login information and clicks login button. If the user is already logged in, a pop-up will be displayed with the continue button. In the background, or under the pop-up the login name control is still visible/exists (maybe I should just use visible, tried, didn't work for me). So, while that is displayed I would like to keep a watch out for the pop-up and click continue to login in.
This 'code' will be in a page object class and after going through some tutorials, this. convention was used so not sure if that is correct either.
Thanks for any help in advance!