Automation Testing Tutorial
Automate tests with Selenium, Playwright, xUnit, Jest and API tests — page objects, BDD, CI pipelines, flaky tests and performance testing.
- Topics
- 24
- Full lessons
- 24
- Est. hours
- ~4
- Interview Qs
- 10
Overview
Test automation uses code to run checks repeatedly and reliably, so every change can be verified in minutes instead of days.
This track starts with what to automate and the test pyramid, then builds real suites with Selenium WebDriver and Playwright, unit tests with xUnit and Jest, API tests, BDD with Gherkin, and runs them all in CI with clear reports.
What you will learn
- Choose what to automate using the test pyramid
- Write reliable UI tests with Selenium and Playwright
- Automate unit and API tests
- Run suites in CI, report results and fix flaky tests
Prerequisites
You will get the most from this track if you already know:
Learning path
The recommended sequence, from beginner to advanced. Each stage builds on the one before.
- 1Foundations · 4 topics · BeginnerIntroduction to Test Automation · What to Automate · Test Automation Pyramid · Choosing a Framework
- 2Selenium WebDriver · 4 topics · Beginner → IntermediateSelenium WebDriver Setup · Locators · Waits · Page Object Model
- 3Playwright · 3 topics · IntermediatePlaywright Fundamentals · Playwright Locators and Assertions · Playwright Test Runner
- 4Unit & API Tests · 4 topics · IntermediateUnit Testing with xUnit · Unit Testing with Jest · API Test Automation · Mocking and Test Doubles
- 5Professional Practice · 7 topics · Intermediate → AdvancedTest Data Management · BDD with Gherkin · Cross-Browser Testing · Test Reporting · CI Integration · Flaky Tests · Performance Testing with k6
- 6Practice · 2 topics · AdvancedAutomation Framework Project · Interview Questions
Complete topic list
24 topicsFoundations
4 topics- Introduction to Test AutomationBeginner5m
- What to AutomateBeginner5m
- Test Automation PyramidBeginner5m
- Choosing a FrameworkBeginner5m
Selenium WebDriver
4 topics- Selenium WebDriver SetupBeginner5m
- LocatorsBeginner5m
- WaitsIntermediate5m
- Page Object ModelIntermediate5m
Playwright
3 topics- Playwright FundamentalsIntermediate5m
- Playwright Locators and AssertionsIntermediate5m
- Playwright Test RunnerIntermediate5m
Unit & API Tests
4 topics- Unit Testing with xUnitIntermediate5m
- Unit Testing with JestIntermediate5m
- API Test AutomationIntermediate5m
- Mocking and Test DoublesIntermediate5m
Professional Practice
7 topics- Test Data ManagementIntermediate5m
- BDD with GherkinIntermediate5m
- Cross-Browser TestingAdvanced5m
- Test ReportingAdvanced5m
- CI IntegrationAdvanced5m
- Flaky TestsAdvanced5m
- Performance Testing with k6Advanced5m
Practice
2 topics- Automation Framework ProjectAdvanced5m
- Interview QuestionsAdvanced15m
Code example
A taste of the track, from Introduction to Test Automation.
import { test, expect } from '@playwright/test';
test('home page shows the tagline and search', async ({ page }) => {
await page.goto('https://techiebabaji.com/');
await expect(page).toHaveTitle(/Techie Babaji/);
await expect(page.getByRole('searchbox').first()).toBeVisible();
});
// npm init playwright@latest → npx playwright test
Running 1 test using 1 worker ✓ 1 [chromium] › home.spec.ts:3:5 › home page shows the tagline and search (1.2s) 1 passed (2.4s)
Practice exercises
Name one test you should not automate.
A tax rule has 30 combinations to check every release. Automate at UI or API level?
Where should “email address must contain @” be tested?
Your team builds React apps in TypeScript. Which UI tool would you trial first?
Run the same test in Firefox.
Write a CSS selector for <input name="search" type="search">.
Show all 23 exercises
Wait until a button with id "pay" is enabled.
Add a SearchFor(term) action to a HeaderComponent that returns a ResultsPage.
Run only tests whose title contains “search”.
Assert that a “Delete” button inside the Mouse row is disabled.
Run only the mobile project.
Add a test row proving an unknown coupon gives no discount.
Assert that an array contains "React".
Add a test that GET /api/products/999999 returns 404.
Stub ChargeAsync to fail and assert PlaceOrderAsync returns false and sends no email.
Why should test-support endpoints be disabled in production?
Write a Given/When/Then scenario for a locked account.
Which Playwright engine represents Safari?
Configure Playwright to keep screenshots only for failed tests.
Run tests nightly at 2:00 UTC in GitHub Actions.
A test fails only after midnight UTC. What is the likely cause?
Change the script into a spike test: 0 → 300 users in 10 seconds, hold 1 minute.
Run only tests tagged @smoke.
Common interview questions
- What should and should not be automated?
- What is the test automation pyramid?
- Which Selenium locators do you prefer and why?
- Explain implicit vs explicit waits in Selenium.
- What is the Page Object Model?
- Why is Playwright less flaky than many older UI tools?
- What are mocks, stubs and fakes?
- How do you automate API tests?
- How do you deal with flaky tests?
- How do you integrate automated tests into CI/CD?