A full user flow
Chapter lab: Forms and flows
This lesson continues in the same lab as the lesson before it. If you don’t have it yet, download it here.
Or fetch and unpack it from a terminal in VS Code:
curl -fsSLO https://manykarim.github.io/robotframework-essentials-web/labs/ch09-web-flows.zip && unzip -q ch09-web-flows.zip && rm ch09-web-flows.zipInvoke-WebRequest https://manykarim.github.io/robotframework-essentials-web/labs/ch09-web-flows.zip -OutFile ch09-web-flows.zip; Expand-Archive ch09-web-flows.zip -DestinationPath .; Remove-Item ch09-web-flows.zipOpen the folder in VS Code with code rfe-ch09-web-flows (or File → Open Folder…) and accept the recommended RobotCode and Python extensions. Then set it up:
uv syncpython3 -m venv .venvsource .venv/bin/activatepip install -r requirements.txtpython -m venv .venv.venv\Scripts\Activate.ps1pip install -r requirements.txtKeep the environment active in every terminal where you run lesson commands.
poetry install --no-rootPython 3.13 or newer is required; uv installs it when it is missing.
Also needed for this lab
Install Node.js (an LTS release), then run once — it downloads a browser engine (large):
uv run rfbrowser init chromiumrfbrowser init chromiumpoetry run rfbrowser init chromiumStart the RF Demo Shop in its own terminal and keep it running while you work:
uv run python demo_app/serve.pypython demo_app/serve.pypoetry run python demo_app/serve.pyWhat's inside
Directoryrfe-ch09-web-flows/
Directory.vscode/
- extensions.json
Directorychecks/
- smoke.robot
Directorydemo_app/
- api.py
- serve.py
- store.py
- web.py
Directoryresources/
- shop.resource
- .gitignore
- .python-version
- LAB.md
- pyproject.toml
- README.md
- requirements.txt
- uv.lock
Now put it together: one customer, one journey — sign in, add an item, check out, and confirm the order. This is the test you tag as your smoke test later, because when it is green the core of the shop works.
Task 1 — Drive sign-in → cart → checkout → confirmation
Section titled “Task 1 — Drive sign-in → cart → checkout → confirmation”Goal: create checks/flow.robot that signs in, adds a product, goes to
checkout, fills the form, places the order, and asserts it reads complete.
Here is the same journey for a different customer buying a different product.
Adapt it to primary_user adding the travel mug.
Worked example — adapt it, don’t copy it
*** Settings ***Library BrowserResource ../resources/shop.resource
*** Test Cases ***Reviewer Buys A Backpack New Browser chromium headless=True New Context New Page ${BASE_URL}/login Fill Text data-testid=login-username reviewer_user Fill Text data-testid=login-password learning-password Click data-testid=login-submit Click data-testid=add-trail-backpack Get Text data-testid=cart-heading contains Cart Click data-testid=go-checkout Fill Text data-testid=checkout-first Grace Fill Text data-testid=checkout-last Hopper Click data-testid=place-order Get Text data-testid=order-status == complete Close BrowserDone when
the suite defines Customer Completes A Purchase.
Hint 1
After signing in, add the mug with Click data-testid=add-travel-mug, then
confirm the cart with Get Text data-testid=cart-heading contains Cart.
Hint 2
Go to checkout, fill checkout-first and checkout-last, Click data-testid=place-order,
then assert Get Text data-testid=order-status == complete.
Solution
*** Settings ***Library BrowserResource ../resources/shop.resource
*** Test Cases ***Customer Completes A Purchase New Browser chromium headless=True New Context New Page ${BASE_URL}/login Fill Text data-testid=login-username primary_user Fill Text data-testid=login-password learning-password Click data-testid=login-submit Click data-testid=add-travel-mug Get Text data-testid=cart-heading contains Cart Click data-testid=go-checkout Fill Text data-testid=checkout-first Ada Fill Text data-testid=checkout-last Lovelace Click data-testid=place-order Get Text data-testid=order-status == complete Close BrowserTask 2 — Run the full journey green
Section titled “Task 2 — Run the full journey green”Run:
uv run robot checksrobot checkspoetry run robot checksDone when
the purchase journey ends with order-status reading complete.
Check your understanding
Quick recall. Your first answer stays in this browser; the quiz never blocks your progress.
A good end-to-end test…
An end-to-end test walks a real journey — sign in, add to cart, check out — and asserts the final confirmation.
Show the answer
Answer: follows one real user journey and asserts the outcome — An end-to-end test walks a real journey — sign in, add to cart, check out — and asserts the final confirmation.
After placing the order, what confirms success?
The order page shows
order-status=completeonce the purchase goes through.Show the answer
Answer:
order-statusreadscomplete— The order page showsorder-status=completeonce the purchase goes through.
Key terms
- end-to-end flowconcept
- One user journey asserted from start to confirmation — tag it as your smoke test.