Test

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 KeyURL
homepage_urlhttps://www.toolstation.nl
plp_urlhttps://www.toolstation.nl/schroeven-bevestigingsmiddelen/schroeven/c630
pdp_urlhttps://www.toolstation.nl/dynaplus-universele-schroeven-platkop-deeldraad-verzinkt/p13010
signin_urlhttps://www.toolstation.nl/login
signup_urlhttps://www.toolstation.nl/register
logout_user_empty_trolley_urlhttps://www.toolstation.nl/trolley
procard_builder_page_urlhttps://www.toolstation.nl/content/pro
myaccount_urlhttps://www.toolstation.nl/account/home
myaccount_savelists_urlhttps://www.toolstation.nl/account/saved-lists
myaccount_orders_urlhttps://www.toolstation.nl/account/order-history
myaccount_addresses_urlhttps://www.toolstation.nl/account/addresses
checkout_page_urlhttps://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

CountTest NameTest IDURL
1.1HomePageHomePagehttps://www.toolstation.nl
1.2Product Listing PagePLPhttps://www.toolstation.nl/schroeven-bevestigingsmiddelen/schroeven/c630
1.3Product Details PagePDPhttps://www.toolstation.nl/dynaplus-universele-schroeven-platkop-deeldraad-verzinkt/p13010
1.4Sign-In PageSignInhttps://www.toolstation.nl/login
1.5Sign-Up PageSignUphttps://www.toolstation.nl/register
1.6Empty Trolley PageEmptyTrolleyPagehttps://www.toolstation.nl/trolley
1.7Pro Card Builder PageProCardBuilderPagehttps://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.


Copyright ยฉ 2026