leptos/examples/suspense_tests/e2e
Joseph Cruz 00ac66e450
refactor(verify-changed-examples): improve readability and runtime (#1556)
* refactor(workflows): split setup

* test((verify-changed-examples): simulate  change

* refactor(verify-changes-examples): inline os setup

* refactor(verify-changed-examples): skip w/o change

* chore(verify-changed-examples): remove simulated change

* refactor(verify-changed-examples): revert inline

* refactor(verify-changes-examples): extract example changed

* fix(verify-changed-examples): pull up example changed

* refactor(verify-change-examples): extract matrix

* refactor(verify-changed-examples): pass input

* refactor(verify-changed-examples): rename workflow

* ci(workflows): install chromedriver if needed

* fix(ci-changed-examples): pass input from json

* perf(run-cargo-make-task): maybe install chromedriver

* fix((run-cargo-make-task): maybe install chromedriver

* perf(run-cargo-make-task): maybe install playwrigh deps

* fix(run-cargo-make-task): maybe install playwrigh deps

* chore(suspsense_tests): retry e2e

* refactor(verify-changed-examples): rename calls

* refactor(run-cargo-make-test): remove playwright count
2023-08-22 21:22:13 -04:00
..
features test(suspense-tests): add e2e tests (Closes #1519) (#1533) 2023-08-15 06:19:20 -04:00
tests test(suspense-tests): add e2e tests (Closes #1519) (#1533) 2023-08-15 06:19:20 -04:00
Cargo.toml test(suspense-tests): add e2e tests (Closes #1519) (#1533) 2023-08-15 06:19:20 -04:00
Makefile.toml refactor(verify-changed-examples): improve readability and runtime (#1556) 2023-08-22 21:22:13 -04:00
README.md test(suspense-tests): add e2e tests (Closes #1519) (#1533) 2023-08-15 06:19:20 -04:00

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