Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.
TypeScript apifyautomationcrawlercrawlingheadlessheadless-chromejavascriptnodejsnpmplaywrightpuppeteerscraperscrapingtypescriptweb-crawlerweb-crawlingweb-scraping
test: fix flaky gotoOptions assertion in browser crawler test (#3973)
Martin Adámek6a1ea155bd3d
diff --git a/test/core/crawlers/browser_crawler.test.ts b/test/core/crawlers/browser_crawler.test.tsindex 11619d717..02e8cce0f 100644--- a/test/core/crawlers/browser_crawler.test.ts+++ b/test/core/crawlers/browser_crawler.test.ts@@ -499,14 +499,17 @@ describe('BrowserCrawler', () => {maxRequestRetries: 0,preNavigationHooks: [async ({ gotoOptions }) => {- gotoOptions.timeout = 60000;+ // Extends past the navigation window to prove the override is not silently clamped to it.+ // Must differ from the default `navigationTimeoutMillis` (60s) - a hook value equal to the+ // default is treated as "not overridden" and clamped to the remaining navigation window.+ gotoOptions.timeout = 120000;},],});await browserCrawler.run();- expect(optionsGoto!.timeout).toEqual(60000);+ expect(optionsGoto!.timeout).toEqual(120000);});test.concurrent('should ignore errors in Page.close()', async () => {