{"schemaVersion":"1.0","canonicalUrl":"https://automationtester.in/failures/assertion-expected-received-mismatch","slug":"assertion-expected-received-mismatch","title":"Expected and received values differ","signature":"Expected: value Received: other-value","frameworks":["Jest","Playwright","pytest"],"classification":"assertion-mismatch","summary":"The observed application result does not match the contract encoded in the assertion.","causes":[{"title":"The product behavior regressed","explanation":"The implementation now returns or renders a value outside the intended contract.","diagnostic":"Reproduce through the public behavior and compare with the requirement or API contract.","fix":"Repair the product and keep the assertion as the regression guard."},{"title":"The assertion encodes stale behavior","explanation":"A deliberate contract change may not have updated the test.","diagnostic":"Review the approved change and confirm which behavior is authoritative.","fix":"Update the test only when the contract change is explicit and reviewed."},{"title":"Uncontrolled state changed the result","explanation":"Time, locale, random values, or shared records can make the observation vary.","diagnostic":"Repeat with controlled inputs and inspect state boundaries.","fix":"Control the source of variation and assert the meaningful contract."}],"prevention":["Tie assertions to reviewed contracts.","Control time, locale, and random sources.","Keep failure diffs focused."],"related":["test-data-unique-constraint","unhandled-promise-rejection"],"references":[{"label":"Jest expect matchers","url":"https://jestjs.io/docs/expect"}]}