登录支持回车提交(表单化); 冒烟改用回车路径验证
This commit is contained in:
+5
-3
@@ -70,9 +70,11 @@ tr:hover td{background:#f8fafc;cursor:pointer}
|
||||
<div class="panel">
|
||||
<h2 id="loginTitle">登录</h2>
|
||||
<div class="err" id="loginErr"></div>
|
||||
<input id="f_user" placeholder="用户名" autocomplete="username">
|
||||
<input id="f_pass" type="password" placeholder="密码(至少6位)" autocomplete="current-password">
|
||||
<button class="btn" id="loginBtn" onclick="doLoginOrInit()">登录</button>
|
||||
<form onsubmit="event.preventDefault();doLoginOrInit()">
|
||||
<input id="f_user" placeholder="用户名" autocomplete="username">
|
||||
<input id="f_pass" type="password" placeholder="密码(至少6位)" autocomplete="current-password">
|
||||
<button class="btn" id="loginBtn" type="submit">登录</button>
|
||||
</form>
|
||||
<div class="note" id="loginNote"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ const sleep = (ms) => new Promise(r => setTimeout(r, ms));
|
||||
const SP = process.env.SMOKE_PASS || 'test123456';
|
||||
await $('#f_user').fill(SU);
|
||||
await $('#f_pass').fill(SP);
|
||||
await $('#loginBtn').click();
|
||||
await p.keyboard.press('Enter'); // 回车登录路径
|
||||
await p.waitForNavigation({ waitUntil: 'networkidle', timeout: 8000 }).catch(() => {});
|
||||
await sleep(800);
|
||||
ok(boot.needsInit ? '注册超管成功' : '测试账号登录成功', await $('#main').isVisible());
|
||||
|
||||
Reference in New Issue
Block a user