feat: redesign daily execution and messaging interfaces
This commit is contained in:
@@ -1,5 +1,44 @@
|
||||
import { expect, test } from "../fixtures";
|
||||
|
||||
test("executes routine steps and records a measurement in the shared journal", async ({
|
||||
page,
|
||||
a11y,
|
||||
}, testInfo) => {
|
||||
await page.goto("/");
|
||||
await page.waitForLoadState("networkidle");
|
||||
await page.getByRole("button", { name: /Morning routine 0 of 3/ }).click();
|
||||
await expect(page).toHaveURL(/activity=task/);
|
||||
await page.getByRole("checkbox", { name: /Drink water/ }).check();
|
||||
await expect(page.getByRole("button", { name: "Finish routine" })).toBeDisabled();
|
||||
await page.getByRole("checkbox", { name: /Get ready/ }).check();
|
||||
await page.getByRole("checkbox", { name: /Have breakfast/ }).check();
|
||||
expect((await a11y().analyze()).violations).toEqual([]);
|
||||
await page.screenshot({ path: testInfo.outputPath("home-routine.png"), fullPage: true });
|
||||
await page.getByRole("button", { name: "Finish routine" }).click();
|
||||
await page.getByRole("button", { name: /Record weight A quick check-in/ }).click();
|
||||
await page.getByRole("spinbutton", { name: "Weight", exact: true }).fill("65.2");
|
||||
await page.getByRole("button", { name: "Save measurement" }).click();
|
||||
await expect(
|
||||
page.getByRole("button", { name: /Record weight Recorded · 65.2 kg/ }),
|
||||
).toBeVisible();
|
||||
await page.getByRole("link", { name: "Journal", exact: true }).first().click();
|
||||
await expect(page.getByRole("article", { name: "Weight entry" })).toContainText("65.2 kg");
|
||||
await page.getByRole("link", { name: "Home", exact: true }).first().click();
|
||||
await expect(page.getByRole("button", { name: "Restore Morning routine" })).toBeVisible();
|
||||
});
|
||||
|
||||
test("shows the day flow and conversation context at desktop width", async ({ page }, testInfo) => {
|
||||
await page.setViewportSize({ width: 1440, height: 1080 });
|
||||
await page.goto("/");
|
||||
await page.waitForLoadState("networkidle");
|
||||
await expect(page.getByRole("region", { name: "Today’s plan" })).toBeVisible();
|
||||
await page.screenshot({ path: testInfo.outputPath("home-desktop.png") });
|
||||
await page.goto("/support?conversation=design-review");
|
||||
await page.waitForLoadState("networkidle");
|
||||
await expect(page.getByRole("textbox", { name: "Reply", exact: true })).toBeVisible();
|
||||
await page.screenshot({ path: testInfo.outputPath("messages-desktop.png") });
|
||||
});
|
||||
|
||||
test("previews a natural-language memo and shares the executed record with journal", async ({
|
||||
page,
|
||||
}) => {
|
||||
@@ -20,7 +59,7 @@ test("previews a natural-language memo and shares the executed record with journ
|
||||
test("keeps the home usable on narrow screens", async ({ page, a11y }, testInfo) => {
|
||||
await page.goto("/");
|
||||
await page.waitForLoadState("networkidle");
|
||||
for (const width of [320, 375, 768]) {
|
||||
for (const width of [320, 375, 414, 768]) {
|
||||
await page.setViewportSize({ width, height: 850 });
|
||||
await expect(page.getByRole("textbox", { name: "Home input" })).toBeVisible();
|
||||
expect(await page.evaluate(() => document.documentElement.scrollWidth)).toBe(width);
|
||||
@@ -47,11 +86,9 @@ test("adds tasks only after confirmation and can defer and restore them", async
|
||||
await expect(complete).toBeVisible();
|
||||
await page.getByRole("button", { name: "Apply", exact: true }).click();
|
||||
await expect(complete).toHaveCount(0);
|
||||
await page.locator(".home-rest summary").click();
|
||||
await page.getByRole("button", { name: "Restore grocery shopping", exact: true }).click();
|
||||
await complete.click();
|
||||
await expect(complete).toHaveCount(0);
|
||||
await page.locator(".home-rest summary").click();
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Restore grocery shopping", exact: true }),
|
||||
).toBeVisible();
|
||||
@@ -73,13 +110,13 @@ test("resolves communication within home and carries the status to the shared qu
|
||||
await expect(dialog).toHaveCount(0);
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Open conversation with Haruka Aoki" }),
|
||||
).toHaveCount(0);
|
||||
).toContainText("Set aside");
|
||||
await page.getByRole("link", { name: "Messages", exact: true }).first().click();
|
||||
const rows = page.locator(".support-row");
|
||||
await expect(rows.filter({ hasText: "Schedule next week’s design review" })).toHaveCount(0);
|
||||
await page.getByRole("button", { name: "Later", exact: true }).click();
|
||||
await page.getByRole("button", { name: "Set aside", exact: true }).click();
|
||||
await rows.filter({ hasText: "Schedule next week’s design review" }).click();
|
||||
await page.getByRole("button", { name: "Move to Now" }).click();
|
||||
await page.getByRole("button", { name: "Move to Inbox" }).click();
|
||||
const back = page.getByRole("button", { name: "Back to messages" });
|
||||
if (await back.isVisible()) await back.click();
|
||||
await page.getByRole("link", { name: "Home", exact: true }).first().click();
|
||||
@@ -95,7 +132,7 @@ test("updates the prose brief as priorities change and opens the referenced conv
|
||||
await page.waitForLoadState("networkidle");
|
||||
const brief = page.getByRole("region", { name: "Daily brief" });
|
||||
await expect(brief).toContainText("Review the documents");
|
||||
await expect(brief).toContainText("4 conversations");
|
||||
await expect(brief).toContainText("3 conversations");
|
||||
await page.getByRole("button", { name: "Complete Review the documents", exact: true }).click();
|
||||
await expect(brief).not.toContainText("Review the documents");
|
||||
await brief.getByRole("button", { name: "Reply to Haruka Aoki" }).click();
|
||||
@@ -104,10 +141,53 @@ test("updates the prose brief as priorities change and opens the referenced conv
|
||||
exact: true,
|
||||
});
|
||||
await dialog.getByRole("button", { name: "Leave for later" }).click();
|
||||
await expect(brief).toContainText("3 conversations");
|
||||
await expect(brief).toContainText("2 conversations");
|
||||
await expect(brief).not.toContainText("Haruka Aoki");
|
||||
await page.getByRole("textbox", { name: "Home input" }).fill("再開地点:資料の2ページ目から");
|
||||
await page.getByRole("button", { name: "Preview action" }).click();
|
||||
await page.getByRole("button", { name: "Apply", exact: true }).click();
|
||||
await expect(brief).toContainText("資料の2ページ目から");
|
||||
});
|
||||
|
||||
test("keeps completed actions in their original positions with visible outcomes", async ({
|
||||
page,
|
||||
a11y,
|
||||
}, testInfo) => {
|
||||
await page.goto("/");
|
||||
await page.waitForLoadState("networkidle");
|
||||
const titles = page.locator(".execution-flow-title");
|
||||
const before = await titles.allTextContents();
|
||||
await page.getByRole("button", { name: "Complete Review the documents", exact: true }).click();
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Restore Review the documents", exact: true }),
|
||||
).toHaveAttribute("aria-pressed", "true");
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Review the documents Completed", exact: true }),
|
||||
).toBeVisible();
|
||||
await page.getByRole("button", { name: "Open conversation with Haruka Aoki" }).click();
|
||||
const conversation = page.getByRole("dialog", {
|
||||
name: "Conversation with Haruka Aoki",
|
||||
exact: true,
|
||||
});
|
||||
await conversation.getByRole("button", { name: "Review reply", exact: true }).click();
|
||||
await page
|
||||
.getByRole("dialog", { name: "Review reply", exact: true })
|
||||
.getByRole("button", { name: "Try sending" })
|
||||
.click();
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Open conversation with Haruka Aoki" }),
|
||||
).toContainText("Reply recorded");
|
||||
await page.getByRole("button", { name: /Record weight A quick check-in/ }).click();
|
||||
await page.getByRole("spinbutton", { name: "Weight", exact: true }).fill("65.2");
|
||||
await page.getByRole("button", { name: "Save measurement" }).click();
|
||||
await expect(
|
||||
page.getByRole("button", { name: /Record weight Recorded · 65.2 kg/ }),
|
||||
).toBeVisible();
|
||||
expect(await titles.allTextContents()).toEqual(before);
|
||||
expect((await a11y().analyze()).violations).toEqual([]);
|
||||
await page.screenshot({ path: testInfo.outputPath("completion-in-place.png") });
|
||||
await page.getByRole("button", { name: "Restore Review the documents", exact: true }).click();
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Complete Review the documents", exact: true }),
|
||||
).toHaveAttribute("aria-pressed", "false");
|
||||
});
|
||||
|
||||
@@ -17,6 +17,7 @@ test("reviews an edited reply and keeps the simulated result in history", async
|
||||
await expect(reply).toHaveValue(/Thank you for sharing/);
|
||||
const edited = "I reviewed the materials. Let’s discuss the first-time experience.";
|
||||
await reply.fill(edited);
|
||||
await page.locator(".conversation-scheduling summary:visible").click();
|
||||
const slot = "Mon, Oct 5, 14:00–14:30";
|
||||
await page.getByRole("combobox", { name: "Suggested times" }).selectOption(slot);
|
||||
await page.getByRole("button", { name: "Add to reply" }).click();
|
||||
@@ -33,7 +34,7 @@ test("reviews an edited reply and keeps the simulated result in history", async
|
||||
await dialog.getByRole("button", { name: "Try sending" }).click();
|
||||
await expect(dialog).toHaveCount(0);
|
||||
await expect(rows.filter({ hasText: reviewSubject })).toHaveCount(0);
|
||||
await page.getByRole("button", { name: "History", exact: true }).click();
|
||||
await page.getByRole("button", { name: "Archive", exact: true }).click();
|
||||
await rows.filter({ hasText: reviewSubject }).click();
|
||||
await expect(page.locator(".support-outcome")).toContainText(edited);
|
||||
await expect(page.locator(".support-outcome")).toContainText(slot);
|
||||
@@ -49,16 +50,16 @@ test("defers a conversation and restores it to the current queue", async ({ page
|
||||
.fill("土曜の予定を確認してから返事するね。");
|
||||
await page.getByRole("button", { name: "Leave for later" }).click();
|
||||
await expect(rows.filter({ hasText: coffeeSubject })).toHaveCount(0);
|
||||
await page.getByRole("button", { name: "Later", exact: true }).click();
|
||||
await page.getByRole("button", { name: "Set aside", exact: true }).click();
|
||||
await rows.filter({ hasText: coffeeSubject }).click();
|
||||
await expect(page.getByRole("textbox", { name: "Reply", exact: true })).toHaveValue(
|
||||
"土曜の予定を確認してから返事するね。",
|
||||
);
|
||||
await page.getByRole("button", { name: "Move to Now" }).click();
|
||||
await page.getByRole("button", { name: "Move to Inbox" }).click();
|
||||
const back = page.getByRole("button", { name: "Back to messages" });
|
||||
if (await back.isVisible()) await back.click();
|
||||
await expect(rows.filter({ hasText: coffeeSubject })).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "Now", exact: true })).toHaveAttribute(
|
||||
await expect(page.getByRole("button", { name: "Inbox", exact: true })).toHaveAttribute(
|
||||
"aria-pressed",
|
||||
"true",
|
||||
);
|
||||
@@ -107,7 +108,7 @@ test("keeps corrections as new records and summarizes only selected current fact
|
||||
});
|
||||
|
||||
test("fits communication and journal interactions in narrow screens", async ({ page, a11y }) => {
|
||||
for (const width of [320, 375, 768]) {
|
||||
for (const width of [320, 375, 414, 768]) {
|
||||
await page.setViewportSize({ width, height: 850 });
|
||||
await page.goto("/support");
|
||||
await page.waitForLoadState("networkidle");
|
||||
|
||||
Reference in New Issue
Block a user