我正在尝试解决一个问题,当使用 Katalon Studio 在本地运行时测试通过,但是当在 Katalon Studio Github Action 中运行时,一些测试失败,我相信这是因为测试在不同版本中运行Chrome 浏览器。
这些是我正在使用的参数:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Katalon Studio Github Action
uses: katalon-studio/[email protected]
with:
version: "9.0.0"
projectPath: "${{ github.workspace }}"
args: '-noSplash -retry=0 -browserType=Chrome -testSuiteCollectionPath="Test Suites/xxx" -apiKey= xxx --config -webui.autoUpdateDrivers=true'
您应该按照以下步骤使用此管道:
- name: Install specific version of Chrome
run: |
$ChromeVersion = "PUT_YOUR_CHROME_VERSION_HERE"
Invoke-WebRequest "https://dl.google.com/tag/s/dl/chrome/install/$ChromeVersion/chrome_installer.exe" -OutFile "chrome_installer.exe"
Start-Process chrome_installer.exe -ArgumentList '/silent', '/install' -Wait
- name: Install specific ChromeDriver
run: |
$ChromeMajorVersion = "PUT_YOUR_CHROME_MAJOR_VERSION_HERE"
$ChromeDriverVersion = Invoke-RestMethod -Uri "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$ChromeMajorVersion"
Invoke-WebRequest "https://chromedriver.storage.googleapis.com/$ChromeDriverVersion/chromedriver_win32.zip" -OutFile "chromedriver_win32.zip"
Expand-Archive "chromedriver_win32.zip" -DestinationPath "C:\Windows\System32"