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

playright

v0.0.22

Published

test- and user-oriented wrapper for Playwright

Downloads

11,877

Readme

Playright

Play the right test- and user-oriented way with Playwright ;)

It is also a port of Selenide, Selene, ]NSelene, SelenideJs from selenium webdriver world.

It is yet a very early draft version of the wrapper, where we play and experiment with API design to find the most optimal and efficient way of working with Playwright from user and testing perspective.

Table of content

Prerequisites

TBD

Installation

TBD

Usage

Quick Start

import { director, goto, element, elements, perform, have, stage } from '../../lib';

describe('Todomvc', () => {
  beforeAll(async() => {
    jest.setTimeout(60 * 1000);
    director.assign({ launchOptions: { headless: false} }); // true by default
  })
  afterEach(async () => {
    await director.dispose();
  });

  it('should complete todo', async () => {
    await goto('http://todomvc.com/examples/emberjs');
    await element('#new-todo').type('a').then(perform.press('Enter'));
    await element('#new-todo').type('b').then(perform.press('Enter'));
    await element('#new-todo').type('c').then(perform.press('Enter'));
    await element('#new-todo').type('d').then(perform.press('Enter'));
    await elements('#todo-list li').should(have.texts('a', 'b', 'c', 'd'));

    await elements('#todo-list li').first.element('.toggle').click();
    await elements('#todo-list li').element(2).element('.toggle').click();
    await elements('#todo-list li').firstBy(have.text('d')).element('.toggle').click();

    await elements('#todo-list li').by(have.cssClass('completed')).should(have.texts('a', 'b', 'd'));
    await elements('#todo-list li').by(have.no.cssClass('completed')).should(have.texts('c'));
  });

  it('should not share todos among different users (simulating by different browser contexts)', async () => {
    await goto('http://todomvc.com/examples/emberjs');
    await element('#new-todo').type('a').then(perform.press('Enter'));
    await elements('#todo-list li').should(have.count(1));

    const another = await director.newContext();
    await another.page.goto('http://todomvc.com/examples/emberjs')

    await another.elements('#todo-list li').should(have.count(0));
  });

  it('should not share todos among different browsers', async () => {
    await goto('http://todomvc.com/examples/emberjs');
    await element('#new-todo').type('a').then(perform.press('Enter'));
    await elements('#todo-list li').should(have.count(1));

    const another = await director.newBrowser();
    await another.page.goto('http://todomvc.com/examples/emberjs')

    await another.elements('#todo-list li').should(have.count(0));
  });

  it('should share todos among different tabs', async () => {
    await goto('http://todomvc.com/examples/emberjs');
    await element('#new-todo').type('a').then(perform.press('Enter'));
    await elements('#todo-list li').should(have.texts('a'));

    const another = await director.newPage();
    await another.page.goto('http://todomvc.com/examples/emberjs')

    await elements('#todo-list li').should(have.texts('a'));
  });
});

TBD

Core API

TBD

Advanced API

TBD

Tutorials

TBD

More examples

TBD

Changelog

see CHANGELOG.md

Contributing

Before implementing your ideas, it is recommended first to create a corresponding issue and discuss the plan to be approved;) Also consider first to help with issues marked with help_needed label ;)

  1. Clone project git clone https://github.com/automician/playright.git

  2. Install it

  3. ...

  4. ...

  5. Add a "feature request" Issue to this project.

  6. Discuss its need and possible implementation. And once approved...

  7. Fork the project ( https://github.com/[my-github-username]/playright/fork )

  8. Create your feature branch (git checkout -b my-new-feature)

  9. Commit your changes (git commit -am 'Add some feature')

  10. Push to the branch (git push origin my-new-feature)

  11. Create a new Pull Request

Release Process

TBD