forked from Accenture/Ocaramba
-
Notifications
You must be signed in to change notification settings - Fork 1
/
appveyor.yml
376 lines (231 loc) · 19.9 KB
/
appveyor.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
skip_commits:
files:
- README.md
version: $(frameworkVersion).{build}
branches:
except:
- gh-pages
configuration: Release
init:
- ps: >-
if ($env:APPVEYOR_REPO_TAG -eq "true")
{
Update-AppveyorBuild -Version "$env:APPVEYOR_REPO_TAG_NAME.$env:APPVEYOR_BUILD_NUMBER"
$env:frameworkVersion = "$env:APPVEYOR_REPO_TAG_NAME"
}
echo 'frameworkVersion' $env:frameworkVersion
echo 'version' $env:appveyor_build_version
echo 'seleniumGridVersion' $env:seleniumGridVersion
echo 'seleniumGridUrl' $env:seleniumGridUrl
assembly_info:
patch: true
file: '**\AssemblyInfo.*'
assembly_version: $(frameworkVersion)
assembly_file_version: '{version}'
assembly_informational_version: $(frameworkVersion)
environment:
APPVEYOR_RDP_PASSWORD:
secure: 3OiDAcFLoSt3UCnmEU XgM2d541PAqCNJAPqoiRqwRI=
frameworkVersion: 3.1.3
seleniumGridVersion: selenium-server-standalone-3.141.59.jar
seleniumGridUrl: http://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.59.jar
GithubAuthToken:
secure: x9uTnOFLUnZ6DiVhpBBxIJxij33Sz9uAIe qef6M3sj9 J/AUmpfBmiGgqRabTqs
COVERALLS_REPO_TOKEN:
secure: ast5HH2v0jAME1tKDxPMw3TExnMxNp1 wXBea5zIzGNaKBm8ojTzv6YB03eQtEi
browserstackuser:
secure: 0JGVozUyY/OYBuPZk2Pbgw==
browserstackkey:
secure: opcJPLrPneM8MyVpapvon/18SF9oGQ0 ylJINJeio78=
testingbotkey:
secure: 1aRAvq8QRbkPLQb7BWdggEqsgd0P8Wbn96zGFb9iBG75eWbexX5n38Zadmxkv2ng
testingbotsecret:
secure: 6hiQzkSN5XvXxWg idSkvJSaNni9ZTCPwlWZy1s7BkagXFyrfUPmNdRWdWwy08B8
saucelabsusername:
secure: DlenWuQD9Ml7NAMwOkaHcA==
saucelabsaccessKey:
secure: D6Yy/Ng4/rfzsqQmnzwmTtN/Knee3c8/NtI1HgKke2ybA/6WpqP38RQfSHENYECa
before_build:
- cmd: >-
nuget restore
build:
project: TestFramework.sln
verbosity: minimal
after_build:
- ps: >-
echo '********************************************Creating nuget packages********************************************'
Copy-Item .\.nuspec\Objectivity.Test.Automation.Nunit.nuspec .\\Objectivity.Test.Automation.Common\\Objectivity.Test.Automation.Common.nuspec
nuget pack .\Objectivity.Test.Automation.Common\Objectivity.Test.Automation.Common.csproj -symbols -properties Configuration=Release
Copy-Item .\.nuspec\Objectivity.Test.Automation.MsTest.nuspec .\\Objectivity.Test.Automation.Common\\Objectivity.Test.Automation.Common.nuspec
nuget pack .\Objectivity.Test.Automation.Common\Objectivity.Test.Automation.Common.csproj -symbols -properties Configuration=Release
Copy-Item .\.nuspec\Objectivity.Test.Automation.MsTest.nuspec .\\Objectivity.Test.Automation.Common\\Objectivity.Test.Automation.Common.nuspec
nuget pack .\Objectivity.Test.Automation.Common\Objectivity.Test.Automation.Common.csproj -symbols -properties Configuration=Release
Copy-Item .\.nuspec\Objectivity.Test.Automation.Features.nuspec .\\Objectivity.Test.Automation.Common\\Objectivity.Test.Automation.Common.nuspec
nuget pack .\Objectivity.Test.Automation.Common\Objectivity.Test.Automation.Common.csproj -symbols -properties Configuration=Release
Copy-Item .\.nuspec\Objectivity.Test.Automation.Xunit.nuspec .\\Objectivity.Test.Automation.Common\\Objectivity.Test.Automation.Common.nuspec
nuget pack .\Objectivity.Test.Automation.Common\Objectivity.Test.Automation.Common.csproj -symbols -properties Configuration=Release
echo '********************************************Copying files for gh-pages********************************************'
Copy-Item -Path .\README.md -Destination .\Objectivity.Test.Automation.Common.Documentation\Help\ -recurse -force -verbose
New-Item .\Objectivity.Test.Automation.Common.Documentation\Help\Objectivity.Test.Automation.Common.Documentation\icons\ -Type Directory
Copy-Item -Path .\Objectivity.Test.Automation.Common.Documentation\icons\Objectivity_logo_avatar.png -Destination .\Objectivity.Test.Automation.Common.Documentation\Help\Objectivity.Test.Automation.Common.Documentation\icons\ -recurse -force -verbose
Copy-Item -Path .\Objectivity.Test.Automation.Common.Documentation\icons\Help.png -Destination .\Objectivity.Test.Automation.Common.Documentation\Help\Objectivity.Test.Automation.Common.Documentation\icons\ -recurse -force -verbose
if ($env:APPVEYOR_REPO_TAG -eq "true")
{
echo '********************************************Cloning gh-pages branch********************************************'
Invoke-Expression "git config --global credential.helper store"
Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:GithubAuthToken):[email protected]`n"
Invoke-Expression "git config --global core.autocrlf true"
Invoke-Expression "git config --global user.email '[email protected]'"
Invoke-Expression "git config --global user.name 'TestAutomationGroup'"
Invoke-Expression "git clone https://github.com/ObjectivityLtd/Test.Automation.git --branch gh-pages .\Help"
Remove-Item -recurse .\Help\* -exclude .git
} else
{
New-Item -ItemType Directory -Force -Path .\Help
}
Copy-Item -Path .\Objectivity.Test.Automation.Common.Documentation\Help\** -Destination .\Help\ -recurse -force
if ($env:APPVEYOR_REPO_TAG -eq "true")
{
echo '********************************************Publishing new version of gh-pages********************************************'
cd .\\Help
Invoke-Expression "git add --all"
Invoke-Expression "git commit -m 'Publishing to gh-pages $env:appveyor_build_version'"
Invoke-Expression "git push origin gh-pages --porcelain"
cd ..
Remove-Item .\\Help\\.git -Force -Recurse -ErrorAction SilentlyContinue
}
7z a gh-pages_$env:appveyor_build_version.zip .\\Help\\**
appveyor PushArtifact gh-pages_$env:appveyor_build_version.zip
test_script:
- ps: >-
echo '********************************************Executing tests********************************************'
$OpenCover = (Resolve-Path ".\packages\OpenCover.*\tools\OpenCover.Console.exe").ToString()
echo '********************************************XUnit tests********************************************'
$xunit = (Resolve-Path ".\packages\xunit.runner.console.*\tools\xunit.console.exe").ToString()
& $OpenCover -target:"$xunit" -mergeoutput -targetargs:".\Objectivity.Test.Automation.Tests.Xunit\bin\Release\Objectivity.Test.Automation.Tests.Xunit.dll -appveyor -noshadow" -filter:" [Objectivity.Test.Automation.Common]*" -register:user -output:opencoverCoverage.xml
if($lastexitcode -ne 0)
{
echo $lastexitcode
}
7z a testresults_$env:appveyor_build_version.zip .\Objectivity.Test.Automation.Tests.Xunit\bin\Release\**\*.png
7z a testresults_$env:appveyor_build_version.zip .\Objectivity.Test.Automation.Tests.Xunit\bin\Release\**\*.html
7z a testresults_$env:appveyor_build_version.zip .\Objectivity.Test.Automation.Tests.Xunit\bin\Release\*.log
echo '********************************************NUnit tests********************************************'
& $OpenCover -target:nunit3-console.exe -mergeoutput -targetargs:".\Objectivity.Test.Automation.Tests.NUnit\bin\Release\Objectivity.Test.Automation.Tests.NUnit.dll .\Objectivity.Test.Automation.Tests.Angular\bin\Release\Objectivity.Test.Automation.Tests.Angular.dll .\Objectivity.Test.Automation.Tests.Features\bin\Release\Objectivity.Test.Automation.Tests.Features.dll .\Objectivity.Test.Automation.UnitTests\bin\Release\Objectivity.Test.Automation.UnitTests.dll --result=myresults.xml`;format=AppVeyor" -filter:" [Objectivity.Test.Automation.Common]*" -register:user -output:opencoverCoverage.xml
if($lastexitcode -ne 0)
{
echo $lastexitcode
}
7z a testresults_$env:appveyor_build_version.zip .\Objectivity.Test.Automation.Tests.NUnit\bin\Release\**\*.png
7z a testresults_$env:appveyor_build_version.zip .\Objectivity.Test.Automation.Tests.NUnit\bin\Release\**\*.html
7z a testresults_$env:appveyor_build_version.zip .\Objectivity.Test.Automation.Tests.NUnit\bin\Release\*.log
7z a testresults_$env:appveyor_build_version.zip .\Objectivity.Test.Automation.Tests.Angular\bin\Release\**\*.png
7z a testresults_$env:appveyor_build_version.zip .\Objectivity.Test.Automation.Tests.Angular\bin\Release\**\*.html
7z a testresults_$env:appveyor_build_version.zip .\Objectivity.Test.Automation.Tests.Angular\bin\Release\*.log
7z a testresults_$env:appveyor_build_version.zip .\Objectivity.Test.Automation.Tests.Features\bin\Release\**\*.png
7z a testresults_$env:appveyor_build_version.zip .\Objectivity.Test.Automation.Tests.Features\bin\Release\**\*.html
7z a testresults_$env:appveyor_build_version.zip .\Objectivity.Test.Automation.Tests.Features\bin\Release\*.log
echo '********************************************Unit tests for Firefox********************************************'
.\scripts\set_AppConfig_for_tests.ps1 ".\Objectivity.Test.Automation.UnitTests\bin\Release" "Objectivity.Test.Automation.UnitTests.dll.config" "//appSettings" "browser" "Firefox"
& $OpenCover -target:nunit3-console.exe -mergeoutput -targetargs:".\Objectivity.Test.Automation.UnitTests\bin\Release\Objectivity.Test.Automation.UnitTests.dll --where:cat=TakingScreehShots --result=myresults.xml`;format=AppVeyor" -filter:" [Objectivity.Test.Automation.Common]*" -register:user -output:opencoverCoverage.xml
if($lastexitcode -ne 0)
{
echo $lastexitcode
}
7z a testresults_$env:appveyor_build_version.zip .\Objectivity.Test.Automation.UnitTests\bin\Release\**\*.png
7z a testresults_$env:appveyor_build_version.zip .\Objectivity.Test.Automation.UnitTests\bin\Release\**\*.html
7z a testresults_$env:appveyor_build_version.zip .\Objectivity.Test.Automation.UnitTests\bin\Release\*.log
echo '********************************************MSTest tests********************************************'
& $OpenCover -target:vstest.console.exe -mergeoutput -targetargs:"/logger`:Appveyor .\Objectivity.Test.Automation.Tests.MSTest\bin\Release\Objectivity.Test.Automation.Tests.MsTest.dll /Settings`:.\Objectivity.Test.Automation.Tests.MSTest\bin\Release\Runsettings.runsettings" -filter:" [Objectivity.Test.Automation.Common]*" -register:user -output:opencoverCoverage.xml
if($lastexitcode -ne 0)
{
echo $lastexitcode
}
7z a testresults_$env:appveyor_build_version.zip .\Objectivity.Test.Automation.Tests.MSTest\bin\Release\**\*.png
7z a testresults_$env:appveyor_build_version.zip .\Objectivity.Test.Automation.Tests.MSTest\bin\Release\**\*.html
7z a testresults_$env:appveyor_build_version.zip .\Objectivity.Test.Automation.Tests.MSTest\bin\Release\*.log
echo '********************************************CloudProviderCrossBrowser tests********************************************'
echo '********************************************BrowserStack tests********************************************'
.\scripts\set_AppConfig_for_tests.ps1 ".\Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser\bin\Release" "Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser.dll.config" "//appSettings" "RemoteWebDriverHub" "http://$($env:browserstackuser):$($env:browserstackkey)@hub-cloud.browserstack.com/wd/hub"
.\scripts\set_AppConfig_for_tests.ps1 ".\Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser\bin\Release" "Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser.dll.config" "//DriverCapabilities" "build" "Objectivity.Test.Automation.Tests.BrowserStackCrossBrowser$env:appveyor_build_version" $true
& $OpenCover -target:nunit3-console.exe -mergeoutput -targetargs:".\Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser\bin\Release\Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser.dll --workers=5 --result=myresults.xml`;format=AppVeyor" -filter:" [Objectivity.Test.Automation.Common]*" -register:user -output:opencoverCoverage.xml
if($lastexitcode -ne 0)
{
echo $lastexitcode
}
<#echo '********************************************testingbot.com tests********************************************'
.\scripts\set_AppConfig_for_tests.ps1 ".\Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser\bin\Release" "Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser.dll.config" "//appSettings" "RemoteWebDriverHub" "https://hub.testingbot.com/wd/hub/" $true
.\scripts\set_AppConfig_for_tests.ps1 ".\Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser\bin\Release" "Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser.dll.config" "//DriverCapabilities" "key|secret|build|browserstack.user" "$env:testingbotkey|$env:testingbotsecret|Objectivity.Test.Automation.Tests.TestingBotCrossBrowser$env:appveyor_build_version|empty"
& $OpenCover -target:nunit3-console.exe -mergeoutput -targetargs:".\Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser\bin\Release\Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser.dll --workers=5 --result=myresults.xml`;format=AppVeyor" -filter:" [Objectivity.Test.Automation.Common]*" -register:user -output:opencoverCoverage.xml
if($lastexitcode -ne 0)
{
echo $lastexitcode
}#>
echo '********************************************saucelabs tests********************************************'
.\scripts\set_AppConfig_for_tests.ps1 ".\Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser\bin\Release" "Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser.dll.config" "//appSettings" "RemoteWebDriverHub" "http://$($env:saucelabsusername):$($env:saucelabsaccessKey)@ondemand.saucelabs.com:80/wd/hub"
.\scripts\set_AppConfig_for_tests.ps1 ".\Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser\bin\Release" "Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser.dll.config" "//DriverCapabilities" "build" "Objectivity.Test.Automation.Tests.SauceLabsCrossBrowser$env:appveyor_build_version" $true
.\scripts\set_AppConfig_for_tests.ps1 ".\Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser\bin\Release" "Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser.dll.config" "//environments/Safari" "platform" "macOS 10.13" $true
& nunit3-console.exe .\Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser\bin\Release\Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser.dll --workers=5 --where "test =~ Chrome || test =~ IE || test =~ Safari" --result=myresults.xml`;format=AppVeyor
if($lastexitcode -ne 0)
{
echo $lastexitcode
}
echo '********************************************Downloading Selenium Grid********************************************'
$url = $env:seleniumGridUrl
$grid = $env:seleniumGridVersion
$output = $env:APPVEYOR_BUILD_FOLDER "\Objectivity.Test.Automation.Tests.NUnit\bin\Release\$grid"
$outputLogs = $env:APPVEYOR_BUILD_FOLDER "\Objectivity.Test.Automation.Tests.NUnit\bin\Release\"
$start_time = Get-Date
echo "Downloading Selenium Grid from:" $url
$wc = New-Object System.Net.WebClient
(New-Object System.Net.WebClient).DownloadFile($url, $output)
echo "Selenium Grid downloaded to:" $output
echo "Time taken to download $($grid): $((Get-Date).Subtract($start_time).Seconds) second(s)"
echo '********************************************Start Selenium Grid in background****************************************'
$appHub=Start-Process java -ArgumentList '-jar', $output' -role hub' -RedirectStandardOutput $outputLogs'console_hub.out' -RedirectStandardError $outputLogs'console_hub.err' -passthru
Start-Sleep -s 5
echo "Selenium Grid hub started"
$appNode=Start-Process java -ArgumentList '-jar', $output' -role node -hub http://localhost:4444/grid/register' -RedirectStandardOutput $outputLogs'console_node.out' -RedirectStandardError $outputLogs'console_node.err' -passthru
Start-Sleep -s 5
echo "Selenium Grid node started"
echo '********************************************Run tests with Selenium Grid ****************************************'
.\scripts\set_AppConfig_for_tests.ps1 ".\Objectivity.Test.Automation.Tests.NUnit\bin\Release\" "Objectivity.Test.Automation.Tests.NUnit.dll.config" "//appSettings" "browser|RemoteWebDriverHub" "RemoteWebDriver|http://localhost:4444/wd/hub" $true
& $OpenCover -target:nunit3-console.exe -mergeoutput -targetargs:".\Objectivity.Test.Automation.Tests.NUnit\bin\Release\Objectivity.Test.Automation.Tests.NUnit.dll --where (cat==BasicNUnit) --result=myresults.xml`;format=AppVeyor" -filter:" [Objectivity.Test.Automation.Common]*" -register:user -output:opencoverCoverage.xml
if($lastexitcode -ne 0)
{
echo $lastexitcode
}
echo '*****************************Run CloudProviderCrossBrowser tests with Selenium Grid****************************'
.\scripts\set_AppConfig_for_tests.ps1 ".\Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser\bin\Release" "Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser.dll.config" "//appSettings" "RemoteWebDriverHub" "http://localhost:4444/wd/hub" $true
& nunit3-console.exe .\Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser\bin\Release\Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser.dll --where "test =~ Chrome" --result=myresults.xml`;format=AppVeyor
if($lastexitcode -ne 0)
{
echo $lastexitcode
}
echo '*****************************Stop Selenium Grid****************************'
echo "Stop Selenium Grid node"
Stop-Process -Id $appNode.Id
echo "Stop Selenium Grid hub"
Stop-Process -Id $appHub.Id
echo '*****************************Add Selenium Grid logs to testresults****************************'
7z a testresults_$env:appveyor_build_version.zip .\Objectivity.Test.Automation.Tests.NUnit\bin\Release\*.err
7z a testresults_$env:appveyor_build_version.zip .\Objectivity.Test.Automation.Tests.NUnit\bin\Release\*.out
echo '********************************************Sending coverage test results********************************************'
$coveralls = (Resolve-Path ".\packages\coveralls.net.*\tools\csmacnz.coveralls.exe").ToString()
& $coveralls --opencover -i opencoverCoverage.xml --repoToken $env:COVERALLS_REPO_TOKEN --useRelativePaths --commitId $env:APPVEYOR_REPO_COMMIT --commitBranch $env:APPVEYOR_REPO_BRANCH --commitAuthor $env:APPVEYOR_REPO_COMMIT_AUTHOR --commitEmail $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL --commitMessage $env:APPVEYOR_REPO_COMMIT_MESSAGE --jobId $env:APPVEYOR_BUILD_NUMBER --serviceName appveyor
7z a testresults_$env:appveyor_build_version.zip opencoverCoverage.xml
echo '********************************************Uploading test results artifact********************************************'
7z a testresults_$env:appveyor_build_version.zip .\Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser\bin\Release\**\*.png
7z a testresults_$env:appveyor_build_version.zip .\Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser\bin\Release\**\*.html
7z a testresults_$env:appveyor_build_version.zip .\Objectivity.Test.Automation.Tests.CloudProviderCrossBrowser\bin\Release\*.log
appveyor PushArtifact testresults_$env:appveyor_build_version.zip
artifacts:
- path: .\Objectivity.Test.Automation.Common.*.nupkg
name: NuGet
deploy:
- provider: NuGet
api_key:
secure: 3oOPQoiQEcO33c/fxjAMdvjTlmB3dHrc/uwV9ehKYjNARfzrBT xmuLCjTtKrI9F
on:
branch: master
appveyor_repo_tag: true