Files
notesnook/apps/web/playwright.config.ts

77 lines
1.9 KiB
TypeScript
Raw Normal View History

/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2022 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
2022-08-30 16:13:11 +05:00
import { PlaywrightTestConfig } from "@playwright/test";
2021-06-09 23:50:04 +05:00
const IS_CI = !!process.env.CI;
2021-11-02 15:32:40 +05:00
const config: PlaywrightTestConfig = {
2021-09-13 11:08:28 +05:00
webServer: {
command: "npm run start:test",
2021-09-13 11:08:28 +05:00
port: 3000,
2021-10-22 16:29:12 +05:00
timeout: 60 * 1000,
reuseExistingServer: false
2021-09-13 11:08:28 +05:00
},
// Look for test files in thcleare "tests" directory, relative to this configuration file
2021-06-09 23:50:04 +05:00
testDir: "__e2e__",
// Each test is given 30 seconds
timeout: 30000,
workers: IS_CI ? 2 : 2,
2021-07-07 14:22:11 +05:00
reporter: "list",
retries: IS_CI ? 1 : 0,
2022-09-09 15:42:52 +05:00
fullyParallel: true,
preserveOutput: "failures-only",
outputDir: "test-results",
2021-06-09 23:50:04 +05:00
use: {
2022-09-09 15:59:29 +05:00
baseURL: "http://localhost:3000/",
2022-02-15 10:21:52 +05:00
headless: true,
2021-07-09 01:13:26 +05:00
acceptDownloads: true,
2021-06-09 23:50:04 +05:00
// Artifacts
trace: "retain-on-failure",
screenshot: "only-on-failure",
video: "retry-with-video",
2021-07-25 09:32:42 +05:00
viewport: {
width: 1280,
height: 720
}
2021-06-09 23:50:04 +05:00
},
projects: IS_CI
? [
{
name: "Chromium",
use: {
browserName: "chromium"
}
}
]
: [
{
name: "Chromium",
use: {
browserName: "chromium"
}
}
]
2021-06-09 23:50:04 +05:00
};
export default config;