Run a practical lab
1. Prepare your environment
Follow the official installation guide for current Node.js and operating-system requirements. Use a separate practice project, select TypeScript or JavaScript and run the generated example before adding application tests.
2. Describe the behaviour
For checkout, state the starting cart, action and expected total. Include an error case such as a required field left empty. A passing click alone does not establish that an order was created correctly.
3. Locate, act and assert
Prefer locators based on user-facing roles and labels where appropriate. Web-first assertions retry while waiting for the expected state. Avoid substituting arbitrary delays for a clear check of the result.
4. Control setup and investigate failures
Fixtures can provide setup and cleanup. Keep tests independent and give each scenario predictable data. When a run fails, inspect the trace and application behaviour before deciding whether the test or product needs correction.
Official references
Use these sources for current API behaviour and setup requirements. SPOTHUB is an independent training provider.
