Skip to content

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

devops(ci): added job for testing package installations (#1572)

Max Schmitt692f4db0a7d0
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 506c7eb5c3..751d361fe9 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 0000000000..c7c3b2b5a2
--- /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 <browser-types-space-separated>");
+ 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);
+});