Back to QA Automation

Automation Strategy

What tests are best to automate?
Repetitive tests (Regression), critical business paths, tests difficult to perform manually (e.g., precise data verification), and stable features.
How do you deal with Flaky Tests?
Identify the cause (environment, race conditions, locators). Isolate the test. Use explicit waits. Check execution mode (headless vs headed).
What is Data Driven Testing?
A strategy where test scripts read data from external sources (CSV, Excel, Database) instead of using hard-coded values, allowing the same test to run with multiple data sets.
What is the difference between CI, Continuous Delivery and Continuous Deployment?
CI (Continuous Integration) merges code changes frequently into a shared branch with automated build and tests on every integration. Continuous Delivery means the code can be deployed automatically but a human approves the release. Continuous Deployment means it deploys automatically whenever all checks pass, with no manual gate.
What are the typical stages of a CI/CD pipeline?
Commit, build/transpile, unit tests, integration tests, code quality (lint, coverage), security scan, E2E tests, deploy to staging, smoke tests, then a manual approval, deploy to production, and monitoring. Each stage is a quality gate; faster, cheaper checks run first so failures surface early.
What is the test pyramid?
A model for balancing test types: many fast, cheap unit tests at the base; fewer integration tests in the middle (testing communication between layers like API and DB); and few slow, expensive E2E tests at the top. Inverting it (mostly E2E) gives slow, flaky suites. It pairs with shift-left: catch bugs as early and cheaply as possible.
What are quality gates in a pipeline?
Conditions code must meet to advance: a minimum coverage threshold (e.g. 80%), zero critical vulnerabilities, zero failing tests, and clean linting. They enforce a consistent quality bar automatically and stop a bad change before it reaches production.
What is a flaky test and how do you reduce flakiness?
A flaky test passes or fails intermittently without a real code change. Common causes: race conditions/timing, inter-test dependencies, shared data, animations, and network instability. Fixes: replace fixed sleeps with condition-based waits (waitForSelector, waitForResponse), make each test independent, and mock unstable external APIs.
What deployment strategies should an SDET know?
Canary (release to a small percentage of users first, watch metrics, then ramp up), blue/green (two identical environments, switch traffic instantly and roll back by switching back), feature flags (turn features on/off without redeploying), and rollback (return to the previous version). Smoke tests run right after deploy to confirm the app starts.
What are the core building blocks of a GitHub Actions workflow?
A workflow (a YAML file in .github/workflows) runs on triggers (on: push, pull_request, schedule, workflow_dispatch). It contains jobs that run on a runner (ubuntu-latest), each with steps that either use an action (actions/checkout@v4, actions/setup-node@v4) or run a shell command. Jobs can depend on others with needs:, run configs in parallel with a matrix:, cache dependencies, and read secrets via ${{ secrets.NAME }}.
How should credentials be handled in CI?
Never put credentials in code or config files. Store them as masked secrets in the CI platform (GitHub: Settings -> Secrets) and reference them at runtime (${{ secrets.NAME }}). Scope them per environment, mark deployment secrets as protected, and keep them out of job logs.
How do you keep a slow E2E suite fast in CI?
Run independent test types as parallel jobs, cache dependencies (node_modules, browser binaries), and shard E2E runs across machines (e.g. Playwright --shard=1/4 with a matrix). Run unit tests first as a fast gate, and only run the expensive E2E stage after cheaper stages pass.