testable-playwright-test
v0.1.10
Published
Playwright fixture to run your tests against Testable Cloud
Readme
Introduction
A Playwright test fixture for running your tests against the Testable cloud.
This fixture works for both remote and fully hosted tests:
Remote tests - Execute your playwright tests yourself and use Testable Cloud as an infinitely scalable browser grid that also generates detailed, customizable, and shareable reports for your test runs.
Fully hosted tests - For tests that you upload and run on a Testable test runner.
Alternatively you can use Testable as a remote Selenium grid without using this fixture at all.
Getting Started
Remote Tests
You can continue running your tests on your own infrastructure but point them at Testable Cloud's browser grid by using our version of defineConfig(config, testableOptions) that takes a 2nd parameter for Testable related parameters.
playwright.config.ts
const { devices } = require('@playwright/test');
const { defineConfig } = require('testable-playwright-test');
export default defineConfig({
// your config contents here
}, {
// mandatory api key (found under Org Management => API Keys)
key: "[your-api-key]",
// see https://a.testable.io/remote-configurator for all other options available
testCaseName: 'My Playwright Tests',
region: 'us-east-1',
screenshot: 'afterFailed',
tags: `test-${Date.now()}`
});Your spec files do not need to be modified to work with Testable, only the config file.
Fully Hosted Tests
You can upload your project or link to source control and have Testable run your tests on our test runners as per your test configuration. In this case you don't need to modify anything as the test is launched by Testable on a test runner.
Testable Selenium Grid
For chromium only you can also point your tests against the Testable remote Selenium endpoint. For each session you will see a test result on Testable. This does not require the Testable fixture.
See more details on all the options you can pass under https://a.testable.io/remote-configurator.
SELENIUM_REMOTE_URL=https://selenium.testable.io/wd/hub SELENIUM_REMOTE_CAPABILITIES='{ "testable:options": { "region": "aws-us-east-1", "seleniumVersion": "4.x" } }' SELENIUM_REMOTE_HEADERS='{"Authorization":"Basic [base-64-encoded...username:api-key]"}' npx playwright test
For the authorization header the username can be anything you want (it'll get logged with the test) and the API key can be found under Org Management => API Keys when you login to Testable.
