Assertion
Automation
// Definition
A statement in a test that checks an expected condition holds. If it doesn't, the test fails. The core of every automated test.
// Code Example
CypressAssertions in Cypress
TypeScript// Assert element visibility and text
cy.get('[data-testid="welcome"]')
.should('be.visible')
.and('contain', 'Welcome to qa.codes');
// Assert API response status
cy.request('/api/tools')
.its('status')
.should('eq', 200);// Related terms
Test Case
A single, executable specification: preconditions, steps, expected result, and pass/fail criteria for one verification.
Auto-waiting
A framework feature that pauses an action until the target element is actionable (visible, enabled, stable). Eliminates most need for explicit sleeps and reduces flake.
Test Suite
A collection of related test cases organised for execution together — usually grouped by feature, layer (unit, integration, e2e), or test type (smoke, regression).
Learn more · JavaScript for QA
Chapter 6 · Lesson 4: How Automation Frameworks Interact With the DOM