Autonomy Docs
Migrate

Puppeteer

Convert Puppeteer scripts and jest-puppeteer suites to Autonomy test cases. Drop waitForSelector and the hand-rolled retry loops.

Puppeteer scripts are imperative and often mix navigation with scraping. Migrate only the parts that verify product behavior; leave data-collection scripts where they are.

Prompt

Paste this into a coding agent connected to the Autonomy MCP server from inside the repository:

Codetext
Migrate the Puppeteer tests in this repository to Autonomy.
For each test: read it, then create one Autonomy Test Case with autonomy_test_case_create named after the test title.
Convert selectors into plain-language descriptions of the control. Keep every asserted value exactly as written.
Replace hard-coded credentials with agent-chosen fill values and configuration with environment values.
Drop waits, retries, and framework fixtures. List existing Test Cases first and skip any that already cover the journey.
Report a table of source test -> created Test Case ID when done.

Mapping notes

  • page.waitForSelector() / waitForNavigation() are dropped; the next step's outcome is the wait condition.
  • page.$eval / page.evaluate reads that feed a Jest expect become Assert steps on the visible value.
  • page.setRequestInterception() handlers become Validate Network where they assert, and are dropped where they only stub.

See the migration overview for the full construct-by-construct mapping.

On this page