mirror of
https://github.com/openclaw/openclaw.git
synced 2026-10-04 20:21:31 +00:00
test(ui): sample loading skeleton geometry in one frame
This commit is contained in:
parent
71ef1c5d54
commit
531f0a229c
1 changed files with 17 additions and 3 deletions
|
|
@ -310,9 +310,23 @@ describeControlUiE2e("Control UI initial connect splash E2E", () => {
|
|||
|
||||
for (const size of [viewport, { width: 1440, height: 1440 }, { width: 390, height: 844 }]) {
|
||||
await page.setViewportSize(size);
|
||||
const content = await page.locator(".content--chat").boundingBox();
|
||||
const header = await skeleton.locator(".loading-skeleton__header").boundingBox();
|
||||
const composer = await skeleton.locator(".loading-skeleton__composer").boundingBox();
|
||||
// The shell viewport owner can commit a resize between separate browser calls.
|
||||
const { content, header, composer } = await page
|
||||
.locator(".content--chat")
|
||||
.evaluate((root) => {
|
||||
const bounds = (element: Element | null) => {
|
||||
if (!element?.checkVisibility({ visibilityProperty: true })) {
|
||||
return null;
|
||||
}
|
||||
const { x, y, width, height } = element.getBoundingClientRect();
|
||||
return width > 0 && height > 0 ? { x, y, width, height } : null;
|
||||
};
|
||||
return {
|
||||
content: bounds(root),
|
||||
header: bounds(root.querySelector(".loading-skeleton__header")),
|
||||
composer: bounds(root.querySelector(".loading-skeleton__composer")),
|
||||
};
|
||||
});
|
||||
expect(content).not.toBeNull();
|
||||
expect(header).not.toBeNull();
|
||||
expect(composer).not.toBeNull();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue