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
│ ├── repositoriesPage.ts # Repositories list page
125
118
│ ├── repositoryPage.ts # Single repository (facade)
@@ -144,6 +137,106 @@ test/e2e/
144
137
└── revertCommit.spec.ts # Revert commit tests
145
138
```
146
139
140
+
## Design Principles
141
+
142
+
### Fixtures over manual construction
143
+
144
+
Tests receive POMs via [Playwright fixtures](https://playwright.dev/docs/test-fixtures) instead of constructing them manually. Import `test` and `expect` from `../fixtures`, not from `@playwright/test`:
Use Playwright's auto-retrying assertions. Never use `.isVisible()`, `.isEnabled()`, or `.isDisabled()` as assertions — they return a boolean instantly without waiting:
190
+
191
+
```ts
192
+
// Good — auto-retries until timeout
193
+
awaitexpect(element).toBeVisible();
194
+
awaitexpect(button).toBeDisabled();
195
+
196
+
// Bad — returns true/false immediately, no retries
197
+
awaitelement.isVisible();
198
+
```
199
+
200
+
Similarly, for counting elements, use `expect.poll()`:
### REST API for test setup, UI for test assertions
211
+
212
+
Use `lakeFSApi` (via the fixture) to set up preconditions like creating repositories. Use the UI to verify behavior. This keeps tests fast and focused on what they're actually testing.
213
+
214
+
## Adding a New Test
215
+
216
+
1. Create a spec file in `common/` (e.g., `common/myFeature.spec.ts`).
217
+
218
+
2. Import from fixtures, not from `@playwright/test`:
219
+
```ts
220
+
import { test, expect } from"../fixtures";
221
+
```
222
+
223
+
3. Destructure the fixtures you need:
224
+
```ts
225
+
test("should do something", async ({ repositoryPage, lakeFSApi }) => {
226
+
// lakeFSApi for setup, repositoryPage for UI interaction
227
+
});
228
+
```
229
+
230
+
4. If you need new UI operations, add methods to the appropriate sub-POM under `poms/`. If the operations don't fit an existing sub-POM, create a new `*Operations.ts` file, add it as a property on `RepositoryPage`, and register it as a fixture in `fixtures.ts` if it needs to be used directly.
231
+
232
+
5. If you need new API operations, add methods to `LakeFSApi` in `lakeFSApi.ts`.
233
+
234
+
6. For features unsupported by the local block adapter, tag the test with `@exclude-local`:
0 commit comments