Puppeteer Javascript Overview

Introduction

Check out the Getting Started with Puppeteer Javascript + Mocha guide for a quick introduction on how to run your test script. Also check out our Puppeteer overview guide to better understand how Puppeteer tests run on Testable in general.

Creating a Scenario

There are two ways to create a Puppeteer Javascript scenario:

  1. Create a new Test Case (Create Test button on the dashboard or Test Cases -> New… on the left nav), select Puppeteer during step 2.
  2. Go to an existing test case and click on the Scenario tab. Click the New Scenario button and select Puppeteer as the scenario type.

Source

There are two ways to load your Puppeteer scenario into the Testable platform.

  1. Upload Files: Upload the files/folders required to run your Puppeteer test. Note that if you upload a zip file it can either be unzipped into your scenario or on the test runner before execution.
  2. Version Control: Download the test files from a version control repository. See our version control guide for more details.

Testable APIs: CSVs, metrics, logging, execution info

The testable-utils library provides several Testable APIs for:

  1. Capturing custom metrics
  2. Logging
  3. Execution Info
  4. Reading from a CSV file
  5. Timing code blocks
  6. Live manual events

All these APIs will work when run locally as well, mostly writing to the console where appropriate. See the testable-utils README for more details.

Screenshots

// ... somewhere in your test
await page.screenshot({path: 'screenshot.png'});

All screenshots get reported back to the results by default. To only capture a sampling of screenshots toggle the Advanced Options -> Advanced Settings -> Capture All Output box in your configuration.