Skip to content

Commit

Permalink
wip-音声書き出しe2eテスト
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba committed Jan 4, 2025
1 parent 5ee1005 commit fb61569
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.11.0
20
40 changes: 40 additions & 0 deletions tests/e2e/browser/音声書き出し.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { test, expect } from "@playwright/test";

import { gotoHome, navigateToMain } from "../navigators";
import { getQuasarMenu } from "../locators";

test.beforeEach(gotoHome);

test.describe("音声書き出し", () => {
test.beforeEach(async ({ page }) => {
// テキスト欄を適当に3行ほど埋める
await navigateToMain(page);

const accentPhrase = page.locator(".accent-phrase");

await page.getByRole("textbox", { name: "1行目" }).click();
await page.getByRole("textbox", { name: "1行目" }).fill("1行目");
await page.getByRole("textbox", { name: "1行目" }).press("Enter");
await expect(accentPhrase).not.toHaveCount(0);

await page.getByRole("button").filter({ hasText: "add" }).click();
await page.getByRole("textbox", { name: "2行目" }).click();
await page.getByRole("textbox", { name: "2行目" }).fill("2行目");
await page.getByRole("textbox", { name: "2行目" }).press("Enter");
await expect(accentPhrase).not.toHaveCount(0);

await page.getByRole("button").filter({ hasText: "add" }).click();
await page.getByRole("textbox", { name: "3行目" }).click();
await page.getByRole("textbox", { name: "3行目" }).fill("3行目");
await page.getByRole("textbox", { name: "3行目" }).press("Enter");
await expect(accentPhrase).not.toHaveCount(0);
});

test("選択中の音声を書き出し", async ({ page }) => {
await page.getByRole("button", { name: "ファイル" }).click();
await getQuasarMenu(page, "選択音声を書き出し").click();

// FileChooserでいけるかも
// https://playwright.dev/docs/api/class-filechooser
});
});

0 comments on commit fb61569

Please sign in to comment.