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

playdrums

v0.2.8

Published

Multibrowser test automation framework

Downloads

225

Readme

playDrums

What is playdrums?

Playdrums is a WIP free and open source Node.js library with a clear and concise API mainly inspired by Taiko written by the team behind Gauge from ThoughtWorks.

It interracts with Playwright, the new multiBrowser framework by the former puppeteer team now at Microsoft.

It tries to combine best of both world:

  • High readability of tests
  • Automate the Chromium, WebKit and Firefox browsers with a single API. (with headless support for all)
  • Enable cross-browser web automation that is ever-green, capable, reliable and fast.
  • Headless is supported for all the browsers on all platforms.
  • Allows mobile emulation with webkit based browser (to simulate iDevices)

Usage

See API

Installation

npm install playdrums

Main Features

XHR request interception

XHR Requests can be:

  • Blocked
  • Redirected
  • Modified before sending
  • Stubbed

See Details

Smart navigation handling

Every action that could invoke a navigation:

can easily wait for:

  • Specific event raised
  • Request to be sent
  • Response of request to be received
  • Navigation

before executing next Step

What is the difference between taiko and playdrums

:white_check_mark: Context and page are now clearly indentified.

:white_check_mark: Intercept are now clearly set to a context which can of course handle several pages(tabs in taiko) and better for parallelized tests.

:white_check_mark: Switch tab between concept is allowed.

:white_check_mark: All interracation are made through xpath,csspath or text using $ function (See details)

:white_check_mark: All playwright options have been kept.

:x: Proximity Selectors and element selectors have been removed.

:x: cli have also been removed.

:x: still some work in progress... :hourglass:

Integration with Jest

const { openBrowser,write, closeBrowser, goto, press, screenshot,  focus, $, waitFor } = require('playdrums');

describe('Getting Started with Jest and Playdrums', () => {

    beforeAll(async () => {
        await openBrowser({ headless: false, url:'about:blank' });
    });

    describe('Search Playdrums Repository', () => {

        test('Goto github page', async () => {
            await goto('https://github.com');
        });

        test('Search for playdrums', async () => {
			await focus($('[name=q]'))
			await write('playdrums');
			await press('Enter');
        });

        test('Page contains playdrums', async () => {
            await waitFor($('//*[@href="/sarut0bi/playDrums"]'))
        });

    });

    afterAll(async () => {
        await closeBrowser();
    });

});

Integration with Mocha

"use strict";
const {openBrowser,write, closeBrowser, goto, press, screenshot,  focus, $, waitFor} = require('playdrums');
const assert = require("assert");
const headless = false;

describe('Getting Started with Mocha and Playdrums', () => {

    before(async () => {
        await openBrowser({ headless: headless });
    });

    describe('Search Playdrums Repository', () => {

        it('Goto github page', async () => {
            await goto('https://github.com');
        });

        it('Search for playdrums', async () => {
			await focus($('[name=q]'))
			await write('playdrums');
			await press('Enter');
        });

        it('Page contains playdrums', async () => {
            await waitFor($('//*[@href="/sarut0bi/playDrums"]'));
        });

    });

    after(async () => {
        await closeBrowser();
    });

});

Integration with Gauge

/* globals gauge*/
"use strict";
const { openBrowser,write, closeBrowser, goto, press, screenshot,  focus, $, waitFor } = require('playdrums');
const assert = require("assert");

beforeSuite(async () => {
    await openBrowser({ headless: false })
});

afterSuite(async () => {
    await closeBrowser();
});

gauge.screenshotFn = async function() {
    return await screenshot({ encoding: 'base64' });
};

step("Goto github page", async () => {
    await goto('https://github.com');
});

step("Search for playdrums", async () => {
    await focus($('[name=q]'))
    await write('playdrums');
    await press('Enter');
});

step("Page contains playdrums", async () => {
    assert.ok(await waitFor($('//*[@href="/sarut0bi/playDrums"]')));
});