mirror of
https://github.com/aljazceru/claude-code-viewer.git
synced 2026-01-07 23:54:22 +01:00
- Implemented a new capture case for the "sidechain-task-modal" in the session detail E2E tests. - Added data-testid attributes to the SidechainConversationModal for improved test targeting. - Enhanced the GitController to handle errors gracefully when fetching branches and commits, returning an empty response on failure.
108 lines
3.3 KiB
TypeScript
108 lines
3.3 KiB
TypeScript
import { projectIds } from "../config";
|
|
import { defineCapture } from "../utils/defineCapture";
|
|
|
|
export const sessionDetailCapture = defineCapture({
|
|
href: `projects/${projectIds.sampleProject}/sessions/fe5e1c67-53e7-4862-81ae-d0e013e3270b`,
|
|
cases: [
|
|
{
|
|
name: "sidebar-closed",
|
|
setup: async (page) => {
|
|
const menuButton = page.locator(
|
|
'[data-testid="mobile-sidebar-toggle-button"]',
|
|
);
|
|
if (await menuButton.isVisible()) {
|
|
await menuButton.click();
|
|
await page.waitForTimeout(1000);
|
|
|
|
const sessionsTabButton = page.locator(
|
|
'[data-testid="sessions-tab-button-mobile"]',
|
|
);
|
|
if (await sessionsTabButton.isVisible()) {
|
|
await sessionsTabButton.click();
|
|
await page.waitForTimeout(1000);
|
|
}
|
|
} else {
|
|
const sessionsTabButton = page.locator(
|
|
'[data-testid="sessions-tab-button"]',
|
|
);
|
|
if (await sessionsTabButton.isVisible()) {
|
|
await sessionsTabButton.click();
|
|
await page.waitForTimeout(1000);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
{
|
|
name: "settings-tab",
|
|
setup: async (page) => {
|
|
const menuButton = page.locator(
|
|
'[data-testid="mobile-sidebar-toggle-button"]',
|
|
);
|
|
if (await menuButton.isVisible()) {
|
|
await menuButton.click();
|
|
await page.waitForTimeout(1000);
|
|
|
|
const settingsTabButton = page.locator(
|
|
'[data-testid="settings-tab-button-mobile"]',
|
|
);
|
|
if (await settingsTabButton.isVisible()) {
|
|
await settingsTabButton.click();
|
|
await page.waitForTimeout(1000);
|
|
}
|
|
} else {
|
|
const settingsTabButton = page.locator(
|
|
'[data-testid="settings-tab-button"]',
|
|
);
|
|
if (await settingsTabButton.isVisible()) {
|
|
await settingsTabButton.click();
|
|
await page.waitForTimeout(1000);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
{
|
|
name: "start-new-chat",
|
|
setup: async (page) => {
|
|
const menuButton = page.locator(
|
|
'[data-testid="mobile-sidebar-toggle-button"]',
|
|
);
|
|
if (await menuButton.isVisible()) {
|
|
await menuButton.click();
|
|
await page.waitForTimeout(1000);
|
|
|
|
const startNewChatButton = page.locator(
|
|
'[data-testid="start-new-chat-button-mobile"]',
|
|
);
|
|
await startNewChatButton.click();
|
|
await page.waitForTimeout(1000);
|
|
} else {
|
|
const startNewChatButton = page.locator(
|
|
'[data-testid="start-new-chat-button"]',
|
|
);
|
|
await startNewChatButton.click();
|
|
await page.waitForTimeout(1000);
|
|
}
|
|
},
|
|
},
|
|
|
|
{
|
|
name: "sidechain-task-modal",
|
|
setup: async (page) => {
|
|
const sidechainTaskButton = page
|
|
.locator('[data-testid="sidechain-task-button"]')
|
|
.first();
|
|
if (await sidechainTaskButton.isVisible()) {
|
|
await sidechainTaskButton.click();
|
|
await page.waitForTimeout(1000);
|
|
|
|
// モーダルが開いたことを確認
|
|
const modal = page.locator('[data-testid="sidechain-task-modal"]');
|
|
await modal.waitFor({ state: "visible", timeout: 3000 });
|
|
}
|
|
},
|
|
},
|
|
],
|
|
});
|