TabSailTabSail

Automated browser testing

Add a small remote-browser smoke test with an assertion and confirmed cleanup.

Use a dedicated funded project and the dependencies from the Quickstart. Tests create real browser usage; keep them bounded.

Save as smoke.test.mjs and run node --test smoke.test.mjs:

import test from "node:test";
import assert from "node:assert/strict";
import { TabSail } from "tabsail";
import { chromium } from "playwright";

test("remote browser opens a known page and releases", { timeout: 120_000 }, async () => {
  const client = new TabSail();
  await client.withSession({
    timeoutSeconds: 300,
    timeoutMs: 60_000,
    cleanupTimeoutMs: 30_000,
  }, async (session) => {
    const grant = await client.sessions.connections.create(session.id, { type: "cdp" });
    const browser = await chromium.connectOverCDP(grant.url, { timeout: 15_000 });
    try {
      const page = browser.contexts()[0].pages()[0];
      await page.goto("https://example.com", { timeout: 20_000 });
      assert.equal(await page.title(), "Example Domain");
    } finally {
      await browser.close();
    }
  });
});

Expand around your application

Use a deterministic staging site reachable from the remote browser. Verify expected business state, not only navigation success. Put test credentials in your backend secret store and retrieve screenshots or files before cleanup.

For parallel suites, bound worker count to the account's concurrency and credit budget. Do not let each test retry an entire form submission without checking whether the previous operation completed.

Compatibility boundary

This is a standalone Node smoke test using a CDP client. A Playwright Test project fixture or CI integration needs its own dependency/version and lifecycle validation.

On this page