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
Copy file name to clipboardExpand all lines: e2e_tests/BEST_PRACTICES.md
+58-1Lines changed: 58 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,61 @@
1
1
# E2E Tests Best Practices
2
2
3
-
## Page Object Navigation Patterns
3
+
## Page Object Model Usage
4
+
5
+
Page objects should always be used where possible, as recommended by the [Playwright Page Object Model documentation](https://playwright.dev/docs/pom). Page objects represent parts of your web application and encapsulate common operations, element selectors, and assertions into a higher-level API. This simplifies test authoring, improves maintainability, and reduces code duplication.
6
+
7
+
### What Should Go into a Page Function
8
+
9
+
Page functions should encapsulate actions, assertions, and navigation logic related to a specific page or component. Examples include:
10
+
11
+
-**Actions**: Methods that perform user interactions, such as filling forms, clicking buttons, or navigating.
Tests should instantiate the page object and call its methods instead of directly interacting with the `page` object. This promotes reusability and keeps tests focused on high-level behavior.
49
+
50
+
```typescript
51
+
test("should save llm provider", async ({ page }) => {
0 commit comments