Skip to content

Commit

Permalink
Run playwright tests in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
planger committed Feb 3, 2022
1 parent 5ba2d9a commit ed1bee8
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ jobs:
with:
run: yarn browser test

- name: Test (playwright)
if: matrix.tests != 'skip' && runner.os == 'Linux' && matrix.node =='16.x'
uses: GabrielBB/xvfb-action@v1
with:
run: yarn test:playwright

- name: Test (electron)
if: matrix.tests != 'skip' && runner.os == 'Linux'
uses: GabrielBB/xvfb-action@v1
Expand Down
26 changes: 26 additions & 0 deletions examples/playwright/configs/playwright.ci.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/********************************************************************************
* Copyright (C) 2021 EclipseSource and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the Eclipse
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
* with the GNU Classpath Exception which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { PlaywrightTestConfig } from '@playwright/test';

import baseConfig from './playwright.config';

const ciConfig: PlaywrightTestConfig = {
...baseConfig,
workers: 1,
retries: 1
};

export default ciConfig;
1 change: 1 addition & 0 deletions examples/playwright/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"lint": "eslint -c ./.eslintrc.js --ext .ts ./src ./tests",
"lint:fix": "eslint -c ./.eslintrc.js --ext .ts ./src ./tests --fix",
"ui-tests": "yarn && playwright test --config=./configs/playwright.config.ts",
"ui-tests-ci": "yarn && playwright test --config=./configs/playwright.ci.config.ts",
"ui-tests-headful": "yarn && playwright test --config=./configs/playwright.headful.config.ts",
"ui-tests-report-generate": "allure generate ./allure-results --clean -o allure-results/allure-report",
"ui-tests-report": "yarn ui-tests-report-generate && allure open allure-results/allure-report"
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"rebuild:clean": "rimraf .browser_modules",
"test": "yarn -s test:theia && yarn -s electron test && yarn -s browser test",
"test:theia": "lerna run --scope \"@theia/!(example-)*\" test --stream --concurrency=1",
"test:playwright": "concurrently --success first -c gray,blue -k -n theia,playwright \"yarn browser start\" \"yarn -s --cwd examples/playwright ui-tests-ci\"",
"watch": "concurrently --kill-others -n tsc,browser,electron -c red,yellow,blue \"tsc -b -w --preserveWatchOutput\" \"yarn -s --cwd examples/browser watch:bundle\" \"yarn -s --cwd examples/electron watch:bundle\"",
"watch:compile": "concurrently --kill-others -n cleanup,tsc -c magenta,red \"ts-clean dev-packages/* packages/* -w\" \"tsc -b -w --preserveWatchOutput\"",
"performance:startup": "yarn -s performance:startup:browser && yarn -s performance:startup:electron",
Expand Down

0 comments on commit ed1bee8

Please sign in to comment.