npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

testable-playwright-test

v0.0.7

Published

Playwright fixture to run your tests against Testable Cloud

Downloads

4,894

Readme

Introduction

A Playwright test fixture for running your tests against the Testable cloud.

This fixture works for both remote and fully hosted tests:

  1. 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.

  2. 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.

import { createFixture as createTestableFixture } from 'testable-playwright-test';

const test = createTestableFixture({
  // 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
  screenResolution: '1920x1080',
  region: 'aws-us-east-1',
  testCaseName: 'Project Demo 2',
  reportId: `test-${Date.now()}`
});

test('has title', async ({ page }) => {
  await page.goto('https://playwright.dev/');

  // Expect a title "to contain" a substring.
  await expect(page).toHaveTitle(/Playwright/);
});

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 provide any settings, as the test runner will pass in everything.

If you run the below test locally it'll work exactly the same as if you were not using the Testable fixture and launch local browsers.

import { createFixture as createTestableFixture } from 'testable-playwright-test';

const test = createTestableFixture();

test('has title', async ({ page }) => {
  await page.goto('https://playwright.dev/');

  // Expect a title "to contain" a substring.
  await expect(page).toHaveTitle(/Playwright/);
});

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.