forked from microsoft/FluidFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaywright.config.ts
55 lines (46 loc) · 1.3 KB
/
playwright.config.ts
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
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/
import { defineConfig, devices } from "@playwright/test";
const frontendPort = 3000;
const frontEndUrl = `http://localhost:${frontendPort}`;
export default defineConfig({
// Look for test files in the "test" directory, relative to this configuration file.
testDir: "test",
// Fail the build on CI if you accidentally left test.only in the source code.
forbidOnly: !!process.env.CI,
// Don't retry on failure.
retries: 0,
// Reporter to use
reporter: [
// Console output
["line"],
// JUnit XML report file output for CI
["junit", { outputFile: "test-results/junit-report.xml" }],
],
use: {
// Base URL to use in actions like `await page.goto('/')`.
baseURL: frontEndUrl,
// Collect trace when retrying the failed test.
trace: "on-first-retry",
// Generate screenshots when a test fails
screenshot: "only-on-failure",
},
// Configure projects for major browsers.
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
// Run your local dev server before starting the tests.
webServer: [
// Run front-end dev server
{
command: "npm run serve -- --no-open",
url: frontEndUrl,
reuseExistingServer: !process.env.CI,
},
],
});