-
Notifications
You must be signed in to change notification settings - Fork 4
/
azure-pipelines.yml
107 lines (93 loc) · 2.69 KB
/
azure-pipelines.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
trigger:
- master
pool:
vmImage: 'windows-latest'
jobs:
- job: sonar
displayName: Analyse code with SonarQube
steps:
- task: SonarCloudPrepare@2
displayName: 'Prepare SonarCloud analysis'
inputs:
SonarCloud: 'SonarCloud'
organization: 'aqualityautomation'
scannerMode: 'CLI'
configMode: 'file'
extraProperties: 'sonar.coverage.exclusions=**/**'
- task: Maven@4
displayName: 'Build project'
inputs:
mavenPomFile: 'pom.xml'
goals: 'clean'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
mavenVersionOption: 'Default'
mavenAuthenticateFeed: false
effectivePomSkip: false
sonarQubeRunAnalysis: false
- task: SonarCloudAnalyze@2
inputs:
jdkversion: 'JAVA_HOME_21_X64'
displayName: 'Run SonarCloud code analysis'
continueOnError: true
- task: SonarCloudPublish@2
displayName: 'Publish SonarCloud quality gate results'
inputs:
pollingTimeoutSec: '300'
- job: tests
displayName: Run tests
steps:
- task: NodeTool@0
displayName: 'Install Node.js'
inputs:
versionSpec: '16.x'
- task: CmdLine@2
displayName: 'Install Appium'
inputs:
script: |
echo "Installing Appium"
npm install -g appium@next
appium --version
echo "Appium installed"
- task: CmdLine@2
displayName: 'Install and Run Appium doctor'
inputs:
script: |
echo "Installing and Running Appium doctor"
npm install -g request@2.34.0
npm install -g appium-doctor@1.15.1
appium-doctor
echo "Appium doctor installed and executed"
- task: CmdLine@2
displayName: 'Install Appium Windows Driver'
inputs:
script: |
echo "Installing Appium Windows Driver"
appium driver install --source=npm appium-windows-driver
appium driver list
echo "Appium Windows Driver installed"
- task: CmdLine@2
displayName: 'Start Appium server'
inputs:
script: |
start cmd.exe @cmd /k "appium"
echo "Appium server started"
- task: ScreenResolutionUtility@1
displayName: 'Set optimal screen resolution'
inputs:
displaySettings: 'optimal'
- task: Maven@4
displayName: 'Run tests'
inputs:
mavenPomFile: 'pom.xml'
goals: 'clean test -Dprofile=local'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
mavenVersionOption: 'Default'
mavenAuthenticateFeed: false
effectivePomSkip: false
sonarQubeRunAnalysis: false