mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-12-02 05:15:21 +09:00
22 lines
591 B
TypeScript
22 lines
591 B
TypeScript
import type { Page } from "@playwright/test";
|
|
import { waitForChangeToBeSaved } from "./sync-status";
|
|
|
|
export const addCssDeclaration = async ({
|
|
page,
|
|
property,
|
|
value,
|
|
}: {
|
|
page: Page;
|
|
property: string;
|
|
value: string;
|
|
}) => {
|
|
const editor = page.getByRole("textbox", { name: "Styles", exact: true });
|
|
await editor.click();
|
|
await editor.press("ControlOrMeta+Home");
|
|
await editor.press("ArrowDown");
|
|
await page.keyboard.insertText(`${property}: ${value};\n`);
|
|
const save = waitForChangeToBeSaved({ page });
|
|
await editor.press("ControlOrMeta+Enter");
|
|
await save;
|
|
};
|