-
Notifications
You must be signed in to change notification settings - Fork 14
90 lines (83 loc) · 2.49 KB
/
e2e.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: "ui-test"
on:
workflow_dispatch:
inputs:
target-testplan-name:
description: "For example: APIC240830. Sync test result to this test plan."
required: false
type: string
push:
branches: ["dev", "main"]
pull_request:
branches: ["dev", "main"]
jobs:
e2e-test:
runs-on: ubuntu-latest
env:
CI: true
steps:
- name: checkout
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: actions/setup-node@v2
with:
node-version: lts/*
- name: Setup project
run: |
npm install
npm run package
- name: setup account
uses: jsdaniell/create-json@v1
with:
name: "config.json"
json: ${{ secrets.ACCOUNT_CONFIG }}
dir: "./src/test/e2e"
- run: |
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" npx playwright test
working-directory: ./src/test/e2e
- if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
test-results
test-plan-update:
needs: e2e-test
if: ${{ always() && github.event.inputs.target-testplan-name != '' }}
environment: engineering
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest
env:
AUTO_TEST_PLAN_ID: 26611787
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Setup project
run: |
npm install
- uses: azure/login@v2
with:
client-id: ${{secrets.DEVOPS_CLIENT_ID}}
tenant-id: ${{secrets.DEVOPS_TENANT_ID}}
subscription-id: ${{secrets.DEVOPS_SUB_ID}}
enable-AzPSSession: true
- name: Archive Test Plan
working-directory: ./src/test/e2e
run: |
testplanid=`npx ts-node scripts/testPlan.ts obtain vscode ${{ github.event.inputs.target-testplan-name }}`
echo "Testplan id is $testplanid"
npx ts-node scripts/testPlan.ts archive $testplanid
- name: Download TestPlan
uses: actions/download-artifact@v3
with:
path: ./test-results
- name: Sync to Azure DevOps Test Plan
working-directory: ./src/test/e2e
run: |
npx ts-node scripts/testPlan.ts report ./testplan.json ../../../test-results