-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c30291
commit 10ddd22
Showing
4 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { assertEquals } from "https://deno.land/[email protected]/assert/assert_equals.ts"; | ||
|
||
import { launch } from "../mod.ts"; | ||
|
||
Deno.test("Testing evaluate", async () => { | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { assert } from "https://deno.land/[email protected]/assert/assert.ts"; | ||
|
||
import { launch } from "../mod.ts"; | ||
|
||
/// <reference lib="dom" /> | ||
|
||
Deno.test("Testing stealth", async () => { | ||
// Launch browser | ||
const browser = await launch(); | ||
|
||
// Open the webpage | ||
const page = await browser.newPage("http://example.com"); | ||
|
||
// passing arguments to evaluate | ||
const userAgent: string = await page.evaluate(() => { | ||
return navigator.userAgent; | ||
}); | ||
assert(userAgent.toLowerCase().includes("headless")); | ||
|
||
// Close browser | ||
await browser.close(); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { assertSnapshot } from "https://deno.land/[email protected]/testing/snapshot.ts"; | ||
|
||
import { launch } from "../mod.ts"; | ||
|
||
Deno.test("Wait for selector", async () => { | ||
|