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(e2e): de-flake puppeteer-ignore-ssl-errors (#3791)
Martin Adámek53b07092817c
diff --git a/test/e2e/puppeteer-ignore-ssl-errors/actor/main.js b/test/e2e/puppeteer-ignore-ssl-errors/actor/main.jsindex 0a279d7d9..bfd0cf227 100644--- a/test/e2e/puppeteer-ignore-ssl-errors/actor/main.js+++ b/test/e2e/puppeteer-ignore-ssl-errors/actor/main.js@@ -11,6 +11,9 @@ const mainOptions = {await Actor.main(async () => {const crawler = new PuppeteerCrawler({+ // Keep concurrency low so the burst of requests to badssl.com doesn't trip its+ // rate limiting, which surfaces as ERR_CONNECTION_RESET and makes the test flaky.+ maxConcurrency: 2,launchContext: { launchOptions: { acceptInsecureCerts: true } },preNavigationHooks: [(_ctx, goToOptions) => {diff --git a/test/e2e/puppeteer-ignore-ssl-errors/test.mjs b/test/e2e/puppeteer-ignore-ssl-errors/test.mjsindex 500504403..5389e2aab 100644--- a/test/e2e/puppeteer-ignore-ssl-errors/test.mjs+++ b/test/e2e/puppeteer-ignore-ssl-errors/test.mjs@@ -5,6 +5,9 @@ await initialize(testActorDirname);const { stats, datasetItems } = await runActor(testActorDirname, 16384);-await expect(stats.requestsFinished > 20, 'All requests finished');-await expect(datasetItems.length > 20, 'Minimum number of dataset items');+// Of badssl.com's ~31 "bad" links, ~10 use ciphers/protocols modern Chrome removed+// (3des, rc4, dh*, null, …) and can never load regardless of acceptInsecureCerts, so the+// ceiling is ~20. Assert a comfortable floor that still proves cert errors are bypassed.+await expect(stats.requestsFinished > 10, 'All requests finished');+await expect(datasetItems.length > 10, 'Minimum number of dataset items');await expect(validateDataset(datasetItems, ['url', 'title']), 'Dataset items validation');