Skip to content

Instantly share code, notes, and snippets.

@windchime-yk
Created December 20, 2021 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save windchime-yk/5d242d9e6a117a8f9215baabe79b109d to your computer and use it in GitHub Desktop.
Save windchime-yk/5d242d9e6a117a8f9215baabe79b109d to your computer and use it in GitHub Desktop.
/// <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