重构修改2925获取邮箱

This commit is contained in:
QLHazyCoder
2026-04-18 17:28:43 +08:00
parent 7a4b1e1e12
commit 8e3e085f3d
8 changed files with 717 additions and 205 deletions
+19
View File
@@ -51,6 +51,8 @@ function extractFunction(name) {
}
const bundle = [
extractFunction('getPageTextSnapshot'),
extractFunction('getLoginVerificationDisplayedEmail'),
extractFunction('inspectLoginAuthState'),
extractFunction('normalizeStep6Snapshot'),
].join('\n');
@@ -62,6 +64,13 @@ const location = {
pathname: ${JSON.stringify(overrides.pathname || '/log-in')},
};
const document = {
body: {
innerText: ${JSON.stringify(overrides.pageText || '')},
textContent: ${JSON.stringify(overrides.pageText || '')},
},
};
function getLoginTimeoutErrorPageState() {
return ${JSON.stringify(overrides.retryState || null)};
}
@@ -127,6 +136,16 @@ return {
);
}
{
const api = createApi({
verificationTarget: { id: 'otp' },
pageText: 'We emailed a code to display.user@example.com. Enter it below.',
});
const snapshot = api.inspectLoginAuthState();
assert.strictEqual(snapshot.displayedEmail, 'display.user@example.com');
}
{
const api = createApi({
oauthConsentPage: true,