Skip to content

Commit

Permalink
devops(ci): added job for testing package installations (#1572)
Browse files Browse the repository at this point in the history
Closes #1518
  • Loading branch information
mxschmitt authored Apr 2, 2020
1 parent a1f22aa commit 692f4db
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
21 changes: 21 additions & 0 deletions test/e2e/stub.js
Original file line number Diff line number Diff line change
@@ -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);
});

0 comments on commit 692f4db

Please sign in to comment.