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', 'name@email.com');
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.