Lighthouse
๐ฆ Lighthouse Performance Automation (WebdriverIO)
This module automates performance testing for key Toolstation NL web pages using Lighthouse and WebdriverIO. It validates that the performance of each page is above a defined threshold.
๐ File: LightHouse.js
The LightHouse class extends a custom WebdriverIO Page helper and defines structured performance tests for NL-based pages.
๐ Configured Page URLs
| Page Key | URL |
|---|---|
homepage_url | https://www.toolstation.nl |
plp_url | https://www.toolstation.nl/schroeven-bevestigingsmiddelen/schroeven/c630 |
pdp_url | https://www.toolstation.nl/dynaplus-universele-schroeven-platkop-deeldraad-verzinkt/p13010 |
signin_url | https://www.toolstation.nl/login |
signup_url | https://www.toolstation.nl/register |
logout_user_empty_trolley_url | https://www.toolstation.nl/trolley |
procard_builder_page_url | https://www.toolstation.nl/content/pro |
myaccount_url | https://www.toolstation.nl/account/home |
myaccount_savelists_url | https://www.toolstation.nl/account/saved-lists |
myaccount_orders_url | https://www.toolstation.nl/account/order-history |
myaccount_addresses_url | https://www.toolstation.nl/account/addresses |
checkout_page_url | https://www.toolstation.nl/checkout |
๐งช Test Group: NL Performance
This test group is focused on verifying the performance of various Toolstation NL pages. Each test checks that the Lighthouse performance score exceeds 50.
โ
Tests Included
| Count | Test Name | Test ID | URL |
|---|---|---|---|
| 1.1 | HomePage | HomePage | https://www.toolstation.nl |
| 1.2 | Product Listing Page | PLP | https://www.toolstation.nl/schroeven-bevestigingsmiddelen/schroeven/c630 |
| 1.3 | Product Details Page | PDP | https://www.toolstation.nl/dynaplus-universele-schroeven-platkop-deeldraad-verzinkt/p13010 |
| 1.4 | Sign-In Page | SignIn | https://www.toolstation.nl/login |
| 1.5 | Sign-Up Page | SignUp | https://www.toolstation.nl/register |
| 1.6 | Empty Trolley Page | EmptyTrolleyPage | https://www.toolstation.nl/trolley |
| 1.7 | Pro Card Builder Page | ProCardBuilderPage | https://www.toolstation.nl/content/pro |
โถ๏ธ Run Command
To run only the Lighthouse performance tests (identified by group ID LP), use:
npx wdio --mochaOpts.grep LP
This will execute only the performance group specified by the params.page.id value (LP).
โ
Compatible ChromeDriver
Lighthouse tests require a recent version of Chrome. Ensure your project uses the latest compatible ChromeDriver:
"chromedriver": "^137.0.1",
Install the latest version with:
npm install chromedriver@latest --save-dev
This keeps your ChromeDriver version aligned with the latest Chrome browser updates.
๐ Notes
- You can extend this module to support UK or other locales by adding new groups and URLs.
- Lighthouse reports can be enhanced with reporting tools like Allure or Mochawesome.
- Tests can be run headlessly via WebdriverIO for CI/CD integration.