test(web): 账号页按钮改名后顺手修 e2e,别让脚本等一个不存在的按钮

This commit is contained in:
Steven
2026-11-03 00:07:53 +08:00
parent 7558637567
commit 742af4dd02
+2 -2
View File
@@ -130,8 +130,8 @@ async function main() {
() => document.querySelector('input[aria-label="昵称"]')?.value?.length > 0, () => document.querySelector('input[aria-label="昵称"]')?.value?.length > 0,
); );
await page.getByLabel("昵称").fill(nickname); await page.getByLabel("昵称").fill(nickname);
await page.getByRole("button", { name: "保存昵称" }).click(); await page.getByRole("button", { name: "保存资料" }).click();
await page.waitForSelector("text=昵称已更新"); await page.waitForSelector("text=资料已更新");
check("昵称保存成功", true); check("昵称保存成功", true);
const currentField = page.getByLabel("当前密码"); const currentField = page.getByLabel("当前密码");