원클릭으로
create-playwright-page-model
// Use when creating a Playwright page object model for a ZKEACMS page from a URL or live page inspection.
// Use when creating a Playwright page object model for a ZKEACMS page from a URL or live page inspection.
| name | create-playwright-page-model |
| description | Use when creating a Playwright page object model for a ZKEACMS page from a URL or live page inspection. |
Create a complete TypeScript page object model for a ZKEACMS page by inspecting the target page, determining whether it is an admin or frontend page, and writing a stable model in the correct project folder.
Plesease use playwright/* tools (NOT @playwright/test framework) to opoen/inspect the page.
Use this skill when the task is to:
src/admin/ or src/models/PageBase or AdminPageBase conventions.env when the target is behind authenticationdocument.body.innerHTML.env and sign in using the existing admin flow./admin/ use AdminPageBasePageBasedata-testidnth() only when the page structure is intentionally indexedPagesrc/admin/ for admin pagessrc/models/ or a relevant subdirectory for frontend pagesPrefer the following patterns in order:
page.locator('[data-testid="..."]')page.getByRole('button', { name: 'Save' })page.getByText('Title')page.locator('#Id')page.locator('.class')page.locator('.item').nth(0)page.locator('.item', { hasText: 'Item 1' })page.locator('.item', { has: page.locator('img') })Do not use [ref="..."] selectors.
When the page is administrative:
AdminPageBasenavigateTo()When the page is public-facing:
PageBasenavigateTo() when the page has a stable pathThe skill is complete when the generated page object model:
import { Page } from '@playwright/test';
import { AdminPageBase } from '@models/AdminPageBase';
export class ArticleManagementPage extends AdminPageBase {
readonly titleField = this.page.locator('#Title');
constructor(page: Page) {
super(page);
}
async navigateTo(): Promise<void> {
await this.page.goto('/admin/article');
}
}