Skip to content

Commit 692f4db

Browse files
authored
devops(ci): added job for testing package installations (#1572)
Closes #1518
1 parent a1f22aa commit 692f4db

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

.github/workflows/tests.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,43 @@ jobs:
197197
with:
198198
name: firefox-win-testrun.log
199199
path: firefox-win-testrun.log
200+
test-package-installations:
201+
runs-on: ubuntu-latest
202+
steps:
203+
- uses: actions/checkout@v2
204+
- name: Install dependencies
205+
run: |
206+
sudo apt update
207+
# chromium dependencies
208+
sudo apt-get install libgbm1
209+
# webkit dependencies
210+
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
211+
- uses: actions/setup-node@v1
212+
with:
213+
node-version: 10.15
214+
- run: npm install
215+
- run: npm link
216+
- name: Running e2e test for playwright
217+
run: |
218+
npm link playwright-core
219+
node install.js
220+
node ../../test/e2e/stub.js chromium firefox webkit
221+
working-directory: packages/playwright
222+
- name: Running e2e test for playwright-chromium
223+
run: |
224+
npm link playwright-core
225+
node install.js
226+
node ../../test/e2e/stub.js chromium
227+
working-directory: packages/playwright-chromium
228+
- name: Running e2e test for playwright-webkit
229+
run: |
230+
npm link playwright-core
231+
node install.js
232+
node ../../test/e2e/stub.js webkit
233+
working-directory: packages/playwright-webkit
234+
- name: Running e2e test for playwright-firefox
235+
run: |
236+
npm link playwright-core
237+
node install.js
238+
node ../../test/e2e/stub.js firefox
239+
working-directory: packages/playwright-firefox

test/e2e/stub.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const playwright = require(process.cwd());
2+
3+
if (process.argv.length === 2) {
4+
console.error("Usage stub.js <browser-types-space-separated>");
5+
process.exit(1);
6+
}
7+
8+
const browsers = process.argv.slice(2, process.argv.length);
9+
10+
(async () => {
11+
for (const browserType of browsers) {
12+
const browser = await playwright[browserType].launch();
13+
const context = await browser.newContext();
14+
const page = await context.newPage();
15+
await page.evaluate(() => navigator.userAgent);
16+
await browser.close();
17+
}
18+
})().catch(err => {
19+
console.error(err);
20+
process.exit(1);
21+
});

0 commit comments

Comments
 (0)