forked from team-mirai-volunteer/action-board
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
71 lines (65 loc) · 1.76 KB
/
Copy pathplaywright.config.ts
File metadata and controls
71 lines (65 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import { defineConfig, devices } from "@playwright/test";
import * as dotenv from "dotenv";
if (!process.env.CI) {
dotenv.config({ path: ".env" });
dotenv.config({ path: ".env.local", override: true });
dotenv.config({ path: ".env.test", override: true });
}
const PORT = process.env.PORT || 3000;
const baseURL = `http://localhost:${PORT}`;
/**
* Playwrightの設定
* https://playwright.dev/docs/test-configuration
*/
export default defineConfig({
testDir: "./tests/e2e",
/* 各テスト実行の最大タイムアウト時間 */
workers: 2,
timeout: 30 * 1000,
expect: {
/* テストアサーションのタイムアウト時間 */
timeout: 5000,
},
/* CI環境での失敗時のリトライ回数 */
retries: 2,
/* テスト結果のレポーター設定 */
reporter: "html",
/* 共有の設定 */
use: {
baseURL,
/* テスト実行中のトレースを取得 */
trace: "retry-with-trace",
/* ナビゲーションのタイムアウト */
navigationTimeout: 10000,
/* スクリーンショットの設定 */
screenshot: "only-on-failure",
},
/* プロジェクト固有の設定 */
projects: [
/* デスクトップブラウザ */
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
{
name: "webkit",
use: { ...devices["Desktop Safari"] },
},
/* モバイルデバイス */
{
name: "mobile-chrome",
use: { ...devices["Pixel 5"] },
},
{
name: "mobile-safari",
use: { ...devices["iPhone 12"] },
},
],
/* Webサーバーの設定 */
webServer: {
command: process.env.CI ? "npm run build && npm run start" : "npm run dev",
url: baseURL,
timeout: 180 * 1000,
reuseExistingServer: !process.env.CI,
},
});