mardi 9 mars 2021

Is there a way to wait for a window to close, with TestCafe

I have a set of automated tests which open a child window + click a button to close the child window, which then causes a page navigation. Asserting the URL results in Failed to restore connection to window within the allocated timeout.

// In child window
await t.typeText(<field>, 'text').click(<submitButton>);

// Main window
await t.expect(getCurrentUrl()).contains('thank_you')

My assumption here is that TestCafe still believes it is in the child window, without waiting for the window to close, and subsequent page navigation.

I can add in some validation, to ensure we're back on the main window... but I was wondering if there was an inbuilt solution to this problem? (I couldn't see anything in the docs).

Aucun commentaire:

Enregistrer un commentaire