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
Fix flaky test, update changelog, bump version
Ondra Urbanc0e57620b0be
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 1aa7846ae..21d103e96 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1,4 +1,4 @@-xxx+0.14.10 / 2019-05-24===================- Update `Puppeteer` to 1.17.0.- Add `idempotencyKey` parameter to `Apify.addWebhook()`.diff --git a/package.json b/package.jsonindex 684eacbec..d299f6fdf 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "apify",- "version": "0.14.9",+ "version": "0.14.10","description": "The scalable web crawling and scraping library for JavaScript. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.","engines": {"node": ">=8.14.0"diff --git a/test/events.js b/test/events.jsindex 445ec9ff4..3f32a9441 100644--- a/test/events.js+++ b/test/events.js@@ -119,18 +119,18 @@ describe('Apify.events', () => {delete process.env[ENV_VARS.ACTOR_EVENTS_WS_URL];});- // TODO: This tests fails if system is overloaded, it should not depend on timing!it('should send persist state events in regular interval', async () => {- process.env.APIFY_TEST_PERSIST_INTERVAL_MILLIS = 20;+ process.env.APIFY_TEST_PERSIST_INTERVAL_MILLIS = 1;const eventsReceived = [];Apify.events.on(ACTOR_EVENT_NAMES_EX.PERSIST_STATE, data => eventsReceived.push(data));await Apify.initializeEvents();- await delayPromise(115);+ await delayPromise(10);await Apify.stopEvents();- expect(eventsReceived.length).to.be.eql(5);- await delayPromise(50);- expect(eventsReceived.length).to.be.eql(5);+ const eventCount = eventsReceived.length;+ expect(eventCount).to.be.above(2);+ await delayPromise(10);+ expect(eventsReceived.length).to.be.eql(eventCount);delete process.env.APIFY_TEST_PERSIST_INTERVAL_MILLIS;});