1.3.3 • Published 11 months ago

@alexrah/playwright-utils v1.3.3

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

Playwright utilities

All utilities listed here are meant to be used inside a playwright's test() function.

cmpBypass

clicks "Accept" on InMobi (formerly Quantcast) CMP overlay

// inside a playwright test()
await cmpBypass(page);

contentIsVisible

check if passed selector match any visible element

// inside a playwright test()
await contentIsVisible(testUrl.existentContentSelectors,page)

contentExists

check if passed selector match any existing element

// inside a playwright test()
await contentExists(testUrl.existentContentSelectors,page)

contentNotExist

check if passed selector match any not existing element

// inside a playwright test()
await contentNotExist(testUrl.notExistentContentSelectors,page);

wpSessionLoginStorage

  • login to a wordpress backend with creds provided in .env file USERNAME & PASSWORD
  • save authenticated session in *.json file to allow reuse in multiple tests
  • requires option use.baseURL to be set in playwright.config.ts to correctly open /wp-login.php
type tWpSessionLoginStorageProps = {
  browser: Browser,
  absPathToStorageFile: string,
  checkIfSuccessfull?: boolean
}

await wpSessionLoginStorage({browser,absPathToStorageFile:'/path/to/stored/creds.json', checkIfSuccessfull:false})
1.2.0

12 months ago

1.3.3

11 months ago

1.3.2

12 months ago

1.3.1

12 months ago

1.2.2

12 months ago

1.3.0

12 months ago

1.2.1

12 months ago

1.1.0

1 year ago

1.0.0

1 year ago