Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@silenteer/pw-proxy

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@silenteer/pw-proxy

Plawyright proxy is a proxy for creating a "static" Playwright Locator.

  • 1.3.1
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

Playwright proxy

Plawyright proxy is a proxy for creating a "static" Playwright Locator.

Plawyright Locator normally cannot be constructed without having an instance of Page (or another Locator). But if the Locator on its own doesn't have the intention to interact with the Page (like click, hover etc), Locator would not need to have the Page instance

How the proxy comes into play

So, pw-proxy lets you create an instance of Locator in a static way

  • All of methods to manipulate Locator can be constructed without Page instance
  • All of interactions like click, hover will delegate to instance of Page can be found via StaticPage.set

The result of those letting you create Page Object in a more static way

Compares traditional Page Object

class Home {
  constructor(public page: Page) {}
  dialog = this.page.locator('.dialog').fitler({ hasText: 'form' })

  async openDialog() { await this.dialog.click() }
}

const home = new Home(page)
await home.openDialog()

to something way simpler

const home = new class {
  dialog = $.locator('.dialog').fitler({ hasText: 'form' })
  async openDialog() { await this.dialog.click() }
}

// you'll need to set page
StaticPage.set(page)
await home.openDialog()

FAQs

Package last updated on 18 Jan 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