1.0.0 • Published 2 years ago
@uctl/playwright v1.0.0
🎭 @uctl/playwright
UI Component Testing Library for E2E tests in playwright
Usage
1. install
npm i -D @uctl/playwright
This installs Playwright and browser binaries for Chromium, Firefox and WebKit. Once installed, you can require
@uctl/playwright in a Node.js script and automate web browser interactions.
2. config
3. Examples
This code snippet navigates to YiDA Developer Center in Chromium, Firefox and WebKit, and tests DateField component for E2E tests.
import { test, expect, Page } from '@playwright/test';
import { YiDA } from '@uctl/playwright';
test.describe('YiDA', () => {
test.only('DateField', async ({ page }) => {
await page.goto('https://www.aliwork.com/developer/date-field');
const date = new YiDA.DateField(page.locator('.DatePicker_jsu2g4k0'))
await date.setValue('2027-12-11 04:08:34');
await expect(await date.getValue()).toEqual('2027-12-11 04:08:34');
const date2 = new YiDA.DateField(page.locator('.DatePicker_jsu2g4k1'))
await date2.setValue('2037-09')
await expect(await date2.getValue()).toEqual('2037-09');
})
}
1.0.0
2 years ago