mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-03 18:48:06 +09:00
26 lines
726 B
TypeScript
26 lines
726 B
TypeScript
import type { Page } from "@playwright/test";
|
|
import { waitForChangeToBeSaved, waitForSyncStatus } from "./sync-status";
|
|
|
|
export const addCssDeclaration = async ({
|
|
page,
|
|
property,
|
|
value,
|
|
}: {
|
|
page: Page;
|
|
property: string;
|
|
value: string;
|
|
}) => {
|
|
await page.getByRole("button", { name: "Add styles" }).click();
|
|
const propertyInput = page.locator(
|
|
'input[aria-label^="Property name:"]:focus'
|
|
);
|
|
await propertyInput.fill(property);
|
|
await propertyInput.press("Enter");
|
|
const valueInput = page.locator("input:focus");
|
|
await valueInput.fill(value);
|
|
const save = waitForChangeToBeSaved({ page });
|
|
await valueInput.press("Enter");
|
|
await save;
|
|
await waitForSyncStatus({ page, status: "idle" });
|
|
};
|