fix: 增加2925邮箱登录超时和重试逻辑,优化用户体验
This commit is contained in:
@@ -8,6 +8,13 @@ test('background mail2925 session uses /login/ as relogin entry url', () => {
|
||||
assert.match(source, /const MAIL2925_LOGIN_URL = 'https:\/\/2925\.com\/login\/';/);
|
||||
});
|
||||
|
||||
test('background mail2925 session keeps login message timeout above the 40-second mailbox wait', () => {
|
||||
const source = fs.readFileSync('background/mail-2925-session.js', 'utf8');
|
||||
assert.match(source, /timeoutMs:\s*50000,/);
|
||||
assert.match(source, /responseTimeoutMs:\s*50000,/);
|
||||
assert.match(source, /40 秒内未进入收件箱/);
|
||||
});
|
||||
|
||||
test('ensureMail2925MailboxSession waits 3 seconds before and after opening login page on force relogin', async () => {
|
||||
const source = fs.readFileSync('background/mail-2925-session.js', 'utf8');
|
||||
const globalScope = {};
|
||||
|
||||
@@ -4,8 +4,12 @@ const fs = require('node:fs');
|
||||
|
||||
const source = fs.readFileSync('content/mail-2925.js', 'utf8');
|
||||
|
||||
test('ensureMail2925Session waits at most 20 seconds for mailbox after clicking login', () => {
|
||||
assert.match(source, /waitForMail2925View\('mailbox',\s*20000\)/);
|
||||
test('ensureMail2925Session waits at most 40 seconds for mailbox after clicking login', () => {
|
||||
assert.match(source, /waitForMail2925View\('mailbox',\s*40000\)/);
|
||||
});
|
||||
|
||||
test('ensureMail2925Session waits 1 second after filling credentials before clicking login', () => {
|
||||
assert.match(source, /fillInput\(passwordInput,\s*password\);[\s\S]*?await sleep\(200\);[\s\S]*?await sleep\(1000\);[\s\S]*?simulateClick\(loginButton\);/);
|
||||
});
|
||||
|
||||
function extractFunction(name) {
|
||||
|
||||
Reference in New Issue
Block a user