Skip to content

Commit

Permalink
Add: e2eを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenc-nanashi committed Dec 2, 2023
1 parent dfee0f2 commit 795cd23
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
9 changes: 7 additions & 2 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,23 @@ if (isElectron) {
host: z.string(),
executionFilePath: z.string(),
executionArgs: z.array(z.string()),
executionEnabled: z.boolean(),
})
.passthrough()
.array();
const engineInfos = envSchema.parse(JSON.parse(defaultEngineInfosEnv));

engineInfos.forEach((info) => {
for (const info of engineInfos) {
if (!info.executionEnabled) {
continue;
}

additionalWebServer.push({
command: `${info.executionFilePath} ${info.executionArgs.join(" ")}`,
url: `${info.host}/version`,
reuseExistingServer: !process.env.CI,
});
});
}
} else {
throw new Error(`VITE_TARGETの指定が不正です。${process.env.VITE_TARGET}`);
}
Expand Down
31 changes: 31 additions & 0 deletions tests/e2e/browser/複数選択/選択.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,34 @@ test("複数選択:キーボード", async ({ page }) => {
expect(selectedStatus.active).toBe(3);
expect(selectedStatus.selected).toEqual([3]);
});
test("複数選択:台本欄の余白クリックで解除", async ({ page }) => {
let selectedStatus: SelectedStatus;

await page.locator(".audio-cell:nth-child(2)").click();
await page.keyboard.down("Shift");
await page.locator(".audio-cell:nth-child(4)").click();
await page.keyboard.up("Shift");

// 念のため確認
await page.waitForTimeout(100);
selectedStatus = await getSelectedStatus(page);
expect(selectedStatus.active).toBe(4);
expect(selectedStatus.selected).toEqual([2, 3, 4]);

const scriptArea = page.locator(".audio-cell-pane");
const boundingBox = await scriptArea.boundingBox();
if (!boundingBox) {
throw new Error("No bounding box");
}
await scriptArea.click({
position: {
x: 10,
y: boundingBox.height - 10,
},
});

await page.waitForTimeout(100);
selectedStatus = await getSelectedStatus(page);
expect(selectedStatus.active).toBe(4);
expect(selectedStatus.selected).toEqual([4]);
});

0 comments on commit 795cd23

Please sign in to comment.