feat: import Chinese-localized Buzz source snapshot
Docker image / Build (linux/amd64) (push) Has been cancelled
Docker image / Build (linux/arm64) (push) Has been cancelled
Docker image / Merge release multi-arch manifest (push) Has been cancelled
Docker image / Merge debug multi-arch manifest (push) Has been cancelled
Docker image / Build public push gateway (linux/amd64) (push) Has been cancelled
Docker image / Build public push gateway (linux/arm64) (push) Has been cancelled
Docker image / Publish public push gateway image (push) Has been cancelled
Sprig image / Build (linux/amd64) (push) Has been cancelled
Sprig image / Build (linux/arm64) (push) Has been cancelled
Sprig image / Merge multi-arch manifest (push) Has been cancelled
Harbor Buzz Orchestra / Python tests and lint (push) Has been cancelled
CI / Detect Changed Paths (push) Has been cancelled
CI / Rust Lint (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Desktop Core (push) Has been cancelled
CI / Desktop Smoke E2E (1) (push) Has been cancelled
CI / Desktop Smoke E2E (2) (push) Has been cancelled
CI / Desktop Smoke E2E (3) (push) Has been cancelled
CI / Desktop Smoke E2E (4) (push) Has been cancelled
CI / Desktop (push) Has been cancelled
CI / Desktop E2E Relay (push) Has been cancelled
CI / Desktop E2E Integration (1/2) (push) Has been cancelled
CI / Desktop E2E Integration (2/2) (push) Has been cancelled
CI / Desktop E2E Integration (push) Has been cancelled
CI / Backend Integration (relay e2e) (push) Has been cancelled
CI / Relay E2E (push) Has been cancelled
CI / Web (push) Has been cancelled
CI / Mobile (push) Has been cancelled
CI / Security (push) Has been cancelled
CI / Dead Token Reference Guard (push) Has been cancelled
CI / Server Cross-Compile (aarch64-unknown-linux-musl) (push) Has been cancelled
CI / Server Cross-Compile (x86_64-unknown-linux-musl) (push) Has been cancelled
CI / Windows Rust (x86_64-pc-windows-msvc) (push) Has been cancelled
CI / Desktop Build (macOS) (push) Has been cancelled
helm chart / lint + unittest + render matrix (push) Has been cancelled
helm chart / install on kind (gated) (push) Has been cancelled
helm chart / publish chart to GHCR (push) Has been cancelled
Mesh Lifecycle / Relay-Driven Mesh Lifecycle Smoke (push) Has been cancelled
Sprig / Build (aarch64-unknown-linux-musl) (push) Has been cancelled
Sprig / Build (x86_64-unknown-linux-musl) (push) Has been cancelled
Sprig / Publish rolling release (push) Has been cancelled
Sprig / Publish tagged release (push) Has been cancelled
Docker image / Build (linux/amd64) (push) Has been cancelled
Docker image / Build (linux/arm64) (push) Has been cancelled
Docker image / Merge release multi-arch manifest (push) Has been cancelled
Docker image / Merge debug multi-arch manifest (push) Has been cancelled
Docker image / Build public push gateway (linux/amd64) (push) Has been cancelled
Docker image / Build public push gateway (linux/arm64) (push) Has been cancelled
Docker image / Publish public push gateway image (push) Has been cancelled
Sprig image / Build (linux/amd64) (push) Has been cancelled
Sprig image / Build (linux/arm64) (push) Has been cancelled
Sprig image / Merge multi-arch manifest (push) Has been cancelled
Harbor Buzz Orchestra / Python tests and lint (push) Has been cancelled
CI / Detect Changed Paths (push) Has been cancelled
CI / Rust Lint (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Desktop Core (push) Has been cancelled
CI / Desktop Smoke E2E (1) (push) Has been cancelled
CI / Desktop Smoke E2E (2) (push) Has been cancelled
CI / Desktop Smoke E2E (3) (push) Has been cancelled
CI / Desktop Smoke E2E (4) (push) Has been cancelled
CI / Desktop (push) Has been cancelled
CI / Desktop E2E Relay (push) Has been cancelled
CI / Desktop E2E Integration (1/2) (push) Has been cancelled
CI / Desktop E2E Integration (2/2) (push) Has been cancelled
CI / Desktop E2E Integration (push) Has been cancelled
CI / Backend Integration (relay e2e) (push) Has been cancelled
CI / Relay E2E (push) Has been cancelled
CI / Web (push) Has been cancelled
CI / Mobile (push) Has been cancelled
CI / Security (push) Has been cancelled
CI / Dead Token Reference Guard (push) Has been cancelled
CI / Server Cross-Compile (aarch64-unknown-linux-musl) (push) Has been cancelled
CI / Server Cross-Compile (x86_64-unknown-linux-musl) (push) Has been cancelled
CI / Windows Rust (x86_64-pc-windows-msvc) (push) Has been cancelled
CI / Desktop Build (macOS) (push) Has been cancelled
helm chart / lint + unittest + render matrix (push) Has been cancelled
helm chart / install on kind (gated) (push) Has been cancelled
helm chart / publish chart to GHCR (push) Has been cancelled
Mesh Lifecycle / Relay-Driven Mesh Lifecycle Smoke (push) Has been cancelled
Sprig / Build (aarch64-unknown-linux-musl) (push) Has been cancelled
Sprig / Build (x86_64-unknown-linux-musl) (push) Has been cancelled
Sprig / Publish rolling release (push) Has been cancelled
Sprig / Publish tagged release (push) Has been cancelled
Signed-off-by: cls_宁波本机 <908705107@qq.com>
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
import { installMockBridge } from "../helpers/bridge";
|
||||
|
||||
async function settle(page: import("@playwright/test").Page) {
|
||||
// Tolerate cancelled animations (skeleton → live swap rejects `.finished`
|
||||
// with AbortError) AND indefinitely-running ones (the degraded-state pulse
|
||||
// never resolves `.finished`): allSettled handles rejection, the timeout
|
||||
// race handles infinite animations so this can never hang the test.
|
||||
await page.evaluate(() =>
|
||||
Promise.race([
|
||||
Promise.allSettled(document.getAnimations().map((a) => a.finished)),
|
||||
new Promise((resolve) => setTimeout(resolve, 1_000)),
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
/** Drive the relay client into a state via the real E2E connection-state seam. */
|
||||
async function driveConnectionState(
|
||||
page: import("@playwright/test").Page,
|
||||
state: "connected" | "reconnecting" | "stalled" | "disconnected",
|
||||
) {
|
||||
await page.evaluate((s) => {
|
||||
const setter = (
|
||||
window as Window & {
|
||||
__BUZZ_E2E_SET_RELAY_CONNECTION_STATE__?: (state: string) => void;
|
||||
}
|
||||
).__BUZZ_E2E_SET_RELAY_CONNECTION_STATE__;
|
||||
if (!setter) throw new Error("E2E relay state setter not installed.");
|
||||
setter(s);
|
||||
}, state);
|
||||
}
|
||||
|
||||
async function scrollSidebarToBottom(page: import("@playwright/test").Page) {
|
||||
// The relay block anchors at the bottom of the sidebar's scroll region and is
|
||||
// painted UNDER the absolute, z-30 profile footer (it sits within the footer's
|
||||
// 68px band when unscrolled — toBeVisible passes since it's in-DOM, but a human
|
||||
// can't see it). The scroll region is specifically [data-sidebar="content"];
|
||||
// scrolling it fully down lifts the block ~96px clear of the footer. Targeting
|
||||
// any old overflowing descendant matches the wrong element (e.g. a menu button),
|
||||
// so the selector must be exact.
|
||||
await page
|
||||
.getByTestId("app-sidebar")
|
||||
.locator('[data-sidebar="content"]')
|
||||
.evaluate((scroller) => {
|
||||
scroller.scrollTop = scroller.scrollHeight;
|
||||
});
|
||||
}
|
||||
|
||||
test.describe("relay reconnect affordance", () => {
|
||||
test("01 — sidebar has no reconnect prompt when healthy", async ({
|
||||
page,
|
||||
}) => {
|
||||
await installMockBridge(page);
|
||||
await page.goto("/");
|
||||
|
||||
await expect(page.getByTestId("channel-general")).toBeVisible();
|
||||
await expect(page.getByTestId("sidebar-relay-unreachable")).toHaveCount(0);
|
||||
// The relay block renders at the BOTTOM of the scrollable sidebar content,
|
||||
// below the fold at this viewport. Scroll to the bottom so 01 frames the
|
||||
// same region where 02 will show the block — making the absence legible.
|
||||
await scrollSidebarToBottom(page);
|
||||
await settle(page);
|
||||
|
||||
// Frame the left sidebar directly — the relay-unreachable block lives there,
|
||||
// and a full-window shot makes its presence/absence illegible against the
|
||||
// unrelated top connection banner.
|
||||
});
|
||||
|
||||
test("02 — sidebar reconnect prompt shown when degraded, channels visible", async ({
|
||||
page,
|
||||
}) => {
|
||||
await installMockBridge(page);
|
||||
await page.goto("/");
|
||||
|
||||
await expect(page.getByTestId("channel-general")).toBeVisible();
|
||||
await driveConnectionState(page, "stalled");
|
||||
await expect(page.getByTestId("sidebar-relay-unreachable")).toBeVisible({
|
||||
timeout: 10_000,
|
||||
});
|
||||
await expect(page.getByTestId("sidebar-reconnect")).toBeVisible();
|
||||
// The cached channel list stays visible alongside the prompt.
|
||||
await expect(page.getByTestId("channel-general")).toBeVisible();
|
||||
// Scroll the block clear of the occluding footer (symmetric with 01).
|
||||
await scrollSidebarToBottom(page);
|
||||
await settle(page);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user