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
chore: fix failing e2e tests (#2854)
Jindřich Bärca5397ea1f38
diff --git a/test/e2e/cheerio-max-requests/test.mjs b/test/e2e/cheerio-max-requests/test.mjsindex cf70bbf93..f9faf3d6e 100644--- a/test/e2e/cheerio-max-requests/test.mjs+++ b/test/e2e/cheerio-max-requests/test.mjs@@ -5,7 +5,7 @@ await initialize(testActorDirname);const { stats, datasetItems } = await runActor(testActorDirname);-await expect(stats.requestsFinished > 10, 'All requests finished');+await expect(stats.requestsFinished >= 10, 'All requests finished');await expect(datasetItems.length > 5 && datasetItems.length < 15, 'Number of dataset items');await expect(validateDataset(datasetItems, ['url', 'title', 'uniqueIdentifier', 'firstParagraph', 'modifiedDate']),diff --git a/test/e2e/kv-open-return-storage-object/actor/main.js b/test/e2e/kv-open-return-storage-object/actor/main.jsindex 9aeb49e47..72079180a 100644--- a/test/e2e/kv-open-return-storage-object/actor/main.js+++ b/test/e2e/kv-open-return-storage-object/actor/main.js@@ -10,5 +10,5 @@ const mainOptions = {await Actor.main(async () => {const kv = await KeyValueStore.open();- kv.setValue('storageObject', { storeObject: kv.storageObject });+ await kv.setValue('storageObject', { storeObject: kv.storageObject });}, mainOptions);diff --git a/test/e2e/puppeteer-store-pagination-jquery/actor/main.js b/test/e2e/puppeteer-store-pagination-jquery/actor/main.jsindex 3ceaf9db9..635d6f911 100644--- a/test/e2e/puppeteer-store-pagination-jquery/actor/main.js+++ b/test/e2e/puppeteer-store-pagination-jquery/actor/main.js@@ -32,7 +32,7 @@ await Actor.main(async () => {// enqueue product details from the first three pages of the storefor (let pageNo = 1; pageNo < 3; pageNo++) {// Wait for network events to finish- await page.waitForNetworkIdle();+ await page.waitForNetworkIdle({ concurrency: 2 });// Enqueue all loaded linksawait enqueueLinks({selector: 'a.product-item__image-wrapper',diff --git a/test/e2e/puppeteer-store-pagination/actor/main.js b/test/e2e/puppeteer-store-pagination/actor/main.jsindex 086d7bb78..9fc671606 100644--- a/test/e2e/puppeteer-store-pagination/actor/main.js+++ b/test/e2e/puppeteer-store-pagination/actor/main.js@@ -26,7 +26,7 @@ crawler.router.addHandler('START', async ({ log, enqueueLinks, page }) => {// enqueue product details from the first three pages of the storefor (let pageNo = 1; pageNo < 3; pageNo++) {// Wait for network events to finish- await page.waitForNetworkIdle();+ await page.waitForNetworkIdle({ concurrency: 2 });// Enqueue all loaded linksawait enqueueLinks({selector: 'a.product-item__image-wrapper',