Verify vertical actions in setup guide captures
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 71 KiB |
@@ -41,6 +41,17 @@ export async function captureGuideDialogue(port: number, filename: string, title
|
|||||||
return await captureObsidianElement(port, filename, (page) => modalByTitle(page, title).locator(".modal").first());
|
return await captureObsidianElement(port, filename, (page) => modalByTitle(page, title).locator(".modal").first());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function assertVerticalActionLayout(port: number, title: string): Promise<void> {
|
||||||
|
await withObsidianPage(port, async (page) => {
|
||||||
|
const actions = modalByTitle(page, title).locator(".vpk-action-dialog__actions").first();
|
||||||
|
await actions.waitFor({ state: "visible", timeout: uiTimeoutMs });
|
||||||
|
const flexDirection = await actions.evaluate((element) => getComputedStyle(element).flexDirection);
|
||||||
|
if (flexDirection !== "column") {
|
||||||
|
throw new Error(`Expected vertically stacked actions in '${title}', received '${flexDirection}'.`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export async function selectRadioOption(modal: Locator, title: string): Promise<void> {
|
export async function selectRadioOption(modal: Locator, title: string): Promise<void> {
|
||||||
const radio = modal.locator("label").filter({ hasText: title }).locator('input[type="radio"]').first();
|
const radio = modal.locator("label").filter({ hasText: title }).locator('input[type="radio"]').first();
|
||||||
await radio.check({ timeout: uiTimeoutMs });
|
await radio.check({ timeout: uiTimeoutMs });
|
||||||
@@ -257,6 +268,7 @@ export async function acknowledgeDisabledOptionalFeatures(port: number, captures
|
|||||||
|
|
||||||
export async function confirmFastFetch(port: number, captures: SetupCaptureNames): Promise<string[]> {
|
export async function confirmFastFetch(port: number, captures: SetupCaptureNames): Promise<string[]> {
|
||||||
const firstTitle = "Data retrieval scheduled";
|
const firstTitle = "Data retrieval scheduled";
|
||||||
|
await assertVerticalActionLayout(port, firstTitle);
|
||||||
const firstScreenshot = await captureGuideDialogue(
|
const firstScreenshot = await captureGuideDialogue(
|
||||||
port,
|
port,
|
||||||
`guide-${captures.guide}-retrieval-method.png`,
|
`guide-${captures.guide}-retrieval-method.png`,
|
||||||
@@ -269,6 +281,7 @@ export async function confirmFastFetch(port: number, captures: SetupCaptureNames
|
|||||||
});
|
});
|
||||||
|
|
||||||
const secondTitle = "How to handle extra existing local files?";
|
const secondTitle = "How to handle extra existing local files?";
|
||||||
|
await assertVerticalActionLayout(port, secondTitle);
|
||||||
const secondScreenshot = await captureGuideDialogue(
|
const secondScreenshot = await captureGuideDialogue(
|
||||||
port,
|
port,
|
||||||
`guide-${captures.guide}-local-file-policy.png`,
|
`guide-${captures.guide}-local-file-policy.png`,
|
||||||
|
|||||||
@@ -22,7 +22,11 @@ import {
|
|||||||
type LocalDatabaseEntry,
|
type LocalDatabaseEntry,
|
||||||
} from "../runner/liveSyncWorkflow.ts";
|
} from "../runner/liveSyncWorkflow.ts";
|
||||||
import { startObsidianLiveSyncSession, type ObsidianLiveSyncSession } from "../runner/session.ts";
|
import { startObsidianLiveSyncSession, type ObsidianLiveSyncSession } from "../runner/session.ts";
|
||||||
import { generateSetupURIFromDevice, resumeCompatibilityReviewIfShown } from "../runner/setupUri.ts";
|
import {
|
||||||
|
assertVerticalActionLayout,
|
||||||
|
generateSetupURIFromDevice,
|
||||||
|
resumeCompatibilityReviewIfShown,
|
||||||
|
} from "../runner/setupUri.ts";
|
||||||
import {
|
import {
|
||||||
captureObsidianDialogue,
|
captureObsidianDialogue,
|
||||||
captureObsidianElement,
|
captureObsidianElement,
|
||||||
@@ -344,6 +348,7 @@ async function acknowledgeDisabledOptionalFeatures(port: number): Promise<string
|
|||||||
|
|
||||||
async function confirmFastFetch(port: number): Promise<string[]> {
|
async function confirmFastFetch(port: number): Promise<string[]> {
|
||||||
const firstTitle = "Data retrieval scheduled";
|
const firstTitle = "Data retrieval scheduled";
|
||||||
|
await assertVerticalActionLayout(port, firstTitle);
|
||||||
const firstScreenshot = await captureObsidianDialogue(
|
const firstScreenshot = await captureObsidianDialogue(
|
||||||
port,
|
port,
|
||||||
"setup-uri-second-retrieval-method.png",
|
"setup-uri-second-retrieval-method.png",
|
||||||
@@ -359,6 +364,7 @@ async function confirmFastFetch(port: number): Promise<string[]> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const secondTitle = "How to handle extra existing local files?";
|
const secondTitle = "How to handle extra existing local files?";
|
||||||
|
await assertVerticalActionLayout(port, secondTitle);
|
||||||
const secondScreenshot = await captureObsidianDialogue(
|
const secondScreenshot = await captureObsidianDialogue(
|
||||||
port,
|
port,
|
||||||
"setup-uri-second-local-file-policy.png",
|
"setup-uri-second-local-file-policy.png",
|
||||||
|
|||||||