Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore: add yml for service2 test mode (#24441)

Pavel Feldman1ddfcf503d9e
diff --git a/.github/workflows/tests_service.yml b/.github/workflows/tests_service.yml
new file mode 100644
index 0000000000..44e9e83f61
--- /dev/null
+++ b/.github/workflows/tests_service.yml
@@ -0,0 +1,31 @@
+name: "tests service"
+
+on:
+ workflow_dispatch:
+
+env:
+ FORCE_COLOR: 1
+ ELECTRON_SKIP_BINARY_DOWNLOAD: 1
+
+jobs:
+ transport_linux:
+ name: "Service"
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [linux]
+ browser: [chromium]
+ runs-on: ubuntu-20.04
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ - run: npm ci
+ env:
+ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
+ - run: npm run build
+ - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test -- --project=${{ matrix.browser }} --workers=20
+ env:
+ PWTEST_MODE: service2
+ PLAYWRIGHT_SERVICE_ACCESS_KEY: ${{ secrets.PLAYWRIGHT_SERVICE_ACCESS_KEY }}
+ PLAYWRIGHT_SERVICE_URL: ${{ secrets.PLAYWRIGHT_SERVICE_URL }}
+ PLAYWRIGHT_SERVICE_OS: ${{ matrix.os }}
diff --git a/tests/library/playwright.config.ts b/tests/library/playwright.config.ts
index d04d6ed9f8..76f84f27c8 100644
--- a/tests/library/playwright.config.ts
+++ b/tests/library/playwright.config.ts
@@ -53,7 +53,7 @@ const reporters = () => {
return result;
};
-const os: 'linux' | 'windows' = 'linux'; // use linux
+const os: 'linux' | 'windows' = (process.env.PLAYWRIGHT_SERVICE_OS as 'linux' | 'windows') || 'linux';
const runId = new Date().toISOString(); // name the test run
let connectOptions: any;