Refactor amd driver download
This commit is contained in:
parent
d2f57c832a
commit
6e766bf73a
1 changed files with 17 additions and 2 deletions
|
@ -9,8 +9,23 @@ function Install-AmdSoftwarePackage() {
|
|||
)
|
||||
|
||||
$tempDir = $context.GetTempDirectory();
|
||||
$selector = '.os-group:first-of-type .driver:first-of-type a:first-of-type';
|
||||
$file = Start-AutomatedDownload $context $url $selector $tempDir;
|
||||
$osSelector = ".os-group:first-of-type";
|
||||
$summarySelector = "$osSelector summary:first-of-type";
|
||||
$downloadSelector = "$osSelector .driver:first-of-type a:first-of-type";
|
||||
|
||||
$action = {
|
||||
param([OpenQA.Selenium.Firefox.FirefoxDriver] $browser)
|
||||
|
||||
$summary = $browser.FindElement([OpenQA.Selenium.By]::CssSelector($summarySelector));
|
||||
|
||||
if (-not ([bool]$summary.GetAttribute("aria-expanded"))) {
|
||||
$summary.Click();
|
||||
}
|
||||
|
||||
$browser.FindElement([OpenQA.Selenium.By]::CssSelector($downloadSelector)).Click();
|
||||
}
|
||||
|
||||
$file = Start-CustomDownload $context $url $action $tempDir;
|
||||
|
||||
Start-Process -Wait -FilePath $file -ArgumentList "/S";
|
||||
Remove-Item -Recurse $tempDir;
|
||||
|
|
Loading…
Reference in a new issue