Lesson 24 — Your First Automated Test, Line by Line · Practical QA
LESSON VIEW
B-03 · BASIC · PRACTICAL QA

Lesson 24 — Your First Automated Test, Line by Line

Objective: Read a complete real test — TC-001 from the aomaai.com suite — and understand every line.

⏱ ≈4 min full lesson · Converted from the B-03 module deck · English edition — Español · العربية · বাংলা in translation

⚡ Key Points

  • Every test carries an ID — A test's title starts with its TC-ID — its permanent name.
  • Line 1: the declaration — test(...) declares a test. The title carries the ID.
  • The whole body: three lines — 1) Build the page object. 2) Go to the page.
  • async / await, in one breath — Loading a page takes time. await means: “wait until this step finishes before the next line.” async marks the function a…
  • Plug & chug: the three beats — Read any test aloud as ARRANGE → ACT → ASSERT.

📖 Read

In about 4 minutes: read a complete real test — TC-001 from the aomaai.com suite — and understand every line.

Every test carries an ID: A test's title starts with its TC-ID — its permanent name. The same ID lives in the test-case sheet and in the results, so one case keeps one identity everywhere it appears. TC-001 is this test, forever.

Line 1: the declaration: test(...) declares a test. The title carries the ID. And { page } is the browser page the framework hands you — your window into the DOM from B-02. Code: test("[TC-001] HomePage loads with its expected title and heading", async ({ page }) => {

The whole body: three lines: 1) Build the page object. 2) Go to the page. 3) Verify it loaded correctly. That's the entire test — three honest lines. Code: const po = new HomePage(page); | await po.goto(); | await po.expectLoaded();

async / await, in one breath: Loading a page takes time. await means: “wait until this step finishes before the next line.” async marks the function as one that's allowed to wait. Every test you'll ever read uses this pair.

Plug & chug: the three beats: Read any test aloud as ARRANGE → ACT → ASSERT. TC-001: arrange = new HomePage(page). Act = goto(). Assert = expectLoaded(). Pick any test in a suite and find its three beats — a beat is never missing, only hiding.

You can read a real test end to end. The OOP concept track (next door in the module map) makes the class behind HomePage fully clear — take it before B-05 when you get there.