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.

959 B
Raw Blame
import { BrowserPool, PlaywrightPlugin, PuppeteerPlugin } from '@crawlee/browser-pool';
import playwright from 'playwright';
import puppeteer from 'puppeteer';

describe('Hybrid BrowserPool plugins should not be allowed', () => {
    test('mixing Puppeteer with Playwright should throw an error', () => {
        expect(
            () =>
                new BrowserPool({
                    browserPlugins: [new PuppeteerPlugin(puppeteer), new PlaywrightPlugin(playwright.chromium)],
                }),
        ).toThrowError();
    });

    test('providing multiple different Playwright plugins should not throw an error', () => {
        expect(
            () =>
                new BrowserPool({
                    browserPlugins: [
                        new PlaywrightPlugin(playwright.chromium),
                        new PlaywrightPlugin(playwright.firefox),
                    ],
                }),
        ).not.toThrowError();
    });
});