@bigbinary/neeto-playwright-commons
v1.24.6
Published
A package encapsulating common playwright code across neeto projects.
Readme
neeto-playwright-commons
A library that packages common boilerplate Playwright code necessary for all neeto products.
Installing neeto-playwright-commons in a Playwright Project
First, navigate to the Playwright test directory:
cd playwright-testsThen, install the package using Yarn:
yarn add "@bigbinary/neeto-playwright-commons@latest"If neeto-playwright-commons is already listed in package.json of Playwright project, simply install dependencies with:
yarn installDependencies
neeto-playwright-commons has some peer dependencies which can be installed using the commands listed below:
neeto-cist
A collection of common utility functions used across all our neeto products. Try out the utility functions live at neetoCommons REPL.
yarn add @bigbinary/neeto-cistfaker
Faker is used to generate fake data.
yarn add @faker-js/fakerplaywright/test
yarn add @playwright/testlint-staged
Run linters against staged git files.
yarn add lint-stageddotenv-webpack
dotenv-webpack is a secure webpack plugin that supports
dotenv and other environment variables.
yarn add dotenv-webpackdayjs
Dayjs is a JavaScript library that parses, validates, manipulates, and displays dates and times.
yarn add dayjsramda
Ramda is a JavaScript library that facilitates functional programming in JavaScript. It provides a collection of utility functions that operate on data.
yarn add ramdaplaywright-i18next-fixture
Use your i18next translations in Playwright to create multi-language
selectors.
yarn add playwright-i18next-fixtureWe can install all the above peer dependencies by running a single command.
yarn add @bigbinary/neeto-cist @faker-js/faker @playwright/test lint-staged dotenv-webpack dayjs ramda playwright-i18next-fixtureExternal dependencies
Methods
MailerUtils
Note: ENV variables NEETO_AUTOMATION_FASTMAIL_API_KEY and
FASTMAIL_DOMAIN_NAME are required for this methods to work.
Slack integration methods
Note: Either ENV variables SLACK_WORKSPACE, SLACK_LOGIN_PASSWORD and
SLACK_LOGIN_EMAIL is required for this method to work or custom credentials
workspace, loginPassword and loginEmail must be passed.
Zapier integration methods
Note: ENV variables NEETO_AUTOMATION_FASTMAIL_API_KEY, FASTMAIL_DOMAIN_NAME, ZAPIER_LOGIN_EMAIL, ZAPIER_LOGIN_PASSWORD, and ZAP_ID are required for this methods to work.
Usage
You can import the utility functions and constants from the
@bigbinary/neeto-playwright-commons wherever required.
import { COMMON_SELECTORS } from "@bigbinary/neeto-playwright-common";Exported Functions
- Common default configurations
- Commons and Envs
- Routes
- Custom commands
- MailerUtils
- Util functions
- POMs
- Integration
- Selectors
- Texts
