New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@empiricalrun/playwright-utils

Package Overview
Dependencies
Maintainers
0
Versions
151
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@empiricalrun/playwright-utils

Playwright utils for test code repos of our customers

  • 0.13.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2K
increased by39.48%
Maintainers
0
Weekly downloads
 
Created
Source

playwright-utils

Playwright utils for test code repos of our customers

Utilities

  • Default config for Playwright projects
  • Custom reporter
  • Highlight user actions
    • Custom fixture to wrap around that
  • Vision capabilities
    • locator.query API
    • Captcha
  • Email automation

Email automation

Example usage

Dynamic email

This dynamically generates a random email address that can be used for the test (e.g. invite a new user).

import { EmailClient } from "@empiricalrun/playwright-utils";

const client = new EmailClient();
const address = client.getAddress();

// Input the `address` in the application
// that sends the email.

// Get email received on the `address`
const email = await client.waitForEmail();
Static email

This uses a known (static) email that can be used to login into an application.

This needs an email id (e.g. test-login-user). The email id is appended with the domain (managed internally) to get the full email address.

import { EmailClient } from "@empiricalrun/playwright-utils";

const emailId = `test-login-user`;

const client = new EmailClient({ emailId });
const address = client.getAddress(); // Returns full address with domain

// Get email received on the `address`
const email = await client.waitForEmail();

// Get login OTP
const loginCode = email.codes[0];
Add reporter

To use the custom HTML reporter, add the following to your Playwright config:

import { defineConfig } from "@playwright/test";
import { baseConfig } from "@empiricalrun/playwright-utils";

export default defineConfig({
  ...baseConfig,
  ...
});

FAQs

Package last updated on 16 Sep 2024

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