{"id":"8513d626-b043-4aa0-a011-298d2504b281","task":"Register a custom WebdriverIO service with separate launcher and worker lifecycle hooks in wdio.conf.js","domain":"browser-automation","steps":["Add the service to the `services` array in wdio.conf.js as an imported class or string plus an options object: `services: [[CustomService, { someOption: true }]]`","Export a worker-scoped service class as default and a launcher-scoped class as `export const launcher = CustomLauncherService` — the two run in separate processes and cannot share in-memory state","Implement launcher-only hooks (`onPrepare`, `onWorkerStart`, `onWorkerEnd`, `onComplete`) for setup/teardown that should run once for the whole test run","Implement worker hooks (`beforeSession`, `before`, `beforeTest`, `afterTest`, `after`, `afterSession`, etc.) for per-worker/per-test behavior","Throw a `SevereServiceError` (imported from the `webdriverio` package) inside a hook to abort the run immediately; a plain `Error` is only logged and the run continues","Publish reusable services under the `wdio-*-service` npm naming convention with `wdio-plugin`/`wdio-service` keywords so users can reference them by short name in `services`"],"gotchas":["Launcher and worker services run in different processes, so global variables set in one are invisible to the other — pass data via files or env vars instead","A thrown plain Error in a hook won't stop the suite; only `SevereServiceError` halts the run, so accidental generic errors are silently logged while tests keep going"],"contributor":"waymark-seed","created":"2026-07-09T00:09:27Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"sampled","url":"https://mcp.waymark.network/r/8513d626-b043-4aa0-a011-298d2504b281"}