-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
a62906e
commit 5a447ac
Showing
1 changed file
with
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import child_process from "child_process"; | ||
import fs from "fs"; | ||
|
||
test("ensure advanced crawl run with docker run passes", async () => { | ||
child_process.execSync("docker run -v $PWD/test-crawls:/crawls webrecorder/browsertrix-crawler crawl --url https://www.iana.org/ --url https://webrecorder.net/ --generateWACZ --text --collection advanced --combineWARC --rolloverSize 10000 --workers 2 --title \"test title\" --description \"test description\" --pages 2 --limit 2"); | ||
|
||
child_process.execSync("docker run -v $PWD/test-crawls:/crawls webrecorder/browsertrix-crawler wacz validate --file collections/advanced/advanced.wacz"); | ||
|
||
}); | ||
|
||
test("check that the favicon made it into the pages jsonl file", () => { | ||
expect(fs.existsSync("test-crawls/collections/advanced/pages/pages.jsonl")).toBe(true); | ||
|
||
const data1 = JSON.parse(fs.readFileSync("test-crawls/collections/advanced/pages/pages.jsonl", "utf8").split("\n")[1]); | ||
const data2 = JSON.parse(fs.readFileSync("test-crawls/collections/advanced/pages/pages.jsonl", "utf8").split("\n")[2]); | ||
const data = [ data1, data2 ]; | ||
for (const d of data) { | ||
if (d.url === "https://webrecorder.net/") { | ||
expect(d.faviconUrl).toEqual("https://webrecorder.net/assets/favicon.ico"); | ||
} | ||
if (d.url === "https://iana.org/") { | ||
expect(d.faviconUrl).toEqual("https://www.iana.org/_img/bookmark_icon.ico"); | ||
} | ||
} | ||
}); |