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: packages/web-forms/e2e/README.md
+7-12
Original file line number
Diff line number
Diff line change
@@ -1,30 +1,30 @@
1
-
# E2E Tests for `@getodk/web-forms`
1
+
# E2E tests for `@getodk/web-forms`
2
2
3
3
This directory contains end-to-end (E2E) tests for the `@getodk/web-forms` package, which powers form filling and submission editing of ODK forms in a web browser. These tests use [Playwright](https://playwright.dev/) to simulate user interactions and ensure the package works as expected in real-world scenarios.
4
4
5
-
## Folder Structure
5
+
## Folder structure
6
6
7
7
The E2E tests are located in `packages/web-forms/e2e/`. Here's the structure and purpose of each directory:
8
8
9
9
```
10
10
e2e/
11
11
├── fixtures/ # Sample forms and data for testing.
12
12
├── page-objects/ # Page Object Model structure for e2e tests, organizing UI abstractions into pages and reusable controls.
13
-
├── controls/ # Reusable controls such as form fields, UI components, etc.
14
-
├── GeopointComponent.ts # Example of a reusable control for the geopoint question type.
13
+
├── controls/ # Reusable controls such as form fields, UI elements, etc.
14
+
├── GeopointControl.ts # Example of a reusable control for the geopoint question type.
15
15
├── pages/ # Full page representations.
16
16
├── FormPage.ts # Example of a full page representation for a form.
17
17
├── specs/ # Test specification files.
18
18
├── geopoint.test.ts # Example of a test file for the geopoint question type.
19
19
```
20
20
21
-
### Key Components
21
+
### Key concepts
22
22
23
23
-**Fixtures**: Reusable test data (e.g., sample XForms) to simulate real-world use cases. Add new forms here as needed.
24
24
-**Page Objects**: Implements the [Page Object Model (POM)](https://playwright.dev/docs/pom) pattern to encapsulate UI interactions, enhancing test readability and maintainability.
25
25
-**Specs**: Test files organized by feature (e.g., rendering, submission). Name new tests descriptively to reflect their coverage.
26
26
27
-
## Getting Started
27
+
## Getting started
28
28
29
29
1.**Build the project**
30
30
In the root folder run:
@@ -46,13 +46,8 @@ e2e/
46
46
yarn workspace @getodk/web-forms test:e2e <filepath, e.g. e2e/specs/geopoint.test.ts>
47
47
```
48
48
49
-
3.**Add new tests**
50
-
- Create fixtures in `fixtures/` if needed.
51
-
- Update or add Page Objects in `page-objects/` for new UI elements.
52
-
- Write tests in `specs/` with descriptive names.
53
-
54
49
## Contributing
55
50
56
-
- Keep tests focused: one feature per file.
51
+
- Keep tests focused.
57
52
- Use POM methods in `pages-objects/` for UI actions.
58
53
- Add fixtures for new scenarios instead of hardcoding data.
0 commit comments