From 692f4db0a7d06d0857465522ee226aec72b8d40a Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Thu, 2 Apr 2020 20:25:03 +0200 Subject: [PATCH] devops(ci): added job for testing package installations (#1572) Closes #1518 --- .github/workflows/tests.yml | 40 +++++++++++++++++++++++++++++++++++++ test/e2e/stub.js | 21 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 test/e2e/stub.js diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 506c7eb5c352c..751d361fe902a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -197,3 +197,43 @@ jobs: with: name: firefox-win-testrun.log path: firefox-win-testrun.log + test-package-installations: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: | + sudo apt update + # chromium dependencies + sudo apt-get install libgbm1 + # webkit dependencies + sudo apt-get install libwoff1 libopus0 libwebp6 libwebpdemux2 libenchant1c2a libgudev-1.0-0 libsecret-1-0 libhyphen0 libgdk-pixbuf2.0-0 libegl1 libgles2 libevent-2.1-6 libnotify4 libvpx5 libxslt1.1 + - uses: actions/setup-node@v1 + with: + node-version: 10.15 + - run: npm install + - run: npm link + - name: Running e2e test for playwright + run: | + npm link playwright-core + node install.js + node ../../test/e2e/stub.js chromium firefox webkit + working-directory: packages/playwright + - name: Running e2e test for playwright-chromium + run: | + npm link playwright-core + node install.js + node ../../test/e2e/stub.js chromium + working-directory: packages/playwright-chromium + - name: Running e2e test for playwright-webkit + run: | + npm link playwright-core + node install.js + node ../../test/e2e/stub.js webkit + working-directory: packages/playwright-webkit + - name: Running e2e test for playwright-firefox + run: | + npm link playwright-core + node install.js + node ../../test/e2e/stub.js firefox + working-directory: packages/playwright-firefox diff --git a/test/e2e/stub.js b/test/e2e/stub.js new file mode 100644 index 0000000000000..c7c3b2b5a2267 --- /dev/null +++ b/test/e2e/stub.js @@ -0,0 +1,21 @@ +const playwright = require(process.cwd()); + +if (process.argv.length === 2) { + console.error("Usage stub.js "); + process.exit(1); +} + +const browsers = process.argv.slice(2, process.argv.length); + +(async () => { + for (const browserType of browsers) { + const browser = await playwright[browserType].launch(); + const context = await browser.newContext(); + const page = await context.newPage(); + await page.evaluate(() => navigator.userAgent); + await browser.close(); + } +})().catch(err => { + console.error(err); + process.exit(1); +});