What problem does it solve?
This skill eliminates flaky, unreliable tests caused by arbitrary sleep() or setTimeout() calls by replacing them with intelligent condition-based polling. This ensures tests pass consistently regardless of system speed, saving time and improving CI/CD reliability.
Core Features & Use Cases
- Reliable Condition Polling: Provides a generic
waitForCondition function to poll for specific conditions (e.g., element visibility, API response, state change) rather than guessing with fixed delays.
- Flaky Test Prevention: Makes tests robust against timing variations, preventing intermittent failures that waste CI/CD resources and developer time.
- Use Case: Instead of
await sleep(2000) after clicking a submit button, this skill guides you to await waitForElement('#success-message'), ensuring the test only proceeds when the success message is actually visible, making it reliable on both fast and slow systems.
Quick Start
I have an end-to-end test that intermittently fails because an element isn't visible yet. Use the condition-based-waiting skill to fix it.