Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions applets/weblite/tests/runtime-check.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -159,21 +159,24 @@ try {
browser = await chromium.connectOverCDP(endpoint);
const pages = () => browser.contexts().flatMap((context) => context.pages());
const shell = await waitFor(() => pages().find((page) => page.url().startsWith("file:")), "Applet shell not loaded");
const address = shell.locator('input[autocomplete="off"]').first();
if (standalone) {
const address = shell.getByRole("textbox", { name: "地址栏" });
await address.fill(target);
await address.press("Enter");
}
const page = await waitFor(() => pages().find((page) => page.url() === target), "Direct target never loaded");
const address = shell.getByRole("textbox", { name: standalone ? "地址栏" : "地址栏只读", exact: true });
assert.equal(await address.inputValue(), target, "address bar must retain the launch URL, query and fragment");
assert.equal(await address.evaluate((input) => input.readOnly), !standalone);
if (addressOnly)
await shell.getByRole("button", { name: /会话状态:.*账号代填未配置/ }).waitFor({ state: "visible" });
await shell
.locator('[data-testid="web-proxy-session-status"][data-status="unavailable"]')
.waitFor({ state: "visible" });
if (standalone || addressOnly) await page.getByRole("heading", { name: "Standalone browsing works" }).waitFor();
else {
await page.locator("#dashboard").waitFor({ state: "visible", timeout: 15_000 });
await shell.getByRole("button", { name: /会话状态:.*登录成功/ }).waitFor({ state: "visible" });
await shell
.locator('[data-testid="web-proxy-session-status"][data-status="success"]')
.waitFor({ state: "visible" });
}
const bootstrap = await shell.evaluate(() => window.webApplet.invoke("bootstrap"));
assert.equal(bootstrap.proxyUrl, "");
Expand Down
2 changes: 2 additions & 0 deletions packages/web-proxy/src/WebProxySurface.vue
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,8 @@ defineExpose({ focus, close: closeView });
variant="ghost"
size="sm"
class="size-7 shrink-0 cursor-help justify-center"
data-testid="web-proxy-session-status"
:data-status="autofillStatus || 'pending'"
:aria-label="t('WebProxy.SessionStatus', { status: statusSummary })"
/>
</UTooltip>
Expand Down
Loading