Socket
Socket
Sign inDemoInstall

expect-puppeteer

Package Overview
Dependencies
Maintainers
2
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expect-puppeteer

Assertion toolkit for Puppeteer.


Version published
Weekly downloads
194K
decreased by-4.86%
Maintainers
2
Weekly downloads
 
Created

What is expect-puppeteer?

The expect-puppeteer package is a set of utility functions that integrate Jest's expect assertions with Puppeteer's browser automation capabilities. It allows for more readable and expressive tests when working with Puppeteer.

What are expect-puppeteer's main functionalities?

toMatch

This feature allows you to assert that a specific text appears on the page. It simplifies the process of checking for text content within the page.

await expect(page).toMatch('text to match');

toClick

This feature allows you to simulate a click event on a specified element. It is useful for testing interactions with buttons, links, and other clickable elements.

await expect(page).toClick('button#submit');

toFill

This feature allows you to fill out form fields with specified values. It is useful for testing form submissions and input handling.

await expect(page).toFill('input[name="username"]', 'myUsername');

toSelect

This feature allows you to select an option from a dropdown menu. It is useful for testing interactions with select elements.

await expect(page).toSelect('select#dropdown', 'optionValue');

toUploadFile

This feature allows you to simulate file uploads by specifying the file path. It is useful for testing file input elements.

await expect(page).toUploadFile('input[type="file"]', 'path/to/file.txt');

Other packages similar to expect-puppeteer

Keywords

FAQs

Package last updated on 26 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc