Files
webstudio/apps/builder/e2e/flows/css-declaration.ts
T

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;
};