Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Accenture/Ocaramba
Browse files Browse the repository at this point in the history
  • Loading branch information
jraczek-acc committed Dec 6, 2024
2 parents ac1f807 + eaad942 commit 4af551b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 43 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Ocaramba Templates](https://img.shields.io/badge/get-Ocaramba_Templates-green.svg?color=4BC21F)](https://marketplace.visualstudio.com/items?itemName=Ocaramba.Ocaramba1)
![Build status](https://github.com/Accenture/Ocaramba/actions/workflows/github-actions.yml/badge.svg)
[![BrowserStack Status](https://automate.browserstack.com/badge.svg?badge_key=ZUJWZGNEczFZVFNVWUJvUHJ6Y0pYUTlnSG4rYnhKVXFUeSsrYzlTUEZIZz0tLWxZUStLVnNqWml6bXNpcm1FSUxMQ3c9PQ==--20fde38e51169fe9739fc60ce188f00ecdf0f1fe)](https://automate.browserstack.com/public-build/ZUJWZGNEczFZVFNVWUJvUHJ6Y0pYUTlnSG4rYnhKVXFUeSsrYzlTUEZIZz0tLWxZUStLVnNqWml6bXNpcm1FSUxMQ3c9PQ==--20fde38e51169fe9739fc60ce188f00ecdf0f1fe)
[![Sauce Test Status](https://app.saucelabs.com/buildstatus/jraczek)](https://app.saucelabs.com/u/JRACZEK)
[![Sauce Test Status](https://app.saucelabs.com/buildstatus/jraczek?auth=99f92a548ce2dd8fb1f203910a4d7d0f)](https://app.saucelabs.com/u/jraczek?auth=99f92a548ce2dd8fb1f203910a4d7d0f)

Test Framework was designed in Objectivity to propose a common way how people should create Selenium WebDriver tests.

Expand Down
81 changes: 39 additions & 42 deletions scripts/ExecutingTestsOnWindowsGithubActions5.ps1
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
echo '********************************************Downloading Selenium Grid********************************************'
echo '********************************************Downloading Selenium Grid********************************************'

$url = $env:seleniumGridUrl

$grid = $env:seleniumGridVersion

$output = $PSScriptRoot + ".\Ocaramba\Ocaramba.Tests.NUnit\bin\Release\net472\$grid"

$outputLogs = $PSScriptRoot + ".\Ocaramba\Ocaramba.Tests.NUnit\bin\Release\net472\"

$output = Join-Path $PSScriptRoot "..\Ocaramba\Ocaramba.Tests.NUnit\bin\Release\net472\$grid"
$outputLogs = Join-Path $PSScriptRoot "..\Ocaramba\Ocaramba.Tests.NUnit\bin\Release\net472\"

$start_time = Get-Date

echo url: $url
Expand All @@ -16,56 +13,56 @@ echo output: $output
echo outputLogs: $outputLogs

echo "Downloading Selenium Grid from: $($url) to $($output)"
Invoke-WebRequest -Uri "$($url)" -Out "$($output)"
Invoke-WebRequest -Uri "$($url)" -OutFile "$($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' hub' -RedirectStandardOutput $outputLogs'console_hub.out' -RedirectStandardError $outputLogs'console_hub.err' -passthru

echo '******************************************Start Selenium Grid in background****************************************'

$appHub=Start-Process java -ArgumentList '-jar', $output, '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' node --detect-drivers true' -RedirectStandardOutput $outputLogs'console_node.out' -RedirectStandardError $outputLogs'console_node.err' -passthru
$appNode=Start-Process java -ArgumentList '-jar', $output, 'node --detect-drivers true' -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 ".\Ocaramba\Ocaramba.Tests.NUnit\bin\Release\net472\" "Ocaramba.Tests.NUnit.dll.config" "//appSettings" "browser|RemoteWebDriverHub" "RemoteWebDriver|http://localhost:4444/wd/hub" -logValues

echo '********************************************Run tests with Selenium Grid ****************************************'

.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba\Ocaramba.Tests.NUnit\bin\Release\net472\" "Ocaramba.Tests.NUnit.dll.config" "//appSettings" "browser|RemoteWebDriverHub" "RemoteWebDriver|http://localhost:4444/wd/hub"

dotnet vstest .\Ocaramba\Ocaramba.Tests.NUnit\bin\Release\net472\Ocaramba.Tests.NUnit.dll /TestCaseFilter:"TestCategory=Grid" /Parallel /Logger:"trx;LogFileName=Ocaramba.Tests.NUnitGrid.xml"

echo '*****************************Run CloudProviderCrossBrowser tests with Selenium Grid****************************'
.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba\Ocaramba.Tests.CloudProviderCrossBrowser\bin\Release\net472" "Ocaramba.Tests.CloudProviderCrossBrowser.dll.config" "//appSettings" "RemoteWebDriverHub" "http://localhost:4444/wd/hub" -logValues

.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba\Ocaramba.Tests.CloudProviderCrossBrowser\bin\Release\net472" "Ocaramba.Tests.CloudProviderCrossBrowser.dll.config" "//appSettings" "RemoteWebDriverHub" "http://localhost:4444/wd/hub"

dotnet vstest .\Ocaramba\Ocaramba.Tests.CloudProviderCrossBrowser\bin\Release\net472\Ocaramba.Tests.CloudProviderCrossBrowser.dll /TestCaseFilter:"FullyQualifiedName~Chrome" /Parallel /Logger:"trx;LogFileName=Ocaramba.Tests.CloudProviderCrossBrowserGrid.xml"

if($lastexitcode -ne 0)
{
{
echo 'lastexitcode' $lastexitcode
}
}

echo '*****************************Stop Selenium Grid****************************'
echo "Stop Selenium Grid node"

echo "Stop Selenium Grid node"

Stop-Process -Id $appNode.Id
echo "Stop Selenium Grid hub"
Stop-Process -Id $appHub.Id

echo "Stop Selenium Grid hub"

Stop-Process -Id $appHub.Id

if($lastexitcode -ne 0)
{
{
echo 'lastexitcode' $lastexitcode
}
exit 0
}

exit 0

0 comments on commit 4af551b

Please sign in to comment.