BaseTest
4 min
this class is responsible for initializing and managing the selenium test environment for gauge based tests all tests are executed on a remote selenium grid / testinium grid using testiniumseleniumdriver the webdriver lifecycle is managed at the suite level, meaning a single browser session is shared across all scenarios in the test suite responsibilities the basetest class provides the following core responsibilities initializing the selenium webdriver once per test suite configuring browser specific options (chromeoptions) integrating with the testinium platform via testiniumseleniumdriver managing the webdriver lifecycle using gauge hooks loading and managing the element repository from json files providing shared access to webdriver and actions instances suite lifecycle management @beforesuite this method is executed once before all gauge specifications and scenarios its responsibilities include resolving the remote selenium grid url from environment variables resolving the testinium authentication key creating and configuring chromeoptions initializing the testiniumseleniumdriver creating a shared actions instance loading the element repository (elementvalues) into memory because @beforesuite is used, all scenarios share the same webdriver session, which aligns with an all in one execution model @aftersuite this method is executed once after all gauge specifications and scenarios are completed its responsibilities include gracefully terminating the webdriver session releasing selenium grid resources preventing stale browser sessions and memory leaks browser configuration browser configuration is centralized in the buildchromeoptions method configured options include disabling browser translation prompts disabling notifications allowing cross origin and insecure content (when required by test environments) this approach ensures all browser related configurations are managed in a single, reusable location