From 555f848ab02df385abc00c332d4e68bebc360212 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Fri, 16 Sep 2022 08:06:31 +0500 Subject: [PATCH] web: convert playwright config to typescript --- ...ywright.config.js => playwright.config.ts} | 68 ++++++++----------- 1 file changed, 27 insertions(+), 41 deletions(-) rename apps/web/{playwright.config.js => playwright.config.ts} (68%) diff --git a/apps/web/playwright.config.js b/apps/web/playwright.config.ts similarity index 68% rename from apps/web/playwright.config.js rename to apps/web/playwright.config.ts index 93670e1a0..712a70bdb 100644 --- a/apps/web/playwright.config.js +++ b/apps/web/playwright.config.ts @@ -17,48 +17,16 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +import { PlaywrightTestConfig } from "@playwright/test"; + const IS_CI = !!process.env.CI; -const projects = IS_CI - ? [ - // { - // name: "Firefox", - // use: { browserName: "firefox" } - // }, - // { - // name: "WebKit", - // use: { browserName: "webkit" } - // }, - { - name: "Chromium", - use: { - browserName: "chromium" - } - } - ] - : [ - { - name: "Chromium", - use: { - browserName: "chromium" - } - }, - { - name: "Firefox", - use: { browserName: "firefox" } - }, - { - name: "WebKit", - use: { browserName: "webkit" } - } - ]; - -module.exports = { +const config: PlaywrightTestConfig = { webServer: { command: "npm run start:test", port: 3000, timeout: 60 * 1000, - reuseExistingServer: true + reuseExistingServer: false }, // Look for test files in thcleare "tests" directory, relative to this configuration file testDir: "__e2e__", @@ -69,6 +37,8 @@ module.exports = { reporter: "list", retries: IS_CI ? 0 : 0, fullyParallel: true, + preserveOutput: "failures-only", + outputDir: "test-results", use: { baseURL: "http://localhost:3000/", headless: true, @@ -82,11 +52,27 @@ module.exports = { viewport: { width: 1280, height: 720 - }, - screen: { - width: 1280, - height: 720 } }, - projects + projects: IS_CI + ? [ + { + name: "Chromium", + use: { + browserName: "chromium" + } + } + ] + : [ + { + name: "Firefox", + use: { browserName: "firefox" } + }, + { + name: "WebKit", + use: { browserName: "webkit" } + } + ] }; + +export default config;