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

84 lines
2.0 KiB
JavaScript
Raw Normal View History

2022-08-30 16:13:11 +05:00
/* 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/>.
*/
2021-06-09 23:50:04 +05:00
const IS_CI = !!process.env.CI;
2021-11-02 15:32:40 +05:00
const projects = IS_CI
? [
{
name: "Firefox",
use: { browserName: "firefox" }
2021-11-02 15:32:40 +05:00
},
{
name: "WebKit",
use: { browserName: "webkit" }
}
2021-11-02 15:32:40 +05:00
]
: [
{
name: "Chromium",
use: {
browserName: "chromium"
}
}
2022-01-03 13:20:01 +05:00
// {
// name: "Firefox",
// use: { browserName: "firefox" },
// },
// {
// name: "WebKit",
// use: { browserName: "webkit" },
// },
2021-11-02 15:32:40 +05:00
];
2021-06-09 23:50:04 +05:00
module.exports = {
2021-09-13 11:08:28 +05:00
webServer: {
command: "npm run debug",
port: 3000,
2021-10-22 16:29:12 +05:00
timeout: 60 * 1000,
reuseExistingServer: true //!IS_CI,
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,
2021-12-16 11:39:54 +05:00
workers: IS_CI ? 3 : 4,
2021-07-07 14:22:11 +05:00
reporter: "list",
2022-02-15 10:21:52 +05:00
retries: IS_CI ? 3 : 0,
2021-06-09 23:50:04 +05:00
use: {
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
2021-07-08 12:41:06 +05:00
trace: IS_CI ? "off" : "retain-on-failure",
screenshot: IS_CI ? "off" : "only-on-failure",
video: IS_CI ? "off" : "retry-with-video",
2021-07-25 09:32:42 +05:00
viewport: {
width: 1280,
height: 720
2021-07-25 09:32:42 +05:00
},
screen: {
width: 1280,
height: 720
}
2021-06-09 23:50:04 +05:00
},
projects
2021-06-09 23:50:04 +05:00
};