@@ -4725,6 +4725,11 @@ test('CAPTCHA dialog parsing handles descendant-only labels and escaped quotes',
47254725 label: 'Verify that you\u2019re a human',
47264726 normalized: /verify that you re a human/,
47274727 },
4728+ {
4729+ tree: 'dialog "reCAPTCHA challenge" [ref_8]',
4730+ label: 'reCAPTCHA challenge',
4731+ normalized: /recaptcha challenge/,
4732+ },
47284733 ];
47294734 for (const [build, gate] of [['chrome', CaptchaGateCh], ['firefox', CaptchaGateFx]]) {
47304735 for (const example of cases) {
@@ -4776,6 +4781,11 @@ test('CAPTCHA mutation preflight ignores hidden and off-viewport verification di
47764781 ], async () => {
47774782 assert.equal(gate.detectChallengeDialogInPage()?.label, 'Verify you are a human', `${build}: article-bearing challenge dialog was missed`);
47784783 });
4784+ await withCaptchaFakePage(build, [
4785+ captchaEl('div', { role: 'dialog', innerText: 'reCAPTCHA' }),
4786+ ], async () => {
4787+ assert.equal(gate.detectChallengeDialogInPage()?.label, 'reCAPTCHA', `${build}: branded reCAPTCHA dialog was missed`);
4788+ });
47794789 await withCaptchaFakePage(build, [
47804790 captchaEl('div', { role: 'dialog', innerText: 'Email verification failed' }),
47814791 ], async () => {
@@ -4969,18 +4979,8 @@ test('one CAPTCHA solve remains gated until a root read confirms clearance', asy
49694979 },
49704980 { filter: 'visible' },
49714981 );
4972- assert.equal(changedManual.gate?.status, 'manual_required', `${label}: changed dialog reset a failed solve to a paid solve`);
4973- const manualCompletion = await agent._observeCaptchaChallenge(
4974- tabId,
4975- 'get_accessibility_tree',
4976- {
4977- pageContent: 'main [ref_930]\n heading "Welcome" [ref_931]',
4978- pageUrl: 'https://example.test/identity-check',
4979- },
4980- { filter: 'visible' },
4981- );
4982- assert.equal(manualCompletion.gate?.status, 'cleared', `${label}: dialog-free root read did not clear the manually completed CAPTCHA`);
4983- assert.equal(agent._captchaGateStates.has(tabId), false, `${label}: manually completed CAPTCHA gate remained persisted`);
4982+ assert.equal(changedManual.gate?.status, 'cleared', `${label}: unrelated post-CAPTCHA dialog kept the failed solve gated`);
4983+ assert.equal(agent._captchaGateStates.has(tabId), false, `${label}: unrelated post-CAPTCHA dialog left a persisted gate`);
49844984
49854985 const confirmationAgent = new AgentClass({});
49864986 confirmationAgent._captchaGateStates.set(tabId, {
0 commit comments