# Rondleysg QA Agents Wdio Skill QA Wdio Add Setup

> Add setup / hooks (E2E WebdriverIO)

- Skill: `tomevault-io/rondleysg-qa-agents-wdio-skill-qa-wdio-add-setup` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/rondleysg-qa-agents-wdio-skill-qa-wdio-add-setup`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/rondleysg-qa-agents-wdio-skill-qa-wdio-add-setup/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/rondleysg-qa-agents-wdio-skill-qa-wdio-add-setup

---


# Add setup / hooks (E2E WebdriverIO)

No WebdriverIO não existem "fixtures" no sentido Playwright. O equivalente é **hooks no config** e **helpers de setup**.

## Onde

- **Hooks globais:** __tests__/e2e/config/wdio.shared.conf.ts (ou wdio.android.conf.ts, wdio.ios.conf.ts). Propriedades: `before`, `after`, `beforeSuite`, `afterSuite`, `beforeTest`, `afterTest`. Todas podem ser `async` e usar `await`.
- **Setup por suite/spec:** Dentro do arquivo de spec, usar `before()`/`after()` do Mocha no `describe()` e chamar funções de **__tests__/e2e/helpers/** (ex.: loginApp, flushRedisCache) para evitar duplicação.

## Hooks no config

- **before / after:** Executados uma vez por worker (antes de todos os specs / depois de todos os specs). Acesso a `capabilities`, `specs`; para interagir com dispositivo, usar `getDeviceFromCapabilities('deviceA')` (import de helpers/Utils).
- **beforeSuite / afterSuite:** Por suite Mocha. Recebem objeto `suite`.
- **beforeTest / afterTest:** Por teste. Úteis para screenshot em falha, limpeza, etc.
- Manter export do config; não remover hooks existentes sem necessidade.

## Helpers de setup

- Funções reutilizáveis em __tests__/e2e/helpers/ (ex.: Utils.ts com loginApp, flushRedisCache, reLaunchApp). Nos specs, importar e chamar no `before()` do describe quando vários testes precisarem do mesmo setup.

## Checklist

- [ ] Setup global → config (wdio.shared.conf.ts ou específico)
- [ ] Setup por fluxo/suite → before()/after() no describe + helpers
- [ ] Uso de async/await em hooks

## References

- Config: __tests__/e2e/config/wdio.shared.conf.ts
- Helpers: __tests__/e2e/helpers/Utils.ts, Manager.ts

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/rondleysg) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-15 -->

