Code Monkey home page Code Monkey logo

lesouffleur's Introduction

Le Souffleur

Playwright has really good codegen tool, but you are stuck with Puppeteer. Then this library is what you need as it allows to take code generated by Playwright's codegen and use it in Puppeteer with minimal changes.

This is very early version that might be improved in the future. Here some ideas:

  • Add tests

  • Add custom jest matchers. codegen generates matchers like toContainText or toBeVisible that are not supported by this library yet

  • Allow to specify test id attribute (in current implementation data-hook is used)

  • Support more functions and cases. Only small subset of codegen generated code is supported now.

Installation

npm:

npm install -D lesouffleur

yarn:

yarn add -D lesouffleur

Usage

import { LeSouffleur } from 'lesouffleur';

const driver = new LeSouffleur(page); // <-- Puppeteer page here
await driver.getByTestId('some-test-id').click();
await driver.getByRole('button', { name: 'Increment' }).click();
await driver.getByText('Approve').click();

Development

Since we are working on abstraction of Puppeteer here (no real Puppeteer types) make sure to write tests and, please, test with real product as well.

You can use dev version by linking it. E.g. using yarn you can do something like this:

yarn add lesouffleur@portal:./../../../lesouffleur

The goal is to make Puppeteer act like Playwright as much as possible thus try to mimic Playwright behaviour, e.g. read how actions work here: https://playwright.dev/docs/actionability

Misc

As both Playwright and Puppeteer is theatre related I simply chose name related to theatre as well. See this Wikipedia article: Prompter

lesouffleur's People

Contributors

daliusd avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.