Created
December 20, 2021 16:34
-
-
Save windchime-yk/5d242d9e6a117a8f9215baabe79b109d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference no-default-lib="true" /> | |
/// <reference lib="dom" /> | |
/// <reference lib="dom.asynciterable" /> | |
/// <reference lib="deno.ns" /> | |
import { assertEquals } from "https://deno.land/std@0.110.0/testing/asserts.ts"; | |
import { buildFor } from "https://deno.land/x/sinco@v3.0.0/mod.ts"; | |
Deno.test("Go to example.com", async () => { | |
const sinco = await buildFor("chrome"); | |
const page = await sinco.goTo("https://example.com/"); | |
const pageTitle: string = await page.evaluate(() => { | |
return document.querySelector("h1")?.innerText; | |
}); | |
assertEquals(pageTitle, "Example Domain"); | |
await sinco.done(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment