1.0.2 • Published 2 years ago
@uctl/yida v1.0.2
🎭 @uctl/yida
YiDA UI Component Testing Library for E2E tests in playwright
Usage
1. install
npm i -D @uctl/yida
This installs Playwright and browser binaries for Chromium, Firefox and WebKit. Once installed, you can require
@uctl/yida 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/yida';
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');
})
}