Skip to content

Commit

Permalink
#4 モンキーパッチなのでbackground.tsのエンジン連携部分をテストできていないがとりあえずデータ準備を超えられた。
Browse files Browse the repository at this point in the history
  • Loading branch information
so-c committed Jul 17, 2022
1 parent d44d38e commit e1835ab
Showing 1 changed file with 10 additions and 19 deletions.
29 changes: 10 additions & 19 deletions tests/e2e/example.spec.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
import { test } from "@playwright/test";
import { Page, test } from "@playwright/test";
import { assert } from "chai";
import { testWithPlaywright } from "vue-cli-plugin-electron-builder";
import dotenv from "dotenv";

test("launch app in production mode", async () => {
const {app, stop } = await testWithPlaywright({mode: "production"});
test("起動したら「利用規約に関するお知らせ」が表示される", async () => {
// TODO: configに持っていく
test.setTimeout(60000);

// Get the first window that the app opens, wait if necessary.
const win = await app.firstWindow();
await win.waitForLoadState("domcontentloaded");
dotenv.config(); // FIXME: エンジンの設定直読み
const { app, stop } = await testWithPlaywright();
const sut = await app.firstWindow();

assert.equal(await win.title(), "voicevox");

await stop();
});

test("launch app in development mode", async () => {
const {app, stop } = await testWithPlaywright({mode: "development"});

// Get the first window that the app opens, wait if necessary.
const win = await app.firstWindow();
await win.waitForLoadState("domcontentloaded");

assert.equal(await win.title(), "voicevox");
// エンジンが起動し「利用規約に関するお知らせ」が表示されるのを待つ
await sut.waitForSelector('text=利用規約に関するお知らせ');

await stop();
});

0 comments on commit e1835ab

Please sign in to comment.