Skip to content

Commit

Permalink
test: experiment with full e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed Jun 28, 2023
1 parent 4982b5f commit 84b0eb8
Show file tree
Hide file tree
Showing 6 changed files with 422 additions and 1 deletion.
32 changes: 31 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
FORCE_COLOR: 1

jobs:
build:
test:
runs-on: ${{ matrix.os }}
name: Run tests on ${{ matrix.os }}, Node ${{ matrix.node-version }}
strategy:
Expand Down Expand Up @@ -40,3 +40,33 @@ jobs:
name: vsc-extension
path: "*.vsix"
retention-days: 30
test-e2e:
runs-on: ${{ matrix.os }}
name: Run e2e tests
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- run: npx playwright install --with-deps
- run: npm run build
- run: npm ci
working-directory: ./tests-integration
- run: xvfb-run npx playwright test
working-directory: ./tests-integration
if: matrix.os == 'ubuntu-latest'
- run: npx playwright test
working-directory: ./tests-integration
if: matrix.os != 'ubuntu-latest'
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report-${{ matrix.os }}
path: tests-integration/playwright-report/
retention-days: 30
234 changes: 234 additions & 0 deletions tests-integration/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions tests-integration/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "tests-integration",
"devDependencies": {
"@vscode/test-electron": "^2.3.3"
}
}
40 changes: 40 additions & 0 deletions tests-integration/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* Copyright (c) Microsoft Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { defineConfig } from '@playwright/test';
import { TestOptions } from './tests/baseTest';

export default defineConfig<void, TestOptions>({
reporter: process.env.CI ? 'html' : 'list',
timeout: 120_000,
workers: 1,
expect: {
timeout: 30_000,
},
projects: [
{
name: 'VSCode stable',
use: {
vscodeVersion: 'stable',
}
},
{
name: 'VSCode insiders',
use: {
vscodeVersion: 'insiders',
}
}
]
});
Loading

0 comments on commit 84b0eb8

Please sign in to comment.