Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6468682

Browse files
committedNov 3, 2022
fixup!: use frameLocator
1 parent b4a673b commit 6468682

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed
 

‎test/e2e/webview.test.ts

+7-9
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,15 @@ describe("Webviews", ["--disable-workspace-trust"], {}, () => {
1414
// Open Preview
1515
await codeServerPage.executeCommandViaMenus("Markdown: Open Preview to the Side")
1616
// Wait for the iframe to open and load
17-
await codeServerPage.page.waitForTimeout(2000)
1817
await codeServerPage.waitForTab(`Preview ${file}`)
1918

20-
let totalCount = 0
21-
for (const frame of codeServerPage.page.frames()) {
22-
// Check for heading in frames
23-
const count = await frame.locator(`text=${heading}`).count()
24-
totalCount += count
25-
}
19+
// It's an iframe within an iframe
20+
// so we have to do .frameLocator twice
21+
const renderedText = await codeServerPage.page
22+
.frameLocator("iframe.webview.ready")
23+
.frameLocator("#active-frame")
24+
.locator("text=Hello world")
2625

27-
// One in the file and one in the preview
28-
expect(totalCount).toBe(2)
26+
expect(renderedText).toBeVisible
2927
})
3028
})

0 commit comments

Comments
 (0)
Please sign in to comment.