ui: simplify helper copy and center page loading feedback
This commit is contained in:
@@ -76,7 +76,9 @@ class ConnectionBrowserTests(unittest.TestCase):
|
||||
self.summary.update(connection_state="expired", connection_message=failure_reason, error=failure_reason)
|
||||
expect(self.page.locator("#connection")).to_have_text("登录已过期")
|
||||
expect(self.page.locator("#data-summary")).to_contain_text(self.summary["connection_message"])
|
||||
expect(panel.locator(".page-loading")).to_contain_text("缓存")
|
||||
expect(panel.locator("[data-connection-status]")).to_contain_text(failure_reason)
|
||||
expect(panel).to_have_attribute("aria-busy", "false")
|
||||
expect(panel.locator(".page-loading")).to_be_hidden()
|
||||
expect(panel.locator("[data-connection-status]")).to_contain_text("2026/11/11")
|
||||
expect(self.page.locator("#strategy-toggle")).to_be_disabled()
|
||||
expect(self.page.locator("#refresh")).to_be_disabled()
|
||||
@@ -98,7 +100,8 @@ class ConnectionBrowserTests(unittest.TestCase):
|
||||
expect(self.page.locator(selector)).to_be_visible()
|
||||
expect(self.page.locator(selector)).to_contain_text(f"上次失败:{failure_reason}")
|
||||
expect(self.page.locator(f'.account-tab[data-account="{self.first}"] .account-dot')).not_to_have_class("account-dot error")
|
||||
expect(panel.locator(".page-loading")).not_to_contain_text("缓存")
|
||||
expect(panel.locator(".page-loading")).to_have_attribute("data-loading", "false")
|
||||
expect(panel.locator(".page-loading")).to_be_hidden()
|
||||
self.assertEqual(self.page.locator("#page-tabs [role=tab]").count(), 15)
|
||||
self.assertEqual(self.external_requests, [])
|
||||
self.assertEqual(self.errors, [])
|
||||
@@ -187,7 +190,10 @@ class ConnectionBrowserTests(unittest.TestCase):
|
||||
self.page.on("request", lambda request: actions.append(request.url) if "/actions/" in request.url else None)
|
||||
panel = self.go("bag")
|
||||
expect(panel.locator("[data-connection-status]")).to_contain_text("Web 服务已重启")
|
||||
expect(panel.locator(".page-loading")).to_contain_text("缓存")
|
||||
expect(panel.get_by_text("已保存的背包", exact=True)).to_be_visible()
|
||||
expect(panel).to_have_attribute("aria-busy", "false")
|
||||
expect(panel.locator(".page-loading")).to_have_attribute("data-loading", "false")
|
||||
expect(panel.locator(".page-loading")).to_be_hidden()
|
||||
self.page.locator('[data-command="start"]').dispatch_event("click")
|
||||
self.page.locator("#refresh").dispatch_event("click")
|
||||
self.page.wait_for_timeout(1800)
|
||||
|
||||
Reference in New Issue
Block a user