diff options
Diffstat (limited to 'e2e/lib')
-rw-r--r-- | e2e/lib/Page.ts | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/e2e/lib/Page.ts b/e2e/lib/Page.ts index 46d67b0..13bf70f 100644 --- a/e2e/lib/Page.ts +++ b/e2e/lib/Page.ts @@ -122,8 +122,17 @@ export default class Page { if (!topFrame) { return; } - await webdriver.wait(until.elementLocated(By.id("vimvixen-console-frame"))); - await webdriver.switchTo().frame(0); + // style tag is injected at end of add-on loading + await webdriver.wait(until.elementLocated(By.tagName("style"))); + + const iframe = await webdriver.findElements( + By.id("vimvixen-console-frame") + ); + if (iframe.length === 0) { + return; + } + + await webdriver.switchTo().frame(iframe[0]); await Page.waitForDocumentCompleted(webdriver); await webdriver.switchTo().parentFrame(); } |