2022-05-11 03:51:24 +00:00
|
|
|
import { devices, PlaywrightTestConfig } from "@playwright/test";
|
2022-01-26 16:56:22 +00:00
|
|
|
import { addAliases } from "module-alias";
|
2022-02-15 20:30:52 +00:00
|
|
|
import * as path from "path";
|
2022-01-26 16:56:22 +00:00
|
|
|
|
|
|
|
// Add aliases for the paths specified in the tsconfig.json file.
|
|
|
|
// This is needed because playwright does not consider tsconfig.json
|
|
|
|
// For more info, see:
|
|
|
|
// https://stackoverflow.com/questions/69023682/typescript-playwright-error-cannot-find-module
|
|
|
|
// https://github.com/microsoft/playwright/issues/7066#issuecomment-983984496
|
|
|
|
addAliases({
|
2022-02-14 22:23:33 +00:00
|
|
|
"@components": __dirname + "/apps/web/components",
|
|
|
|
"@lib": __dirname + "/apps/web/lib",
|
|
|
|
"@server": __dirname + "/apps/web/server",
|
|
|
|
"@ee": __dirname + "/apps/web/ee",
|
2022-01-26 16:56:22 +00:00
|
|
|
});
|
2021-12-15 16:25:49 +00:00
|
|
|
|
2022-02-15 20:30:52 +00:00
|
|
|
const outputDir = path.join(__dirname, "..", "..", "test-results");
|
|
|
|
const testDir = path.join(__dirname, "..", "..", "apps/web/playwright");
|
|
|
|
|
2022-05-11 03:51:24 +00:00
|
|
|
const DEFAULT_NAVIGATION_TIMEOUT = 5000;
|
|
|
|
|
2021-12-15 16:25:49 +00:00
|
|
|
const config: PlaywrightTestConfig = {
|
|
|
|
forbidOnly: !!process.env.CI,
|
2022-03-17 19:36:11 +00:00
|
|
|
retries: 1,
|
|
|
|
workers: 1,
|
2021-12-15 16:25:49 +00:00
|
|
|
timeout: 60_000,
|
2022-02-08 16:30:21 +00:00
|
|
|
reporter: [
|
|
|
|
[process.env.CI ? "github" : "list"],
|
|
|
|
["html", { outputFolder: "./playwright/reports/playwright-html-report", open: "never" }],
|
|
|
|
["junit", { outputFile: "./playwright/reports/results.xml" }],
|
|
|
|
],
|
2022-02-15 20:30:52 +00:00
|
|
|
globalSetup: require.resolve("./globalSetup"),
|
|
|
|
outputDir,
|
2021-12-17 16:58:23 +00:00
|
|
|
webServer: {
|
2022-03-17 19:36:11 +00:00
|
|
|
command: "NEXT_PUBLIC_IS_E2E=1 yarn workspace @calcom/web start -p 3000",
|
2021-12-17 16:58:23 +00:00
|
|
|
port: 3000,
|
|
|
|
timeout: 60_000,
|
|
|
|
reuseExistingServer: !process.env.CI,
|
|
|
|
},
|
2021-12-15 16:25:49 +00:00
|
|
|
use: {
|
|
|
|
baseURL: "http://localhost:3000",
|
|
|
|
locale: "en-US",
|
2021-12-17 16:58:23 +00:00
|
|
|
trace: "retain-on-failure",
|
2021-12-15 16:25:49 +00:00
|
|
|
headless: !!process.env.CI || !!process.env.PLAYWRIGHT_HEADLESS,
|
|
|
|
},
|
|
|
|
projects: [
|
|
|
|
{
|
|
|
|
name: "chromium",
|
2022-02-15 20:30:52 +00:00
|
|
|
testDir,
|
2022-05-11 03:51:24 +00:00
|
|
|
use: {
|
|
|
|
...devices["Desktop Chrome"],
|
|
|
|
/** If navigation takes more than this, then something's wrong, let's fail fast. */
|
|
|
|
navigationTimeout: DEFAULT_NAVIGATION_TIMEOUT,
|
|
|
|
},
|
2021-12-15 16:25:49 +00:00
|
|
|
},
|
|
|
|
/* {
|
|
|
|
name: "firefox",
|
|
|
|
use: { ...devices["Desktop Firefox"] },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "webkit",
|
|
|
|
use: { ...devices["Desktop Safari"] },
|
|
|
|
}, */
|
|
|
|
],
|
|
|
|
};
|
|
|
|
|
|
|
|
export default config;
|