mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-12-01 21:05:42 +09:00
Reduce shard 4 browser setup and asset drag work
This commit is contained in:
1 parent
08aa6c492e
commit
a125ea504a
4 files changed
+19
-15
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import type { BrowserContext } from "@playwright/test";
|
||||
import type { BrowserContext, Page } from "@playwright/test";
|
||||
import { createSeededBuilderProject } from "./builder-project";
|
||||
|
||||
export type SeededSlotKeyboardProject = {
|
||||
@@ -115,19 +115,19 @@ const createSlotKeyboardBuildData = ({
|
||||
styleSourceId: divStyleSourceId,
|
||||
breakpointId: baseBreakpointId,
|
||||
property: "minHeight",
|
||||
value: { type: "unit", unit: "px", value: 120 },
|
||||
value: { type: "unit", unit: "px", value: 36 },
|
||||
},
|
||||
{
|
||||
styleSourceId: divStyleSourceId,
|
||||
breakpointId: baseBreakpointId,
|
||||
property: "padding",
|
||||
value: { type: "unit", unit: "px", value: 24 },
|
||||
value: { type: "unit", unit: "px", value: 8 },
|
||||
},
|
||||
{
|
||||
styleSourceId: headingStyleSourceId,
|
||||
breakpointId: baseBreakpointId,
|
||||
property: "marginTop",
|
||||
value: { type: "unit", unit: "px", value: 24 },
|
||||
value: { type: "unit", unit: "px", value: 8 },
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -173,7 +173,7 @@ const createSlotKeyboardBuildData = ({
|
||||
styleSourceId: wrapperStyleSourceId,
|
||||
breakpointId: baseBreakpointId,
|
||||
property: "gap",
|
||||
value: { type: "unit", unit: "px", value: 32 },
|
||||
value: { type: "unit", unit: "px", value: 8 },
|
||||
},
|
||||
...slotPairs.flatMap((pair) => pair.styles),
|
||||
]),
|
||||
@@ -185,12 +185,14 @@ const createSlotKeyboardBuildData = ({
|
||||
|
||||
export const createSlotKeyboardProject = async ({
|
||||
context,
|
||||
page,
|
||||
email = "slot-keyboard-e2e@webstudio.test",
|
||||
title = "Slot Keyboard E2E",
|
||||
builderToken = "slot-keyboard-e2e-builder-token",
|
||||
additionalPairSuffixes = [],
|
||||
}: {
|
||||
context: BrowserContext;
|
||||
page: Page;
|
||||
email?: string;
|
||||
title?: string;
|
||||
builderToken?: string;
|
||||
@@ -198,6 +200,7 @@ export const createSlotKeyboardProject = async ({
|
||||
}): Promise<SeededSlotKeyboardProject> => {
|
||||
return await createSeededBuilderProject({
|
||||
context,
|
||||
page,
|
||||
email,
|
||||
title,
|
||||
builderToken,
|
||||
|
||||
@@ -209,7 +209,8 @@ test("Content Block MDX source lifecycle persists edits and resets to empty", as
|
||||
// exhaust the default two-minute budget at the final reload assertion.
|
||||
test.setTimeout(180_000);
|
||||
const fixture = await createContentModeProject({
|
||||
context: context,
|
||||
context,
|
||||
page,
|
||||
devPlan: e2ePaidPlanName,
|
||||
email: "mdx-content-source-e2e@webstudio.test",
|
||||
title: "MDX Content Source E2E",
|
||||
@@ -490,6 +491,7 @@ test("Content editors switch MDX sources, edit isolated scopes, and recover from
|
||||
}) => {
|
||||
const fixture = await createContentModeProject({
|
||||
context,
|
||||
page,
|
||||
devPlan: e2ePaidPlanName,
|
||||
email: "mdx-content-editor-e2e@webstudio.test",
|
||||
title: "MDX Content Editor E2E",
|
||||
@@ -816,6 +818,7 @@ test("MDX template warnings and renamed templates resolve in the right modes", a
|
||||
}) => {
|
||||
const fixture = await createContentModeProject({
|
||||
context,
|
||||
page,
|
||||
email: "mdx-template-lifecycle-e2e@webstudio.test",
|
||||
title: "MDX Template Lifecycle E2E",
|
||||
});
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
import { randomUUID } from "node:crypto";
|
||||
import type { Page } from "@playwright/test";
|
||||
import { insertAssetFolders } from "../db";
|
||||
import {
|
||||
createAssetFolder,
|
||||
openAssetsPanel,
|
||||
uploadAssets,
|
||||
} from "../flows/assets-panel";
|
||||
import { openAssetsPanel, uploadAssets } from "../flows/assets-panel";
|
||||
import { openProjectBuilder } from "../flows/builder";
|
||||
import {
|
||||
waitForChangeToBeSaved,
|
||||
@@ -64,9 +60,9 @@ const selectAndDragAssets = async (page: Page) => {
|
||||
}
|
||||
await page.keyboard.press("Escape");
|
||||
const scrollArea = page.locator("[data-asset-manager-scroll-area]");
|
||||
const destination = await createAssetFolder({
|
||||
page,
|
||||
name: "Destination",
|
||||
const destination = page.getByRole("button", {
|
||||
name: "Folder Destination",
|
||||
exact: true,
|
||||
});
|
||||
const asset = firstAsset;
|
||||
await asset.scrollIntoViewIfNeeded();
|
||||
@@ -196,6 +192,7 @@ test("Assets can be selected and dragged and folders can be multiselected and de
|
||||
}) => {
|
||||
const { projectId, builderToken } = await createContentModeProject({
|
||||
context,
|
||||
page,
|
||||
email: "asset-folder-autoscroll-e2e@webstudio.test",
|
||||
title: "Asset Folder Autoscroll E2E",
|
||||
builderToken: "asset-folder-autoscroll-e2e-builder-token",
|
||||
@@ -209,7 +206,7 @@ test("Assets can be selected and dragged and folders can be multiselected and de
|
||||
(_, index) => `Filler ${String(index).padStart(2, "0")}`
|
||||
);
|
||||
await insertAssetFolders(
|
||||
[...folderNames, ...fillers].map((name) => ({
|
||||
[...folderNames, "Destination", ...fillers].map((name) => ({
|
||||
id: randomUUID(),
|
||||
projectId,
|
||||
name,
|
||||
|
||||
@@ -181,6 +181,7 @@ test("Canvas and Navigator shortcuts move shared Slot children and persist chang
|
||||
const id = randomUUID();
|
||||
const { projectId, builderToken } = await createSlotKeyboardProject({
|
||||
context,
|
||||
page,
|
||||
email: `slot-keyboard-${id}@webstudio.test`,
|
||||
builderToken: `slot-keyboard-${id}-builder-token`,
|
||||
additionalPairSuffixes: [
|
||||
|
||||
Reference in new issue
Block a user