From 3afba9815bb91820e33435ba7f8bb3ade068fade Mon Sep 17 00:00:00 2001 From: Morgan Ney Date: Tue, 16 Jan 2024 18:11:43 -0600 Subject: [PATCH] test: only webkit on ci. (#177) --- .github/workflows/e2e.yml | 1 - playwright.config.ts | 61 +++++++++++++++++++++++++-------------- 2 files changed, 40 insertions(+), 22 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 9f65b20..f3c7df9 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -22,7 +22,6 @@ jobs: sudo cp mkcert-v*-linux-amd64 /usr/local/bin/mkcert - name: Install Certificates run: | - mkcert -install mkcert -install mkcert -key-file busmap.localhost-key.pem -cert-file busmap.localhost.pem busmap.localhost localhost cp *.pem packages/web/certs diff --git a/playwright.config.ts b/playwright.config.ts index 4ea98c5..7742d4f 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -31,27 +31,47 @@ export default defineConfig({ }, /* Configure projects for major browsers */ - projects: [ - { - name: 'chromium', - use: { ...devices['Desktop Chrome'] } - }, + projects: process.env.CI + ? [ + /** + * Ubuntu and mkcert issues with Chrome / Firefox + * @see https://github.com/FiloSottile/mkcert/issues/447 + * + * Other option is to use macos GitHub action runner and + * install docker, etc. Could also, use `ignoreHTTPSErrors` + * from playwright in the test specs to cover more browsers. + */ + { + name: 'webkit', + use: { ...devices['Desktop Safari'] } + }, - { - name: 'webkit', - use: { ...devices['Desktop Safari'] } - }, + /* Test against mobile viewports. */ + { + name: 'Mobile Safari', + use: { ...devices['iPhone 12'] } + } + ] + : [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] } + }, + { + name: 'webkit', + use: { ...devices['Desktop Safari'] } + }, - /* Test against mobile viewports. */ - { - name: 'Mobile Chrome', - use: { ...devices['Pixel 5'] } - }, - { - name: 'Mobile Safari', - use: { ...devices['iPhone 12'] } - } - ], + /* Test against mobile viewports. */ + { + name: 'Mobile Chrome', + use: { ...devices['Pixel 5'] } + }, + { + name: 'Mobile Safari', + use: { ...devices['iPhone 12'] } + } + ], /* Run your local dev server before starting the tests */ webServer: { @@ -59,7 +79,6 @@ export default defineConfig({ ignoreHTTPSErrors: true, url: 'https://localhost/healthcheck', reuseExistingServer: !process.env.CI, - timeout: 60_000 * 7, - stdout: 'pipe' + timeout: 60_000 * 7 } })