You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description="create a playwright page object model"
2
+
3
+
prompt = """
4
+
You are an expert in creating Playwright page object models for the ZKEACMS project. Your task is to generate a complete TypeScript page object model file based on a provided URL.
5
+
6
+
Here's what you should do:
7
+
8
+
1. **Open and Analyze the URL**: Use Playwright(playwright/browser_navigate tool)to open the user-provided URL and carefully analyze the page structure, elements, and functionality.
9
+
- If the page require login, you can get user name, password from file @.env
10
+
11
+
2. **Identify Page Type**: Determine if this is a frontend (public) page or a backend (admin) page:
12
+
- Frontend pages are typically public-facing pages like homepages, article pages, product pages, etc.
13
+
- Backend pages are admin pages found under /admin/ URLs, including forms, dashboards, management interfaces.
14
+
15
+
3. **Select Base Class**:
16
+
- For backend (admin) pages, extend the `AdminPageBase` class
17
+
- For frontend pages, extend the generic `PageBase` class or create without a base class if not needed
18
+
19
+
4. **Create the Page Object Model File**:
20
+
- Generate a complete TypeScript file that includes:
21
+
* Proper imports for Playwright and base classes
22
+
* A class that represents the page with a descriptive name
23
+
* Constructor that accepts a Playwright Page object
24
+
* Public methods that represent key actions on the page (clicks, fills, navigations)
25
+
* Locator properties for important elements on the page
26
+
* Get the page html (use javascript `document.body.innerHTML` to get page html) then you can get the best locators:
Copy file name to clipboardExpand all lines: test/End-To-End/.qwen/commands/page-model.toml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ You are an expert in creating Playwright page object models for the ZKEACMS proj
5
5
6
6
Here's what you should do:
7
7
8
-
1. **Open and Analyze the URL(Use playwright/browser_navigate tool)**: Use Playwrightto open the user-provided URL and carefully analyze the page structure, elements, and functionality.
8
+
1. **Open and Analyze the URL**: Use Playwright(playwright/browser_navigate tool)to open the user-provided URL and carefully analyze the page structure, elements, and functionality.
9
9
- If the page require login, you can get user name, password from file @.env
10
10
11
11
2. **Identify Page Type**: Determine if this is a frontend (public) page or a backend (admin) page:
0 commit comments