]> source.dussan.org Git - archiva.git/commitdiff
Test
authorMartin Stockhammer <martin_s@apache.org>
Sun, 14 May 2017 18:57:11 +0000 (20:57 +0200)
committerMartin Stockhammer <martin_s@apache.org>
Sun, 14 May 2017 18:57:11 +0000 (20:57 +0200)
src/ci/scripts/updateSeleniumDrivers.ps1

index 79752ba73e83c4bf0b6405e80719b79b56d973bf..a711d5e9f3668f3d14d5424a6d544df44368e24c 100644 (file)
@@ -33,27 +33,39 @@ $psVersion = $PSVersionTable.PSVersion
 
 Write-Output "PS-Version: $psVersion"
 
+$urls = @{
+  "iedriver\2.53.1\win64\DriverServer.zip"="http://selenium-release.storage.googleapis.com/2.53/IEDriverServer_x64_2.53.1.zip"
+  "iedriver\2.53.1\win32\DriverServer.zip"="http://selenium-release.storage.googleapis.com/2.53/IEDriverServer_Win32_2.53.1.zip"
+  "iedriver\3.4.0\win64\DriverServer.zip"="http://selenium-release.storage.googleapis.com/3.4/IEDriverServer_x64_3.4.0.zip"
+  "iedriver\3.4.0\win32\DriverServer.zip"="http://selenium-release.storage.googleapis.com/3.4/IEDriverServer_Win32_3.4.0.zip"
+  "chromedriver\2.29\win32\DriverServer.zip"="https://chromedriver.storage.googleapis.com/2.29/chromedriver_win32.zip"
+  "geckodriver\0.16.1\win32\DriverServer.zip"="https://github.com/mozilla/geckodriver/releases/download/v0.16.1/geckodriver-v0.16.1-win32.zip"
+  "geckodriver\0.16.1\win64\DriverServer.zip"="https://github.com/mozilla/geckodriver/releases/download/v0.16.1/geckodriver-v0.16.1-win64.zip"
+}
 
+foreach ($h in $urls.GetEnumerator()) {
+  $url = $h.Value
+  $downloadFile = "C:\jenkins\tools\$($h.Name)"
+  $downloadDir = Split-Path $downloadFile -Parent
 
-$url = "http://selenium-release.storage.googleapis.com/2.53/IEDriverServer_x64_2.53.1.zip"
-$downloadFile = "C:\jenkins\tools\iedriver\2.53.1\win64\IEDriverServer_x64_2.53.1.zip"
-$downloadDir = Split-Path $downloadFile -Parent
+  if(!(Test-Path -Path $downloadDir )){
+    New-Item -ItemType directory -Path $downloadFile
 
-if(!(Test-Path -Path $downloadDir )){
-  New-Item -ItemType directory -Path $downloadFile
+  }
+  if ($Force -And (Test-Path -Path $downloadFile ) ) {
+    Remove-Item $downloadFile
+  }
 
-}
-if ($Force -And (Test-Path -Path $downloadFile ) ) {
-  Remove-Item $downloadFile
-}
+  if ($Force -Or !(Test-Path -Path $downloadFile )){
+    Invoke-WebRequest -Uri $url -OutFile $downloadFile
 
-if ($Force -Or !(Test-Path -Path $downloadFile )){
-  Invoke-WebRequest -Uri $url -OutFile $downloadFile
+    $shell = New-Object -ComObject shell.application
+    $zip = $shell.NameSpace($downloadFile)
+    foreach ($item in $zip.items()) {
+      $shell.Namespace($downloadDir).CopyHere($item)
+    }
 
-  $shell = New-Object -ComObject shell.application
-  $zip = $shell.NameSpace($downloadFile)
-  foreach ($item in $zip.items()) {
-    $shell.Namespace($downloadDir).CopyHere($item)
+    Write-Output "Driver $($h.Value)"
+    Get-ChildItem -Path $downloadDir
   }
-}
-
+}
\ No newline at end of file