Skip to content

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.

test: fix puppeteer-enqueue-links and cheerio-enqueue-links e2e tests

Martin Adámek97ee28b08f14
diff --git a/test/e2e/cheerio-enqueue-links/actor/main.js b/test/e2e/cheerio-enqueue-links/actor/main.js
index 758acb65c..563f7bb26 100644
--- a/test/e2e/cheerio-enqueue-links/actor/main.js
+++ b/test/e2e/cheerio-enqueue-links/actor/main.js
@@ -17,7 +17,7 @@ await Actor.main(async () => {
const pageTitle = $('title').first().text();
log.info(`URL: ${url}; LOADED_URL: ${loadedUrl}; TITLE: ${pageTitle}`);
- const results = await enqueueLinks({ selector: '[class^=CustomRebass__Box] a' });
+ const results = await enqueueLinks();
if (loadedUrl.startsWith('https://drive')) {
const isEqual = deepEqual(results, { processedRequests: [], unprocessedRequests: [] });
diff --git a/test/e2e/cheerio-enqueue-links/test.mjs b/test/e2e/cheerio-enqueue-links/test.mjs
index 95b57503c..d93ac0d4a 100644
--- a/test/e2e/cheerio-enqueue-links/test.mjs
+++ b/test/e2e/cheerio-enqueue-links/test.mjs
@@ -1,6 +1,4 @@
-import { initialize, getActorTestDir, runActor, expect, skipTest } from '../tools.mjs';
-
-skipTest('flaky and need be rewritten');
+import { initialize, getActorTestDir, runActor, expect } from '../tools.mjs';
const testActorDirname = getActorTestDir(import.meta.url);
await initialize(testActorDirname);
diff --git a/test/e2e/puppeteer-enqueue-links/actor/main.js b/test/e2e/puppeteer-enqueue-links/actor/main.js
index a771bd632..d86b355ed 100644
--- a/test/e2e/puppeteer-enqueue-links/actor/main.js
+++ b/test/e2e/puppeteer-enqueue-links/actor/main.js
@@ -17,7 +17,7 @@ await Actor.main(async () => {
const pageTitle = await page.title();
log.info(`URL: ${url}; LOADED_URL: ${loadedUrl}; TITLE: ${pageTitle}`);
- const results = await enqueueLinks({ selector: '[class^=CustomRebass__Box] a' });
+ const results = await enqueueLinks();
if (loadedUrl.startsWith('https://drive')) {
const isEqual = deepEqual(results, { processedRequests: [], unprocessedRequests: [] });
diff --git a/test/e2e/puppeteer-enqueue-links/test.mjs b/test/e2e/puppeteer-enqueue-links/test.mjs
index 36fcad7b5..d088b70d1 100644
--- a/test/e2e/puppeteer-enqueue-links/test.mjs
+++ b/test/e2e/puppeteer-enqueue-links/test.mjs
@@ -1,6 +1,4 @@
-import { initialize, getActorTestDir, runActor, expect, skipTest } from '../tools.mjs';
-
-skipTest('flaky and need be rewritten');
+import { initialize, getActorTestDir, runActor, expect } from '../tools.mjs';
const testActorDirname = getActorTestDir(import.meta.url);
await initialize(testActorDirname);