Created
October 4, 2022 23:28
-
-
Save jasonLaster/d83319f920a881087efd5cdedd4414cd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/packages/e2e-tests/package.json b/packages/e2e-tests/package.json | |
index df53be109..b000905da 100644 | |
--- a/packages/e2e-tests/package.json | |
+++ b/packages/e2e-tests/package.json | |
@@ -10,6 +10,7 @@ | |
"test": "playwright test", | |
"test:chromium": "playwright test --project chromium --reporter=@replayio/playwright/reporter,line", | |
"test:replay-chromium": "playwright test --project replay-chromium --reporter=@replayio/playwright/reporter,line", | |
+ "test:record": "RECORD=true playwright test --reporter=@replayio/playwright/reporter,line", | |
"test:debug": "DEBUG=1 playwright test", | |
"test:install": "playwright install", | |
"ts-node": "ts-node --project ../../tsconfig.json" | |
diff --git a/packages/e2e-tests/playwright.config.ts b/packages/e2e-tests/playwright.config.ts | |
index 1065b5322..4b24672cf 100644 | |
--- a/packages/e2e-tests/playwright.config.ts | |
+++ b/packages/e2e-tests/playwright.config.ts | |
@@ -1,7 +1,36 @@ | |
import { PlaywrightTestConfig, devices } from "@playwright/test"; | |
import { devices as replayDevices } from "@replayio/playwright"; | |
-const { CI, DEBUG, SLOW_MO } = process.env; | |
+const { CI, DEBUG, SLOW_MO, RECORD } = process.env; | |
+ | |
+let projects = [ | |
+ { | |
+ name: "chromium", | |
+ use: { ...devices["Desktop Chromium"] }, | |
+ }, | |
+]; | |
+ | |
+if (CI) { | |
+ projects = [ | |
+ { | |
+ name: "replay-chromium", | |
+ use: { ...(replayDevices["Replay Chromium"] as any) }, | |
+ }, | |
+ { | |
+ name: "chromium", | |
+ use: { ...devices["Desktop Chromium"] }, | |
+ }, | |
+ ]; | |
+} | |
+ | |
+if (RECORD) { | |
+ projects = [ | |
+ { | |
+ name: "replay-firefox", | |
+ use: { ...(replayDevices["Replay Firefox"] as any) }, | |
+ }, | |
+ ]; | |
+} | |
const config: PlaywrightTestConfig = { | |
use: { | |
@@ -25,31 +54,7 @@ const config: PlaywrightTestConfig = { | |
// Limit the number of workers on CI, use default locally | |
workers: CI ? 4 : undefined, | |
- projects: CI | |
- ? [ | |
- // { | |
- // name: "replay-firefox", | |
- // use: { ...(replayDevices["Replay Firefox"] as any) }, | |
- // }, | |
- // { | |
- // name: "firefox", | |
- // use: { ...devices["Desktop Firefox"] }, | |
- // }, | |
- { | |
- name: "replay-chromium", | |
- use: { ...(replayDevices["Replay Chromium"] as any) }, | |
- }, | |
- { | |
- name: "chromium", | |
- use: { ...devices["Desktop Chromium"] }, | |
- }, | |
- ] | |
- : [ | |
- { | |
- name: "chromium", | |
- use: { ...devices["Desktop Chromium"] }, | |
- }, | |
- ], | |
+ projects, | |
}; | |
if (DEBUG) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment