Lesson 48 — Git & Pull Requests: Getting Your Tests Reviewed and Merged · Practical QA
LESSON VIEW
LAB-9 · AUTOMATION PRACTICE LAB · PRACTICAL QA

Lesson 48 — Git & Pull Requests: Getting Your Tests Reviewed and Merged

Objective: Use Git the way working QA engineers do: clone, branch, commit a test change with a traceable message, open a pull request that states risk and evidence, review someone else's test change line by line, and respond to review comments with a fix commit.

⏱ ≈2 h practice unit · Local-first: no account required · English edition — Español · العربية · বাংলা in translation

🧽 The practice business: FreshNest Home Cleaning — a fictional local cleaning company (owner: Maya Torres) invented for this course. Every example and exercise uses FreshNest, so you learn on a complete, realistic business without ever touching a real one.

⚡ Key Points

  • A commit message says what changed and why — traceable to a requirement or case ID.
  • A branch isolates your work; a pull request is the proposal + the review conversation + the checks.
  • A PR description answers: which rule, what evidence, what risk.
  • Review hunts oracles first: would this test fail if the product were wrong?
  • Never commit secrets, junk, or machine-specific paths. Main stays runnable.

📖 Read

Every test you have written in this lab lives in files, and files that matter live in Git. Git is the team's memory of what changed, when, why, and who approved it. Four ideas carry the whole practice. A repository is the project plus its full history. A commit is one recorded change with a message that must say what and why — future you, bisecting a failure at midnight, is the audience. A branch is your own line of work that cannot hurt anyone else's until it is merged. And a pull request is the proposal to merge a branch, with the conversation about it attached: description, line-by-line review, automated checks, and the record of who said yes. Tests earn extra from this discipline because a test change is a claim about the product's rules — reviewers are not checking your typing, they are checking your oracle.

The working loop is always the same shape: clone or pull the latest main; create a branch named for the work (add-val-003-boundary, not my-branch); make the change small and single-purpose; commit in steps a reviewer can follow; push the branch; open the PR with a description that answers three questions — what rule does this test enforce, what evidence shows it works (the run against the buggy build fails for the right reason, the fixed build passes), and what is the risk if it is wrong. Then review happens to you: comments are about the change, not about you; you respond with new commits on the same branch (the PR updates itself), resolve conversations, and merge only when checks pass and a human has approved. The mirror skill is reviewing others: read the requirement first, then the diff, and hunt the three classic test-review findings — an inverted or missing oracle (the test would pass if the product were wrong), missing boundary values the case name promises, and assertions too weak to catch the defect the case exists for.

Two habits separate professionals from tourists. Never commit secrets, generated junk, or machine-specific paths — the class of mistake this very course once shipped in a Playwright config is the canonical example: a browser path from one machine, committed, breaking the project on every other machine. And keep main always runnable: if your branch breaks the suite, that is your branch's problem to fix before merge, never a surprise to leave in main. CI on the PR (LAB-8) is the machine half of this gate; review is the human half.