Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

cenfun/mouse-helper

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mouse Helper

A tool to show mouse position and status for screenshots in automation test such as Puppeteer or Playwright

Install

npm i mouse-helper

Preview Online

https://cenfun.github.io/mouse-helper/

Preview Screenshots

screenshot mouse move(20, 50)

screenshot mouse down

screenshot mouse none (mouse never moved)

Usage

require("mouse-helper")();

Browser Usage

<script src="dist/mouse-helper.js"></script>
<script>
    window['mouse-helper']();
</script>

see /public/index.html

Playwright Usage

const { chromium } = require('playwright');

const browser = await chromium.launch();

const context = await browser.newContext();
await context.addInitScript({
    path: './node_modules/mouse-helper/dist/mouse-helper.js'
});

const page = await context.newPage();
await page.goto("your page url");

await page.evaluate(() => {
     window['mouse-helper']();
});

await page.mouse.move(20, 50);
await page.screenshot({
    path: "your screenshot path"
});

await page.mouse.down();
await page.screenshot({
    path: "your screenshot path"
});

await page.mouse.up();

see /scripts/test.js

About

A tool to show mouse position and status for screenshots in automation test such as Puppeteer or Playwright

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.