Socket
Socket
Sign inDemoInstall

@umbraco/playwright-testhelpers

Package Overview
Dependencies
17
Maintainers
3
Versions
71
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @umbraco/playwright-testhelpers

Test helpers for making playwright tests for Umbraco solutions


Version published
Maintainers
3
Created

Readme

Source

Umbraco.Playwright.Testhelpers

This package contains the Test-helpers for the Umbraco Playwright tests!

Prerequisites

This project was made with Node V16, so the minimum requirement is node 16.17.1 Having playwright installed, you can install playwright by running npx playwright install

Getting started

You can import a helper into your code like so

import {  ConstantHelper } from "@umbraco/playwright-testhelpers";

You can then use it in your code like so:

let settingsSection = ConstantHelper.sections.settings;

Contributing to Umbraco.Playwright.Testhelpers

Adding new helpers

When adding new helpers, it is important to add them as properties in the ApiHelpers.ts class Lets say we have just created a MacroApiHelper, first we would need to import it at the top in the ApiHelpers.ts file like so:

import {MacroApiHelper} from "./MacroApiHelper";

Then, add it as a property

export class ApiHelpers {
  macros: MacroApiHelper;
  ...
 }

Then, use the constructor to populate the property

constructor(page: Page) {
    this.macros = new MacroApiHelper(this);
    ...
}

Testing your changes locally

When you have changes you want to test, you can run npm run build & npm pack in the root of this folder, You will need to copy the absolute path of the file you just created with npm pack. then run npm i absolute path to your file in the project where you are using this package. An example could be npm i C:\Users\ABC\Desktop\Umbraco.Playwright.Testhelpers\umbraco-playwright-testhelpers-1.0.0.tgz. If you have new changes, you can follow the same steps as before.

Keywords

FAQs

Last updated on 08 May 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc