You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: .resolves.not and .rejects.not pass when a promise settles the wrong way #44331
Both tests should fail. The first promise rejects, so .resolves has no value to compare. The second fulfills, so .rejects has no rejection reason to match. Adding .not should only negate the matcher after the promise settles the expected way. This follows the documented behavior of .resolves and .rejects.
Actual behavior
The runner reports 2 passed and exits with status 0. Removing only .not from both assertions produces the expected errors: Received promise rejected instead of resolved and Received promise resolved instead of rejected.
Additional context
The same two tests fail as expected on 1.56.1. Both pass on 1.64.1, 1.65.1, and 1.66.0-alpha-2026-11-23.
Hi, I'm the Playwright bot and I reproduced this on Linux.
Reproduced on 1.60.0, 1.65.1, and current source (d70f422f491cfb875dd5dc05f01c61207e7382b4). Both assertions fail correctly on 1.59.1. The promise checks return a failed matcher result, which .not then turns into success. The proposed fix keeps wrong settlement and non-promise input as errors, without changing negation after the expected settlement.
These are separate tests and need no browser. Both fail on 1.59.1, but pass incorrectly on 1.60.0 and 1.65.1. Removing .not makes both fail on all three versions. Valid negated assertions, including functions returning promises, pass on all three versions and with the fix.
On current source, the extended regression test fails without the fix and passes with it. It also checks that .resolves.not rejects non-promise input. The regression was introduced by #40301.
With the fix: all 90 tests in the five assertion suites pass; all 834 built-in assertion checks across Chromium, Firefox, and WebKit projects pass; the build and npm run flint pass. The promise regression itself is independent of browsers.
Activity
microsoft-playwright-automation commentedon Nov 24, 2026
microsoft-playwright-automation commentedon Nov 24, 2026
Hi, I'm the Playwright bot and I reproduced this on Linux.
Reproduced on 1.60.0, 1.65.1, and current source (
d70f422f491cfb875dd5dc05f01c61207e7382b4). Both assertions fail correctly on 1.59.1. The promise checks return a failed matcher result, which.notthen turns into success. The proposed fix keeps wrong settlement and non-promise input as errors, without changing negation after the expected settlement.Reproduction and checks
These are separate tests and need no browser. Both fail on 1.59.1, but pass incorrectly on 1.60.0 and 1.65.1. Removing
.notmakes both fail on all three versions. Valid negated assertions, including functions returning promises, pass on all three versions and with the fix.On current source, the extended regression test fails without the fix and passes with it. It also checks that
.resolves.notrejects non-promise input. The regression was introduced by #40301.With the fix: all 90 tests in the five assertion suites pass; all 834 built-in assertion checks across Chromium, Firefox, and WebKit projects pass; the build and
npm run flintpass. The promise regression itself is independent of browsers.Draft PR: #44335
Triaged on Linux by the Playwright bot - agent run
fix(expect): preserve promise failures with negated matchers