Installation đ
Hey there, buddy! đ Get ready to plug in and power up with plugandplaywright - your new best friend in the coding universe! đ Imagine diving into a world where your code doesn't just run; it practically dances off the screen, turning every test into a thrilling adventure of precision and pizzazz. đ
đ Let's Spark Things Up - Quick Setupâ
Jump right in with these simple steps to add some spark to your Playwright scripts! It's like giving your automation a supercharge of excitement:
- npm
- yarn
- pnpm
npm i plugandplaywright
yarn add plugandplaywright
pnpm add plugandplaywright
And hey, let's make sure you're all set up with Playwright too:
- npm
- yarn
- pnpm
npm init playwright@latest
yarn create playwright
pnpm create playwright
đ Basic Charms to Light Up Your Tests
plugandplaywright
is here to enchant your testing toolkit with some electrifying spells đŠī¸ - think of getText
, getHeading
, and clickLink
as your magic wands, letting you interact with your web pages in the most delightful way.
import { test, expect } from '@playwright/test';
import { getText, getHeading, clickLink } from 'plugandplaywright';
test('Checkout the DOM', async ({ page }) => {
await page.goto('https://your-target-website.com/');
// Whisper sweet nothings to your elements
await getText(page, "Find me if you can");
await getHeading(page, "Greetings, mortal");
await clickLink(page, "Follow me");
});