mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 14:54:16 +00:00
a8e25af523
* ci: run ci examples on leptos change * chore(ci): simulate leptos source change * ci(todo_app_sqlite_csr): increase retries * ci: delete check examples workflow * ci: rename ci examples workflow * ci: run ci examples with stable toolchain * chore(ci): remove simulated change * ci: delete check stable workflow |
||
---|---|---|
.. | ||
features | ||
tests | ||
Cargo.toml | ||
Makefile.toml | ||
README.md |
E2E Testing
This example demonstrates e2e testing with Rust using executable requirements.
Testing Stack
Role | Description | |
---|---|---|
Cucumber | Test Runner | Run Gherkin specifications as Rust tests |
Fantoccini | Browser Client | Interact with web pages through WebDriver |
Cargo Leptos | Build Tool | Compile example and start the server and end-2-end tests |
chromedriver | WebDriver | Provide WebDriver for Chrome |
Testing Organization
Testing is organized around what a user can do and see/not see. Test scenarios are grouped by the user action and the object of that action. This makes it easier to locate and reason about requirements.
Here is a brief overview of how things fit together.
features
└── {action}_{object}.feature # Specify test scenarios
tests
├── fixtures
│ ├── action.rs # Perform a user action (click, type, etc.)
│ ├── check.rs # Assert what a user can see/not see
│ ├── find.rs # Query page elements
│ ├── mod.rs
│ └── world
│ ├── action_steps.rs # Map Gherkin steps to user actions
│ ├── check_steps.rs # Map Gherkin steps to user expectations
│ └── mod.rs
└── app_suite.rs # Test main