Files
maestro/ui/e2e/helpers/spaceTabs.ts
T
oss-sync 57702b4f34
CI / build-and-test (push) Canceled after 0s
sync: update from private repo (2336949a)
2026-09-17 11:29:31 +00:00

28 lines
1.3 KiB
TypeScript

/**
* ワークスペースの横帯のタブを開くための道具(issue #1360 段 1)。
*
* アプリ・カレンダー・自動実行・設定の 4 つは「その他」の中へ畳んだので、押す前に
* その入口を開く必要がある。目印(`space-tab-apps` など)は畳む前と同じなので、
* ここを通せば呼ぶ側は今までどおり id だけを指定すればよい。
*
* チャットとファイルは横帯に出たままなので、この道具は要らない。
*/
import { expect, type Page } from '@playwright/test';
/** 「その他」の中に畳んである画面。 */
export type OverflowSpaceTab = 'apps' | 'calendar' | 'schedules' | 'settings';
/**
* 畳んである画面を開く。「その他」を押してからメニューの項目を押す。
* 押したあとメニューは閉じる(項目を選ぶと閉じる作り)。
*/
export async function openSpaceTab(page: Page, tab: OverflowSpaceTab): Promise<void> {
const more = page.getByTestId('space-tab-more');
await expect(more).toBeVisible();
await more.click();
const item = page.getByTestId(`space-tab-${tab}`);
await expect(item).toBeVisible();
await item.click();
await expect(page.getByTestId('space-tab-more-menu')).toHaveCount(0);
}