Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using expect inside nested iframes with TestCafe

I have an issue with using an expect statement inside a nested iframe on Google Sheets hanging the tests. (for testing content inside modals)

Here is the test I am trying to implement:

const modaldialogFrame = Selector(
  '.modal-dialog-content.script-app-contents'
).find('iframe');
const sandboxFrame = Selector('#sandboxFrame');
const userHtmlFrame = Selector('#userHtmlFrame');

test('Check for email input', async browser => {
await browser.switchToIframe(modaldialogFrame);
await browser.switchToIframe(sandboxFrame);
await browser.switchToIframe(userHtmlFrame);

await browser.expect(Selector('#email').exists).ok();
})

But the expect will hang the tests, also adding

 await browser.switchToMainWindow();

after the expect statement doesn't help.

However, only clicking on the element and typing will work with

await browser.typeText('#email', '[email protected]');
await browser.typeText('#password', 'mypassword');
await browser.click('#login-button');

Therefore entering iframes work, but expect statements do not, what can I do to overcome this issue ?

I am willing to help to solve this as fast as possible if this is a bug.

like image 384
Istvan Fulop Avatar asked Aug 10 '26 08:08

Istvan Fulop


1 Answers

Thank you for your feedback, I've reproduced the problem and created an issue in our repository:

https://github.com/DevExpress/testcafe/issues/3422

You can use it to track the progress. I need some time to find its cause because Google Spreadsheets executes a lot of very complex scripts on the page.

like image 165
Andrey Belym Avatar answered Aug 12 '26 13:08

Andrey Belym



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!