diff --git a/.gitignore b/.gitignore index a50522c1d..bb47106fc 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ /nuget.exe /TestResults /.sonarqube/ +/UpgradeLog.htm diff --git a/Dockerfile b/Dockerfile index a3cfdc62a..fc92b60ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/core/sdk:3.1 +FROM mcr.microsoft.com/dotnet/sdk:6.0 LABEL maintainer "Ocaramba " #========= # Midnight Commander, lbzip2 diff --git a/ExecutingTestsOnDocker.ps1 b/ExecutingTestsOnDocker.ps1 index 2329faac1..13812e728 100644 --- a/ExecutingTestsOnDocker.ps1 +++ b/ExecutingTestsOnDocker.ps1 @@ -5,7 +5,7 @@ If($IsWindows){ docker info -docker build -t ocaramba/selenium -f DockerfileBuild . +docker build -t ocaramba/selenium -f Dockerfile docker run --rm -dit --name ocaramba_selenium ocaramba/selenium docker ps -a @@ -13,9 +13,9 @@ docker ps -a docker exec ocaramba_selenium sed -i '/Documentation/,+5 d' Ocaramba.sln echo 'build Ocaramba.sln' docker exec ocaramba_selenium dotnet build Ocaramba.sln -docker exec ocaramba_selenium bash -c 'pwsh ./scripts/set_AppConfig_for_tests.ps1 \"./Ocaramba.Tests.NUnit/bin/Debug/netcoreapp3.1\" \"appsettings.Linux.json\" \"appSettings\" \"browser|PathToChromeDriverDirectory\" \"Chrome|/chromedriver\" -logValues -json' +docker exec ocaramba_selenium bash -c 'pwsh ./scripts/set_AppConfig_for_tests.ps1 \"./Ocaramba.Tests.NUnit/bin/Debug/net6.0\" \"appsettings.Linux.json\" \"appSettings\" \"browser|PathToChromeDriverDirectory\" \"Chrome|/chromedriver\" -logValues -json' echo 'execute Ocaramba.sln tests' -docker exec ocaramba_selenium dotnet vstest Ocaramba.Tests.NUnit/bin/Debug/netcoreapp3.1/Ocaramba.Tests.NUnit.dll /TestCaseFilter:"(TestCategory!=NotImplementedInCoreOrUploadDownload)" /Parallel --logger:"trx;LogFileName=Ocaramba.Tests.Docker.xml" +docker exec ocaramba_selenium dotnet vstest Ocaramba.Tests.NUnit/bin/Debug/net6.0/Ocaramba.Tests.NUnit.dll /TestCaseFilter:"(TestCategory!=NotImplementedInCoreOrUploadDownload)" /Parallel --logger:"trx;LogFileName=Ocaramba.Tests.Docker.xml" echo 'Downloading Ocaramba.Tests.Docker.xml' docker cp ocaramba_selenium:/Ocaramba/TestResults/Ocaramba.Tests.Docker.xml . echo 'Uploading Ocaramba.Tests.Docker.xml' diff --git a/ExecutingTestsOnDockerAzure.ps1 b/ExecutingTestsOnDockerAzure.ps1 index 306e605ad..e7e55c474 100644 --- a/ExecutingTestsOnDockerAzure.ps1 +++ b/ExecutingTestsOnDockerAzure.ps1 @@ -2,8 +2,8 @@ docker info docker ps -a docker exec ocaramba_selenium bash -c "ls ; sed -i '/Documentation/,+5 d' ./Ocaramba.sln ; dotnet build ./Ocaramba.sln" -docker exec ocaramba_selenium bash -c 'pwsh ./scripts/set_AppConfig_for_tests.ps1 \"./Ocaramba.Tests.NUnit/bin/Debug/netcoreapp3.1\" \"appsettings.Linux.json\" \"appSettings\" \"browser|PathToChromeDriverDirectory\" \"Chrome|/chromedriver\" -logValues -json' -docker exec ocaramba_selenium bash -c 'dotnet vstest ./Ocaramba.Tests.NUnit/bin/Debug/netcoreapp3.1/Ocaramba.Tests.NUnit.dll /TestCaseFilter:\"(TestCategory!=NotImplementedInCoreOrUploadDownload)\" /Parallel --logger:\"trx;LogFileName=Ocaramba.Tests.Docker.xml\"' +docker exec ocaramba_selenium bash -c 'pwsh ./scripts/set_AppConfig_for_tests.ps1 \"./Ocaramba.Tests.NUnit/bin/Debug/net6.0\" \"appsettings.Linux.json\" \"appSettings\" \"browser|PathToChromeDriverDirectory\" \"Chrome|/chromedriver\" -logValues -json' +docker exec ocaramba_selenium bash -c 'dotnet vstest ./Ocaramba.Tests.NUnit/bin/Debug/net6.0/Ocaramba.Tests.NUnit.dll /TestCaseFilter:\"(TestCategory!=NotImplementedInCoreOrUploadDownload)\" /Parallel --logger:\"trx;LogFileName=Ocaramba.Tests.Docker.xml\"' docker cp ocaramba_selenium:/Ocaramba/TestResults/Ocaramba.Tests.Docker.xml . diff --git a/ExecutingTestsOnLinux.ps1 b/ExecutingTestsOnLinux.ps1 index df448504b..46dd235e2 100644 --- a/ExecutingTestsOnLinux.ps1 +++ b/ExecutingTestsOnLinux.ps1 @@ -14,23 +14,23 @@ Expand-Archive $TempZipFilePath -DestinationPath $TempFileUnzipPath; echo TempFileUnzipPath: $TempFileUnzipPath dir $TempFileUnzipPath -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.NUnit\bin\Debug\netcoreapp3.1" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.Angular\bin\Debug\netcoreapp3.1" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.NUnitExtentReports\bin\Debug\netcoreapp3.1" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.Features\bin\Debug\netcoreapp3.1" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.Xunit\bin\Debug\netcoreapp3.1" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.MsTest\bin\Debug\netcoreapp3.1" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.UnitTests\bin\Debug\netcoreapp3.1" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.NUnit\bin\Debug\net6.0" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.Angular\bin\Debug\net6.0" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.NUnitExtentReports\bin\Debug\net6.0" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.Features\bin\Debug\net6.0" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.Xunit\bin\Debug\net6.0" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.MsTest\bin\Debug\net6.0" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.UnitTests\bin\Debug\net6.0" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json echo '********************************************Executing tests********************************************' echo '********************************************NUnit tests********************************************' +dotnet test --configuration Debug --filter TestCategory!=NotImplementedInCoreOrUploadDownload --no-build --no-restore Ocaramba.UnitTests -maxCpuCount --test-adapter-path:. --logger:Appveyor + dotnet test --configuration Debug --no-build --no-restore Ocaramba.Tests.Angular -maxCpuCount --test-adapter-path:. --logger:Appveyor dotnet test --configuration Debug --filter TestCategory!=NotImplementedInCoreOrUploadDownload --no-build --no-restore Ocaramba.Tests.NUnit -maxCpuCount --test-adapter-path:. --logger:Appveyor -dotnet test --configuration Debug --filter TestCategory!=NotImplementedInCoreOrUploadDownload --no-build --no-restore Ocaramba.UnitTests -maxCpuCount --test-adapter-path:. --logger:Appveyor - echo '********************************************XUnit tests********************************************' dotnet test --configuration Debug --no-build --no-restore Ocaramba.Tests.Xunit -maxCpuCount --test-adapter-path:. --logger:Appveyor diff --git a/ExecutingTestsOnLinuxAzure.ps1 b/ExecutingTestsOnLinuxAzure.ps1 index 367f72a01..07f17fb56 100644 --- a/ExecutingTestsOnLinuxAzure.ps1 +++ b/ExecutingTestsOnLinuxAzure.ps1 @@ -1,13 +1,13 @@ echo '********************************************Executing tests********************************************' -echo '********************************************netcoreapp3 tests********************************************' +echo '********************************************net6.0 tests********************************************' $Env:ASPNETCORE_ENVIRONMENT="Linux" echo $Env:ASPNETCORE_ENVIRONMENT -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.NUnit\bin\Release\netcoreapp3.1" "appsettings.Linux.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$($env:CHROMEWEBDRIVER)" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.NUnit\bin\Release\net6.0" "appsettings.Linux.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$($env:CHROMEWEBDRIVER)" -logValues -json -dotnet vstest ./Ocaramba.Tests.NUnit/bin/Release/netcoreapp3.1/Ocaramba.Tests.NUnit.dll ` +dotnet vstest ./Ocaramba.Tests.NUnit/bin/Release/net6.0/Ocaramba.Tests.NUnit.dll ` /TestCaseFilter:"(TestCategory!=NotImplementedInCoreOrUploadDownload)" /Parallel ` --logger:"trx;LogFileName=Ocaramba.Tests.netcoreapp.xml" diff --git a/ExecutingTestsOnLinuxBrowserStackAzure.ps1 b/ExecutingTestsOnLinuxBrowserStackAzure.ps1 index d4ea88835..1939002ba 100644 --- a/ExecutingTestsOnLinuxBrowserStackAzure.ps1 +++ b/ExecutingTestsOnLinuxBrowserStackAzure.ps1 @@ -5,13 +5,13 @@ $Env:ASPNETCORE_ENVIRONMENT="Linux" echo $Env:ASPNETCORE_ENVIRONMENT -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.CloudProviderCrossBrowser\bin\Release\netcoreapp3.1" "appsettings.Linux.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$($env:CHROMEWEBDRIVER)" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.CloudProviderCrossBrowser\bin\Release\net6.0" "appsettings.Linux.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$($env:CHROMEWEBDRIVER)" -logValues -json -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.CloudProviderCrossBrowser\bin\Release\netcoreapp3.1" "appsettings.Linux.json" "appSettings" "RemoteWebDriverHub" "https://$($env:MAPPED_ENV_BROWSERSTACKUSER):$($env:MAPPED_ENV_BROWSERSTACKKEY)@hub-cloud.browserstack.com/wd/hub" -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.CloudProviderCrossBrowser\bin\Release\net6.0" "appsettings.Linux.json" "appSettings" "RemoteWebDriverHub" "https://$($env:MAPPED_ENV_BROWSERSTACKUSER):$($env:MAPPED_ENV_BROWSERSTACKKEY)@hub-cloud.browserstack.com/wd/hub" -json -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.CloudProviderCrossBrowser\bin\Release\netcoreapp3.1" "appsettings.Linux.json" "DriverCapabilities" "buildName" "Ocaramba.Tests.BrowserStackCrossBrowser$($env:BuildVersion)" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.CloudProviderCrossBrowser\bin\Release\net6.0" "appsettings.Linux.json" "DriverCapabilities" "buildName" "Ocaramba.Tests.BrowserStackCrossBrowser$($env:BuildVersion)" -logValues -json -dotnet vstest ./Ocaramba.Tests.CloudProviderCrossBrowser/bin/Release/netcoreapp3.1/Ocaramba.Tests.CloudProviderCrossBrowser.dll ` +dotnet vstest ./Ocaramba.Tests.CloudProviderCrossBrowser/bin/Release/net6.0/Ocaramba.Tests.CloudProviderCrossBrowser.dll ` --logger:"trx;LogFileName=Ocaramba.Tests.BrowserStacknetcoreapp.xml" if($lastexitcode -ne 0) diff --git a/ExecutingTestsOnWindows.ps1 b/ExecutingTestsOnWindows.ps1 index 144b54067..0796c072c 100644 --- a/ExecutingTestsOnWindows.ps1 +++ b/ExecutingTestsOnWindows.ps1 @@ -15,13 +15,13 @@ $TempFileUnzipPath = $TempFilePath.Replace(".tmp", ""); Invoke-WebRequest "https://chromedriver.storage.googleapis.com/$ChromeVersion/chromedriver_win32.zip" -OutFile $TempZipFilePath; Expand-Archive $TempZipFilePath -DestinationPath $TempFileUnzipPath; -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.NUnit\bin\Debug\netcoreapp3.1" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.Angular\bin\Debug\netcoreapp3.1" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.NUnitExtentReports\bin\Debug\netcoreapp3.1" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.Features\bin\Debug\netcoreapp3.1" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.Xunit\bin\Debug\netcoreapp3.1" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.MsTest\bin\Debug\netcoreapp3.1" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.UnitTests\bin\Debug\netcoreapp3.1" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.NUnit\bin\Debug\net6.0" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.Angular\bin\Debug\net6.0" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.NUnitExtentReports\bin\Debug\net6.0" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.Features\bin\Debug\net6.0" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.Xunit\bin\Debug\net6.0" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.MsTest\bin\Debug\net6.0" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.UnitTests\bin\Debug\net6.0" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues -json .\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.Angular\bin\Debug\net472" "Ocaramba.Tests.Angular.dll.config" "//appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues .\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.NUnit\bin\Debug\net472" "Ocaramba.Tests.NUnit.dll.config" "//appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues .\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.UnitTests\bin\Debug\net472" "Ocaramba.UnitTests.dll.config" "//appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$TempFileUnzipPath" -logValues @@ -83,9 +83,9 @@ echo '********************************************Specflow tests**************** #& nunit3-console.exe .\Ocaramba.Tests.CloudProviderCrossBrowser\bin\Debug\net472\Ocaramba.Tests.CloudProviderCrossBrowser.dll --workers=5 -#.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.CloudProviderCrossBrowser\bin\Debug\netcoreapp3.1" "appsettings.json" "appSettings" "RemoteWebDriverHub" "http://$($env:browserstackuser):$($env:browserstackkey)@hub-cloud.browserstack.com/wd/hub" $false $true +#.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.CloudProviderCrossBrowser\bin\Debug\net6.0" "appsettings.json" "appSettings" "RemoteWebDriverHub" "http://$($env:browserstackuser):$($env:browserstackkey)@hub-cloud.browserstack.com/wd/hub" $false $true -#.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.CloudProviderCrossBrowser\bin\Debug\netcoreapp3.1" "appsettings.json" "DriverCapabilities" "build" "Ocaramba.Tests.BrowserStackCrossBrowser$env:appveyor_build_version" $true $true +#.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.CloudProviderCrossBrowser\bin\Debug\net6.0" "appsettings.json" "DriverCapabilities" "build" "Ocaramba.Tests.BrowserStackCrossBrowser$env:appveyor_build_version" $true $true #& dotnet.exe test --configuration Debug --no-build --no-restore Ocaramba.Tests.CloudProviderCrossBrowser -maxCpuCount --test-adapter-path:. --logger:Appveyor diff --git a/ExecutingTestsOnWindowsAzure1.ps1 b/ExecutingTestsOnWindowsAzure1.ps1 index 8d9fe97fd..dfb00b85a 100644 --- a/ExecutingTestsOnWindowsAzure1.ps1 +++ b/ExecutingTestsOnWindowsAzure1.ps1 @@ -1,14 +1,14 @@ echo '********************************************Executing tests********************************************' -echo '********************************************netcoreapp3 tests********************************************' +echo '********************************************net6.0 tests********************************************' -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.NUnit\bin\Release\netcoreapp3.1" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$($env:CHROMEWEBDRIVER)" -logValues -json -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.Angular\bin\Release\netcoreapp3.1" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$($env:CHROMEWEBDRIVER)" -logValues -json -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.NUnitExtentReports\bin\Release\netcoreapp3.1" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$($env:CHROMEWEBDRIVER)" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.NUnit\bin\Release\net6.0" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$($env:CHROMEWEBDRIVER)" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.Angular\bin\Release\net6.0" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$($env:CHROMEWEBDRIVER)" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.NUnitExtentReports\bin\Release\net6.0" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$($env:CHROMEWEBDRIVER)" -logValues -json -dotnet vstest .\Ocaramba.Tests.Angular\bin\Release\netcoreapp3.1\Ocaramba.Tests.Angular.dll ` - .\Ocaramba.Tests.NUnit\bin\Release\netcoreapp3.1\Ocaramba.Tests.NUnit.dll ` - .\Ocaramba.Tests.NUnitExtentReports\bin\Release\netcoreapp3.1\Ocaramba.Tests.NUnitExtentReports.dll ` +dotnet vstest .\Ocaramba.Tests.Angular\bin\Release\net6.0\Ocaramba.Tests.Angular.dll ` + .\Ocaramba.Tests.NUnit\bin\Release\net6.0\Ocaramba.Tests.NUnit.dll ` + .\Ocaramba.Tests.NUnitExtentReports\bin\Release\net6.0\Ocaramba.Tests.NUnitExtentReports.dll ` /TestCaseFilter:"(TestCategory!=TakingScreehShots)" /Parallel ` --logger:"trx;LogFileName=Ocaramba.Tests.netcoreapp.trx" diff --git a/ExecutingTestsOnWindowsAzure2.ps1 b/ExecutingTestsOnWindowsAzure2.ps1 index 954f5f26f..853e962ee 100644 --- a/ExecutingTestsOnWindowsAzure2.ps1 +++ b/ExecutingTestsOnWindowsAzure2.ps1 @@ -1,26 +1,26 @@ echo '********************************************Executing tests********************************************' -echo '********************************************netcoreapp3 tests********************************************' +echo '********************************************net6.0 tests********************************************' -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.Features\bin\Release\netcoreapp3.1" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$($env:CHROMEWEBDRIVER)" -logValues -json -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.Xunit\bin\Release\netcoreapp3.1" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$($env:CHROMEWEBDRIVER)" -logValues -json -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.MsTest\bin\Release\netcoreapp3.1" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$($env:CHROMEWEBDRIVER)" -logValues -json -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.UnitTests\bin\Release\netcoreapp3.1" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$($env:CHROMEWEBDRIVER)" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.Features\bin\Release\net6.0" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$($env:CHROMEWEBDRIVER)" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.Xunit\bin\Release\net6.0" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$($env:CHROMEWEBDRIVER)" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.MsTest\bin\Release\net6.0" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$($env:CHROMEWEBDRIVER)" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.UnitTests\bin\Release\net6.0" "appsettings.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|$($env:CHROMEWEBDRIVER)" -logValues -json -dotnet vstest .\Ocaramba.Tests.Features\bin\Release\netcoreapp3.1\Ocaramba.Tests.Features.dll ` - .\Ocaramba.Tests.Xunit\bin\Release\netcoreapp3.1\Ocaramba.Tests.Xunit.dll ` - .\Ocaramba.Tests.MsTest\bin\Release\netcoreapp3.1\Ocaramba.Tests.MsTest.dll ` - .\Ocaramba.UnitTests\bin\Release\netcoreapp3.1\Ocaramba.UnitTests.dll ` +dotnet vstest .\Ocaramba.Tests.Features\bin\Release\net6.0\Ocaramba.Tests.Features.dll ` + .\Ocaramba.Tests.Xunit\bin\Release\net6.0\Ocaramba.Tests.Xunit.dll ` + .\Ocaramba.Tests.MsTest\bin\Release\net6.0\Ocaramba.Tests.MsTest.dll ` + .\Ocaramba.UnitTests\bin\Release\net6.0\Ocaramba.UnitTests.dll ` /TestCaseFilter:"(TestCategory!=TakingScreehShots)" /Parallel ` --logger:"trx;LogFileName=Ocaramba.Tests.netcoreapp.xml" echo '********************************************EdgeChrominum tests********************************************' -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.NUnit\bin\Release\netcoreapp3.1" "appsettings.json" "appSettings" "browser|PathToEdgeChromiumDriverDirectory" "EdgeChromium|$($env:EDGEWEBDRIVER)" -logValues -json +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.NUnit\bin\Release\net6.0" "appsettings.json" "appSettings" "browser|PathToEdgeChromiumDriverDirectory" "EdgeChromium|$($env:EDGEWEBDRIVER)" -logValues -json -dotnet vstest .\Ocaramba.Tests.NUnit\bin\Release\netcoreapp3.1\Ocaramba.Tests.NUnit.dll ` +dotnet vstest .\Ocaramba.Tests.NUnit\bin\Release\net6.0\Ocaramba.Tests.NUnit.dll ` /TestCaseFilter:"(TestCategory=Grid)" /Parallel ` --logger:"trx;LogFileName=Ocaramba.Tests.EdgeChrominum.xml" diff --git a/Ocaramba.Tests.Angular/Ocaramba.Tests.Angular.csproj b/Ocaramba.Tests.Angular/Ocaramba.Tests.Angular.csproj index 1cba47769..da103bf1b 100644 --- a/Ocaramba.Tests.Angular/Ocaramba.Tests.Angular.csproj +++ b/Ocaramba.Tests.Angular/Ocaramba.Tests.Angular.csproj @@ -1,14 +1,14 @@  - netcoreapp3.1 - net472;netcoreapp3.1 + net6.0 + net472;net6.0 - + @@ -19,7 +19,7 @@ - + @@ -30,8 +30,8 @@ - - + + @@ -55,8 +55,8 @@ - - netcoreapp3_1 + + net6_0 diff --git a/Ocaramba.Tests.Angular/PageObjects/ProtractorApiPage.cs b/Ocaramba.Tests.Angular/PageObjects/ProtractorApiPage.cs index 5b8d638d5..01b3fad16 100644 --- a/Ocaramba.Tests.Angular/PageObjects/ProtractorApiPage.cs +++ b/Ocaramba.Tests.Angular/PageObjects/ProtractorApiPage.cs @@ -10,7 +10,7 @@ public class ProtractorApiPage : ProjectPageBase #if net47 private readonly NLog.Logger logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private readonly NLog.Logger logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/Ocaramba.Tests.Angular/PageObjects/ProtractorHomePage.cs b/Ocaramba.Tests.Angular/PageObjects/ProtractorHomePage.cs index f7fc36fbb..fbd96c753 100644 --- a/Ocaramba.Tests.Angular/PageObjects/ProtractorHomePage.cs +++ b/Ocaramba.Tests.Angular/PageObjects/ProtractorHomePage.cs @@ -14,7 +14,7 @@ public class ProtractorHomePage : ProjectPageBase #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/Ocaramba.Tests.Angular/PageObjects/TableOfContentsPage.cs b/Ocaramba.Tests.Angular/PageObjects/TableOfContentsPage.cs index 7d3f80ca5..c1c41a452 100644 --- a/Ocaramba.Tests.Angular/PageObjects/TableOfContentsPage.cs +++ b/Ocaramba.Tests.Angular/PageObjects/TableOfContentsPage.cs @@ -12,7 +12,7 @@ public class TableOfContentsPage : ProjectPageBase #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/Ocaramba.Tests.Angular/PageObjects/TutorialPage.cs b/Ocaramba.Tests.Angular/PageObjects/TutorialPage.cs index f9825c6ba..4c00cea1f 100644 --- a/Ocaramba.Tests.Angular/PageObjects/TutorialPage.cs +++ b/Ocaramba.Tests.Angular/PageObjects/TutorialPage.cs @@ -12,7 +12,7 @@ public class TutorialPage : ProjectPageBase #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/Ocaramba.Tests.Angular/ProjectTestBase.cs b/Ocaramba.Tests.Angular/ProjectTestBase.cs index 5838abb0d..eebc24cc1 100644 --- a/Ocaramba.Tests.Angular/ProjectTestBase.cs +++ b/Ocaramba.Tests.Angular/ProjectTestBase.cs @@ -41,7 +41,7 @@ public class ProjectTestBase : TestBase #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif @@ -83,7 +83,7 @@ protected DriverContext DriverContext [OneTimeSetUp] public void BeforeClass() { -#if netcoreapp3_1 +#if net6_0 this.DriverContext.CurrentDirectory = Directory.GetCurrentDirectory(); #endif diff --git a/Ocaramba.Tests.CloudProviderCrossBrowser/Ocaramba.Tests.CloudProviderCrossBrowser.csproj b/Ocaramba.Tests.CloudProviderCrossBrowser/Ocaramba.Tests.CloudProviderCrossBrowser.csproj index 7eb20554c..c1f94d40f 100644 --- a/Ocaramba.Tests.CloudProviderCrossBrowser/Ocaramba.Tests.CloudProviderCrossBrowser.csproj +++ b/Ocaramba.Tests.CloudProviderCrossBrowser/Ocaramba.Tests.CloudProviderCrossBrowser.csproj @@ -1,8 +1,8 @@  - netcoreapp3.1 - net472;netcoreapp3.1 + net6.0 + net472;net6.0 @@ -11,14 +11,14 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + @@ -26,8 +26,8 @@ - - + + @@ -48,8 +48,8 @@ - - netcoreapp3_1 + + net6_0 diff --git a/Ocaramba.Tests.CloudProviderCrossBrowser/ProjectTestBase.cs b/Ocaramba.Tests.CloudProviderCrossBrowser/ProjectTestBase.cs index 999109b8e..aa8712d45 100644 --- a/Ocaramba.Tests.CloudProviderCrossBrowser/ProjectTestBase.cs +++ b/Ocaramba.Tests.CloudProviderCrossBrowser/ProjectTestBase.cs @@ -44,7 +44,7 @@ public class ProjectTestBase : TestBase #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif @@ -91,7 +91,7 @@ protected DriverContext DriverContext [OneTimeSetUp] public void BeforeClass() { -#if netcoreapp3_1 +#if net6_0 this.DriverContext.CurrentDirectory = Directory.GetCurrentDirectory(); #endif diff --git a/Ocaramba.Tests.Features/Ocaramba.Tests.Features.csproj b/Ocaramba.Tests.Features/Ocaramba.Tests.Features.csproj index d8b8208ce..781464940 100644 --- a/Ocaramba.Tests.Features/Ocaramba.Tests.Features.csproj +++ b/Ocaramba.Tests.Features/Ocaramba.Tests.Features.csproj @@ -1,15 +1,15 @@  - netcoreapp3.1 - net472;netcoreapp3.1 + net6.0 + net472;net6.0 - + @@ -19,15 +19,15 @@ - + - - + + @@ -55,8 +55,8 @@ - - netcoreapp3_1 + + net6_0 diff --git a/Ocaramba.Tests.Features/TestFeatures/SmokeTests.feature.cs b/Ocaramba.Tests.Features/TestFeatures/SmokeTests.feature.cs index 529ebf4ec..13c62acba 100644 --- a/Ocaramba.Tests.Features/TestFeatures/SmokeTests.feature.cs +++ b/Ocaramba.Tests.Features/TestFeatures/SmokeTests.feature.cs @@ -26,7 +26,7 @@ public partial class SmokeTestsFeature private TechTalk.SpecFlow.ITestRunner testRunner; - private string[] _featureTags = ((string[])(null)); + private static string[] featureTags = ((string[])(null)); #line 1 "SmokeTests.feature" #line hidden @@ -35,7 +35,7 @@ public partial class SmokeTestsFeature public virtual void FeatureSetup() { testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "TestFeatures", "SmokeTests", null, ProgrammingLanguage.CSharp, ((string[])(null))); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "TestFeatures", "SmokeTests", null, ProgrammingLanguage.CSharp, featureTags); testRunner.OnFeatureStart(featureInfo); } @@ -47,28 +47,28 @@ public virtual void FeatureTearDown() } [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() + public void TestInitialize() { } [NUnit.Framework.TearDownAttribute()] - public virtual void TestTearDown() + public void TestTearDown() { testRunner.OnScenarioEnd(); } - public virtual void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + public void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) { testRunner.OnScenarioInitialize(scenarioInfo); testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); } - public virtual void ScenarioStart() + public void ScenarioStart() { testRunner.OnScenarioStart(); } - public virtual void ScenarioCleanup() + public void ScenarioCleanup() { testRunner.CollectScenarioErrors(); } @@ -76,26 +76,16 @@ public virtual void ScenarioCleanup() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Verify default option selected in dropdown")] [NUnit.Framework.CategoryAttribute("Dropdown")] - public virtual void VerifyDefaultOptionSelectedInDropdown() + public void VerifyDefaultOptionSelectedInDropdown() { string[] tagsOfScenario = new string[] { "Dropdown"}; System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Verify default option selected in dropdown", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Verify default option selected in dropdown", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 27 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } @@ -124,26 +114,16 @@ public virtual void VerifyDefaultOptionSelectedInDropdown() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Verify if dropdown option can be selected by text")] [NUnit.Framework.CategoryAttribute("Dropdown")] - public virtual void VerifyIfDropdownOptionCanBeSelectedByText() + public void VerifyIfDropdownOptionCanBeSelectedByText() { string[] tagsOfScenario = new string[] { "Dropdown"}; System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Verify if dropdown option can be selected by text", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Verify if dropdown option can be selected by text", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 35 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } @@ -175,26 +155,16 @@ public virtual void VerifyIfDropdownOptionCanBeSelectedByText() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Verify if dropdown option can be selected by index with custom timeout")] [NUnit.Framework.CategoryAttribute("Dropdown")] - public virtual void VerifyIfDropdownOptionCanBeSelectedByIndexWithCustomTimeout() + public void VerifyIfDropdownOptionCanBeSelectedByIndexWithCustomTimeout() { string[] tagsOfScenario = new string[] { "Dropdown"}; System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Verify if dropdown option can be selected by index with custom timeout", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Verify if dropdown option can be selected by index with custom timeout", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 44 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } @@ -226,26 +196,16 @@ public virtual void VerifyIfDropdownOptionCanBeSelectedByIndexWithCustomTimeout( [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Verify if dropdown option can be selected by index")] [NUnit.Framework.CategoryAttribute("Dropdown")] - public virtual void VerifyIfDropdownOptionCanBeSelectedByIndex() + public void VerifyIfDropdownOptionCanBeSelectedByIndex() { string[] tagsOfScenario = new string[] { "Dropdown"}; System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Verify if dropdown option can be selected by index", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Verify if dropdown option can be selected by index", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 53 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } @@ -277,26 +237,16 @@ public virtual void VerifyIfDropdownOptionCanBeSelectedByIndex() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Verify if dropdown option can be selected by value")] [NUnit.Framework.CategoryAttribute("Dropdown")] - public virtual void VerifyIfDropdownOptionCanBeSelectedByValue() + public void VerifyIfDropdownOptionCanBeSelectedByValue() { string[] tagsOfScenario = new string[] { "Dropdown"}; System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Verify if dropdown option can be selected by value", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Verify if dropdown option can be selected by value", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 62 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } @@ -328,26 +278,16 @@ public virtual void VerifyIfDropdownOptionCanBeSelectedByValue() [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Verify if dropdown option can be selected by value with custom timeout")] [NUnit.Framework.CategoryAttribute("Dropdown")] - public virtual void VerifyIfDropdownOptionCanBeSelectedByValueWithCustomTimeout() + public void VerifyIfDropdownOptionCanBeSelectedByValueWithCustomTimeout() { string[] tagsOfScenario = new string[] { "Dropdown"}; System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Verify if dropdown option can be selected by value with custom timeout", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Verify if dropdown option can be selected by value with custom timeout", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 71 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } @@ -392,27 +332,17 @@ public virtual void VerifyIfDropdownOptionCanBeSelectedByValueWithCustomTimeout( [NUnit.Framework.TestCaseAttribute("\"DELETE\"", "\"DELETE\"", null)] [NUnit.Framework.TestCaseAttribute("\"MULTIPLY\"", "\"MULTIPLY\"", null)] [NUnit.Framework.TestCaseAttribute("\"SUBTRACT\"", "\"SUBTRACT\"", null)] - public virtual void KeyPressesTest(string key, string message, string[] exampleTags) + public void KeyPressesTest(string key, string message, string[] exampleTags) { string[] tagsOfScenario = exampleTags; System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); argumentsOfScenario.Add("key", key); argumentsOfScenario.Add("message", message); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Key Presses Test", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Key Presses Test", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 79 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } @@ -438,26 +368,16 @@ public virtual void KeyPressesTest(string key, string message, string[] exampleT [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Do not press any key")] [NUnit.Framework.TestCaseAttribute("\"\"", null)] - public virtual void DoNotPressAnyKey(string key, string[] exampleTags) + public void DoNotPressAnyKey(string key, string[] exampleTags) { string[] tagsOfScenario = exampleTags; System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); argumentsOfScenario.Add("key", key); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Do not press any key", null, tagsOfScenario, argumentsOfScenario, this._featureTags); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Do not press any key", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 102 this.ScenarioInitialize(scenarioInfo); #line hidden - bool isScenarioIgnored = default(bool); - bool isFeatureIgnored = default(bool); - if ((tagsOfScenario != null)) - { - isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((this._featureTags != null)) - { - isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any(); - } - if ((isScenarioIgnored || isFeatureIgnored)) + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) { testRunner.SkipScenario(); } diff --git a/Ocaramba.Tests.MsTest/Ocaramba.Tests.MsTest.csproj b/Ocaramba.Tests.MsTest/Ocaramba.Tests.MsTest.csproj index 887aacd95..6c2685d65 100644 --- a/Ocaramba.Tests.MsTest/Ocaramba.Tests.MsTest.csproj +++ b/Ocaramba.Tests.MsTest/Ocaramba.Tests.MsTest.csproj @@ -1,8 +1,8 @@  - netcoreapp3.1 - net472;netcoreapp3.1 + net6.0 + net472;net6.0 @@ -13,8 +13,8 @@ - - + + @@ -23,8 +23,8 @@ - - + + @@ -61,8 +61,8 @@ - - netcoreapp3_1 + + net6_0 diff --git a/Ocaramba.Tests.NUnit/DataDriven/CompareFiles.cs b/Ocaramba.Tests.NUnit/DataDriven/CompareFiles.cs index cb3155f35..5ffe825b9 100644 --- a/Ocaramba.Tests.NUnit/DataDriven/CompareFiles.cs +++ b/Ocaramba.Tests.NUnit/DataDriven/CompareFiles.cs @@ -38,7 +38,7 @@ public static class CompareFiles #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/Ocaramba.Tests.NUnit/DataDriven/DataDrivenHelper.cs b/Ocaramba.Tests.NUnit/DataDriven/DataDrivenHelper.cs index 772da9d01..6097a15ba 100644 --- a/Ocaramba.Tests.NUnit/DataDriven/DataDrivenHelper.cs +++ b/Ocaramba.Tests.NUnit/DataDriven/DataDrivenHelper.cs @@ -44,7 +44,7 @@ public static class DataDrivenHelper #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/Ocaramba.Tests.NUnit/Ocaramba.Tests.NUnit.csproj b/Ocaramba.Tests.NUnit/Ocaramba.Tests.NUnit.csproj index e85a39cec..4a1589628 100644 --- a/Ocaramba.Tests.NUnit/Ocaramba.Tests.NUnit.csproj +++ b/Ocaramba.Tests.NUnit/Ocaramba.Tests.NUnit.csproj @@ -1,25 +1,25 @@  - netcoreapp3.1 - net472;netcoreapp3.1 + net6.0 + net472;net6.0 - - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + @@ -27,11 +27,11 @@ - + 2.2.0 - + @@ -73,8 +73,8 @@ - - netcoreapp3_1 + + net6_0 diff --git a/Ocaramba.Tests.NUnit/ProjectBaseConfiguration.cs b/Ocaramba.Tests.NUnit/ProjectBaseConfiguration.cs index b7a724efc..916636d61 100644 --- a/Ocaramba.Tests.NUnit/ProjectBaseConfiguration.cs +++ b/Ocaramba.Tests.NUnit/ProjectBaseConfiguration.cs @@ -31,7 +31,7 @@ namespace Ocaramba.Tests.NUnit using global::NUnit.Framework; using Ocaramba; using Ocaramba.Helpers; -#if netcoreapp3_1 +#if net6_0 using Microsoft.Extensions.Configuration; #endif @@ -40,7 +40,7 @@ namespace Ocaramba.Tests.NUnit /// public static class ProjectBaseConfiguration { -#if netcoreapp3_1 +#if net6_0 private static readonly string CurrentDirectory = Directory.GetCurrentDirectory(); #endif @@ -48,7 +48,7 @@ public static class ProjectBaseConfiguration private static readonly string CurrentDirectory = TestContext.CurrentContext.TestDirectory; private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 public static readonly string Env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); /// @@ -76,7 +76,7 @@ public static string DataDrivenFile #if net47 setting = ConfigurationManager.AppSettings["DataDrivenFile"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = BaseConfiguration.Builder["appSettings:DataDrivenFile"]; #endif Logger.Debug(CultureInfo.CurrentCulture, "DataDrivenFile value from settings file '{0}'", setting); @@ -103,7 +103,7 @@ public static string DataDrivenFileXlsx #if net47 setting = ConfigurationManager.AppSettings["DataDrivenFileXlsx"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = BaseConfiguration.Builder["appSettings:DataDrivenFileXlsx"]; #endif Logger.Debug(CultureInfo.CurrentCulture, "DataDrivenFileXlsx value from settings file '{0}'", setting); @@ -130,7 +130,7 @@ public static string DataDrivenFileCSV #if net47 setting = ConfigurationManager.AppSettings["DataDrivenFileCSV"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = BaseConfiguration.Builder["appSettings:DataDrivenFileCSV"]; #endif Logger.Debug(CultureInfo.CurrentCulture, "DataDrivenFileCSV value from settings file '{0}'", setting); @@ -154,7 +154,7 @@ public static string DownloadFolderPath #if net47 setting = ConfigurationManager.AppSettings["DownloadFolder"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = BaseConfiguration.Builder["appSettings:DownloadFolder"]; #endif Logger.Debug(CultureInfo.CurrentCulture, "DownloadFolder value from settings file '{0}'", setting); diff --git a/Ocaramba.Tests.NUnit/ProjectTestBase.cs b/Ocaramba.Tests.NUnit/ProjectTestBase.cs index a847bbeb4..49222e5cc 100644 --- a/Ocaramba.Tests.NUnit/ProjectTestBase.cs +++ b/Ocaramba.Tests.NUnit/ProjectTestBase.cs @@ -70,7 +70,7 @@ protected DriverContext DriverContext [OneTimeSetUp] public void BeforeClass() { -#if netcoreapp3_1 +#if net6_0 this.DriverContext.CurrentDirectory = Directory.GetCurrentDirectory(); #endif @@ -86,11 +86,9 @@ public void BeforeClass() [OneTimeTearDown] public void AfterClass() { - PrintPerformanceResultsHelper.PrintAverageDurationMillisecondsInAppVeyor(this.DriverContext.PerformanceMeasures); - PrintPerformanceResultsHelper.PrintPercentiles90DurationMillisecondsInAppVeyor(this.DriverContext.PerformanceMeasures); + this.DriverContext.Stop(); PrintPerformanceResultsHelper.PrintAverageDurationMillisecondsInTeamcity(this.DriverContext.PerformanceMeasures); PrintPerformanceResultsHelper.PrintPercentiles90DurationMillisecondsinTeamcity(this.DriverContext.PerformanceMeasures); - this.DriverContext.Stop(); } /// diff --git a/Ocaramba.Tests.NUnit/Tests/CompareFilesDataDrivenTests.cs b/Ocaramba.Tests.NUnit/Tests/CompareFilesDataDrivenTests.cs index 1cc5c006c..cb1a3fb92 100644 --- a/Ocaramba.Tests.NUnit/Tests/CompareFilesDataDrivenTests.cs +++ b/Ocaramba.Tests.NUnit/Tests/CompareFilesDataDrivenTests.cs @@ -34,7 +34,7 @@ public class CompareFilesDataDrivenTests #if net47 private readonly NLog.Logger logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private readonly NLog.Logger logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/Ocaramba.Tests.NUnitExtentReports/Ocaramba.Tests.NUnitExtentReports.csproj b/Ocaramba.Tests.NUnitExtentReports/Ocaramba.Tests.NUnitExtentReports.csproj index bb38e3251..ee889b0aa 100644 --- a/Ocaramba.Tests.NUnitExtentReports/Ocaramba.Tests.NUnitExtentReports.csproj +++ b/Ocaramba.Tests.NUnitExtentReports/Ocaramba.Tests.NUnitExtentReports.csproj @@ -1,13 +1,13 @@  - netcoreapp3.1 - netcoreapp3.1 + net6.0 + net6.0 - - + + @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@ - + 4.1.0 @@ -71,8 +71,8 @@ - - netcoreapp3_1 + + net6_0 diff --git a/Ocaramba.Tests.PageObjects/Ocaramba.Tests.PageObjects.csproj b/Ocaramba.Tests.PageObjects/Ocaramba.Tests.PageObjects.csproj index 2a9a2453b..3ae7ec4f1 100644 --- a/Ocaramba.Tests.PageObjects/Ocaramba.Tests.PageObjects.csproj +++ b/Ocaramba.Tests.PageObjects/Ocaramba.Tests.PageObjects.csproj @@ -1,8 +1,8 @@  - netcoreapp3.1 - net472;netcoreapp3.1 + net6.0 + net472;net6.0 @@ -11,7 +11,7 @@ - + @@ -20,8 +20,8 @@ - - + + @@ -30,8 +30,8 @@ - - netcoreapp3_1 + + net6_0 diff --git a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/BasicAuthPage.cs b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/BasicAuthPage.cs index fde9a8f7e..ddf9ec4be 100644 --- a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/BasicAuthPage.cs +++ b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/BasicAuthPage.cs @@ -34,7 +34,7 @@ public class BasicAuthPage : ProjectPageBase #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/CheckboxesPage.cs b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/CheckboxesPage.cs index e4a72748b..b5e1739ba 100644 --- a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/CheckboxesPage.cs +++ b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/CheckboxesPage.cs @@ -39,7 +39,7 @@ public class CheckboxesPage : ProjectPageBase #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/DownloadPage.cs b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/DownloadPage.cs index f479fe728..77ff17fef 100644 --- a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/DownloadPage.cs +++ b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/DownloadPage.cs @@ -36,7 +36,7 @@ public class DownloadPage : ProjectPageBase #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/DynamicLoadingPage.cs b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/DynamicLoadingPage.cs index bdfed384f..fae8254a0 100644 --- a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/DynamicLoadingPage.cs +++ b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/DynamicLoadingPage.cs @@ -32,7 +32,7 @@ public class DynamicLoadingPage : ProjectPageBase #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/FloatingMenuPage.cs b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/FloatingMenuPage.cs index 3994c4276..e22f18342 100644 --- a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/FloatingMenuPage.cs +++ b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/FloatingMenuPage.cs @@ -33,7 +33,7 @@ public class FloatingMenuPage : ProjectPageBase #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/ForgotPasswordPage.cs b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/ForgotPasswordPage.cs index fa64a16b6..4cd5534b8 100644 --- a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/ForgotPasswordPage.cs +++ b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/ForgotPasswordPage.cs @@ -34,7 +34,7 @@ public class ForgotPasswordPage : ProjectPageBase #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/FormAuthenticationPage.cs b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/FormAuthenticationPage.cs index e6863d837..52653ed66 100644 --- a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/FormAuthenticationPage.cs +++ b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/FormAuthenticationPage.cs @@ -34,7 +34,7 @@ public class FormAuthenticationPage : ProjectPageBase #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/IFramePage.cs b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/IFramePage.cs index eef768b76..813bb1c6f 100644 --- a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/IFramePage.cs +++ b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/IFramePage.cs @@ -34,7 +34,7 @@ public class IFramePage : ProjectPageBase #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/InternetPage.cs b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/InternetPage.cs index 25d7d80d8..3fc0c442a 100644 --- a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/InternetPage.cs +++ b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/InternetPage.cs @@ -34,7 +34,7 @@ public class InternetPage : ProjectPageBase #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/KeyPressesPage.cs b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/KeyPressesPage.cs index f317ed981..c07466d50 100644 --- a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/KeyPressesPage.cs +++ b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/KeyPressesPage.cs @@ -36,7 +36,7 @@ public class KeyPressesPage : ProjectPageBase #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/SecureFileDownloadPage.cs b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/SecureFileDownloadPage.cs index 12d53a7fc..c6dd52c20 100644 --- a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/SecureFileDownloadPage.cs +++ b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/SecureFileDownloadPage.cs @@ -35,7 +35,7 @@ public class SecureFileDownloadPage : ProjectPageBase #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/ShiftingContentPage.cs b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/ShiftingContentPage.cs index 08557fa38..a4679edb0 100644 --- a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/ShiftingContentPage.cs +++ b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/ShiftingContentPage.cs @@ -33,7 +33,7 @@ public class ShiftingContentPage : ProjectPageBase #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/StatusCodesPage.cs b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/StatusCodesPage.cs index 618b025ce..24722ff61 100644 --- a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/StatusCodesPage.cs +++ b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/StatusCodesPage.cs @@ -35,7 +35,7 @@ public class StatusCodesPage : ProjectPageBase #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/UploadPage.cs b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/UploadPage.cs index 198ab7aa6..13588742d 100644 --- a/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/UploadPage.cs +++ b/Ocaramba.Tests.PageObjects/PageObjects/TheInternet/UploadPage.cs @@ -34,7 +34,7 @@ public class UploadPage : ProjectPageBase #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/Ocaramba.Tests.Xunit/Ocaramba.Tests.Xunit.csproj b/Ocaramba.Tests.Xunit/Ocaramba.Tests.Xunit.csproj index 22770dc36..e37db5fd7 100644 --- a/Ocaramba.Tests.Xunit/Ocaramba.Tests.Xunit.csproj +++ b/Ocaramba.Tests.Xunit/Ocaramba.Tests.Xunit.csproj @@ -1,8 +1,8 @@  - netcoreapp3.1 - net472;netcoreapp3.1 + net6.0 + net472;net6.0 @@ -11,8 +11,8 @@ - - + + @@ -33,10 +33,9 @@ - - + + - @@ -56,8 +55,8 @@ - - netcoreapp3_1 + + net6_0 diff --git a/Ocaramba.Tests.Xunit/ProjectTestBase.cs b/Ocaramba.Tests.Xunit/ProjectTestBase.cs index 3787070dc..6d58bbf4f 100644 --- a/Ocaramba.Tests.Xunit/ProjectTestBase.cs +++ b/Ocaramba.Tests.Xunit/ProjectTestBase.cs @@ -37,7 +37,7 @@ public class ProjectTestBase : IDisposable, IClassFixture #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/Ocaramba.UnitTests/Ocaramba.UnitTests.csproj b/Ocaramba.UnitTests/Ocaramba.UnitTests.csproj index 0e6ccd04f..fd6bcdc23 100644 --- a/Ocaramba.UnitTests/Ocaramba.UnitTests.csproj +++ b/Ocaramba.UnitTests/Ocaramba.UnitTests.csproj @@ -1,26 +1,26 @@  -netcoreapp3.1 -net472;netcoreapp3.1 +net6.0 +net472;net6.0 - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + @@ -29,10 +29,9 @@ - - + + - @@ -56,8 +55,8 @@ - - netcoreapp3_1 + + net6_0 diff --git a/Ocaramba.UnitTests/ProjectTestBase.cs b/Ocaramba.UnitTests/ProjectTestBase.cs index 0fd31a3f1..74a5471e2 100644 --- a/Ocaramba.UnitTests/ProjectTestBase.cs +++ b/Ocaramba.UnitTests/ProjectTestBase.cs @@ -68,7 +68,7 @@ protected DriverContext DriverContext [OneTimeSetUp] public void BeforeClass() { -#if netcoreapp3_1 +#if net6_0 this.DriverContext.CurrentDirectory = Directory.GetCurrentDirectory(); #endif diff --git a/Ocaramba.UnitTests/Tests/DriversCustomSettingsUnitTests.cs b/Ocaramba.UnitTests/Tests/DriversCustomSettingsUnitTests.cs index 590a36bad..8d1f3a7c3 100644 --- a/Ocaramba.UnitTests/Tests/DriversCustomSettingsUnitTests.cs +++ b/Ocaramba.UnitTests/Tests/DriversCustomSettingsUnitTests.cs @@ -32,7 +32,7 @@ public class DriversCustomSettingsUnitTests [Test] public void CheckSynchronizationWithAngularFuctionality() { -#if netcoreapp3_1 +#if net6_0 string folder = Directory.GetCurrentDirectory(); #endif diff --git a/Ocaramba.UnitTests/Tests/FilesHelperTests.cs b/Ocaramba.UnitTests/Tests/FilesHelperTests.cs index 91d380838..3b477c801 100644 --- a/Ocaramba.UnitTests/Tests/FilesHelperTests.cs +++ b/Ocaramba.UnitTests/Tests/FilesHelperTests.cs @@ -10,7 +10,7 @@ namespace Ocaramba.UnitTests.Tests [TestFixture, Parallelizable(ParallelScope.Self)] public class FilesHelperTests { -#if netcoreapp3_1 +#if net6_0 string folder = Directory.GetCurrentDirectory(); #endif diff --git a/Ocaramba.UnitTests/Tests/LocatorExtensionsTests.cs b/Ocaramba.UnitTests/Tests/LocatorExtensionsTests.cs index 255fd8f9e..76da6e128 100644 --- a/Ocaramba.UnitTests/Tests/LocatorExtensionsTests.cs +++ b/Ocaramba.UnitTests/Tests/LocatorExtensionsTests.cs @@ -25,7 +25,7 @@ public void ClassNameLocatorTest() var titleByClassName = new InternetPage(DriverContext) .OpenHomePage() .GoToDragAndDropPage().GetByClassName; -#if netcoreapp3_1 +#if net6_0 if (BaseConfiguration.Env == "Linux") { Assert.AreEqual("Drag and Drop\nA\nB", titleByClassName); @@ -46,7 +46,7 @@ public void CssSelectorLocatorTest() var titleByCssSelector = new InternetPage(DriverContext) .OpenHomePage() .GoToDragAndDropPage().GetByCssSelectorLocator; -#if netcoreapp3_1 +#if net6_0 if (BaseConfiguration.Env == "Linux") { Assert.AreEqual("Drag and Drop\nA\nB", titleByCssSelector); @@ -78,7 +78,7 @@ public void NameLocatorTest() .OpenHomePage() .GoToFormAuthenticationPage() .GetUsernameByNameLocator; -#if netcoreapp3_1 +#if net6_0 if (BaseConfiguration.Env == "Linux") { Assert.AreEqual("Username\nPassword\nLogin", columnA); diff --git a/Ocaramba.UnitTests/Tests/NameHelperTests.cs b/Ocaramba.UnitTests/Tests/NameHelperTests.cs index eb582ac4a..46c1cd9fd 100644 --- a/Ocaramba.UnitTests/Tests/NameHelperTests.cs +++ b/Ocaramba.UnitTests/Tests/NameHelperTests.cs @@ -9,7 +9,7 @@ namespace Ocaramba.UnitTests.Tests [TestFixture, Parallelizable(ParallelScope.Self)] public class NameHelperTests { -#if netcoreapp3_1 +#if net6_0 string folder = Directory.GetCurrentDirectory(); #endif @@ -19,7 +19,7 @@ public class NameHelperTests #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif [Test()] diff --git a/Ocaramba.UnitTests/Tests/TakingScreehShotsOfElementsTests.cs b/Ocaramba.UnitTests/Tests/TakingScreehShotsOfElementsTests.cs index e25ecb749..0b370833f 100644 --- a/Ocaramba.UnitTests/Tests/TakingScreehShotsOfElementsTests.cs +++ b/Ocaramba.UnitTests/Tests/TakingScreehShotsOfElementsTests.cs @@ -34,7 +34,7 @@ namespace Ocaramba.UnitTests.Tests [Category("NotImplementedInCoreOrUploadDownload")] public class TakingScreehShotsOfElementsTests : ProjectTestBase { -#if netcoreapp3_1 +#if net6_0 string folder = Directory.GetCurrentDirectory(); #endif diff --git a/Ocaramba.sln b/Ocaramba.sln index 951da014e..34f1bc60e 100644 --- a/Ocaramba.sln +++ b/Ocaramba.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29728.190 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33213.308 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ocaramba", "Ocaramba\Ocaramba.csproj", "{A357D58B-61BF-4E84-94FF-39DE8D2B7834}" EndProject diff --git a/Ocaramba/Helpers/SqlHelper.cs b/Ocaramba/Helpers/SqlHelper.cs index f5fe1f4b2..79bd0024c 100644 --- a/Ocaramba/Helpers/SqlHelper.cs +++ b/Ocaramba/Helpers/SqlHelper.cs @@ -40,7 +40,7 @@ public static class SqlHelper #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/Ocaramba/Ocaramba.csproj b/Ocaramba/Ocaramba.csproj index ca4bc4052..67050d283 100644 --- a/Ocaramba/Ocaramba.csproj +++ b/Ocaramba/Ocaramba.csproj @@ -1,8 +1,8 @@  - netcoreapp3.1 - net472;netcoreapp3.1 + net6.0 + net472;net6.0 Framework to automate tests using Selenium WebDriver Copyright © 2015 Objectivity Bespoke Software Specialists @@ -27,7 +27,7 @@ - + @@ -41,15 +41,15 @@ - + - 3.1.2 + 7.0.0 - 3.1.2 + 7.0.0 - 6.2.1 + 7.0.0 6.2.1 @@ -71,8 +71,8 @@ - - netcoreapp3_1 + + net6_0 @@ -81,6 +81,15 @@ true + disable + + 6 + + + + 6 + + diff --git a/OcarambaLite/BaseConfiguration.cs b/OcarambaLite/BaseConfiguration.cs index c671120a6..42e506e07 100644 --- a/OcarambaLite/BaseConfiguration.cs +++ b/OcarambaLite/BaseConfiguration.cs @@ -24,7 +24,7 @@ namespace Ocaramba { using System.Collections.Generic; using System.Collections.Specialized; -#if netcoreapp3_1 +#if net6_0 using Microsoft.Extensions.Configuration; #endif using System; @@ -45,7 +45,7 @@ public static class BaseConfiguration #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 public static readonly string Env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); /// @@ -74,7 +74,7 @@ public static BrowserType TestBrowser { bool supportedBrowser = false; string setting = null; -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:browser"]; #endif #if net47 @@ -104,7 +104,7 @@ public static BrowserType TestBrowserCapabilities #if net47 setting = ConfigurationManager.AppSettings["DriverCapabilities"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:DriverCapabilities"]; #endif @@ -130,7 +130,7 @@ public static string PathToFirefoxProfile string setting = null; #if net47 setting = ConfigurationManager.AppSettings["PathToFirefoxProfile"]; -#elif netcoreapp3_1 +#elif net6_0 setting = Builder["appSettings:PathToFirefoxProfile"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Gets the path to firefox profile from settings file '{0}'", setting); @@ -154,7 +154,7 @@ public static string Protocol #if net47 setting = ConfigurationManager.AppSettings["protocol"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:protocol"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Gets the protocol from settings file '{0}'", setting); @@ -173,7 +173,7 @@ public static string Host #if net47 setting = ConfigurationManager.AppSettings["host"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:host"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Gets the protocol from settings file '{0}'", setting); @@ -192,7 +192,7 @@ public static string Url #if net47 setting = ConfigurationManager.AppSettings["url"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:url"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Gets the url from settings file '{0}'", setting); @@ -211,7 +211,7 @@ public static string Proxy #if net47 setting = ConfigurationManager.AppSettings["proxy"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:proxy"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Gets the url from settings file '{0}'", setting); @@ -230,7 +230,7 @@ public static string HttpProxy #if net47 setting = ConfigurationManager.AppSettings["httpProxy"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:httpProxy"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Gets the httpProxy from settings file '{0}'", setting); @@ -249,7 +249,7 @@ public static string FtpProxy #if net47 setting = ConfigurationManager.AppSettings["ftpProxy"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:ftpProxy"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Gets the ftpProxy from settings file '{0}'", setting); @@ -268,7 +268,7 @@ public static string SslProxy #if net47 setting = ConfigurationManager.AppSettings["sslProxy"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:sslProxy"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Gets the sslProxy from settings file '{0}'", setting); @@ -287,7 +287,7 @@ public static string SocksProxy #if net47 setting = ConfigurationManager.AppSettings["socksproxy"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:socksproxy"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Gets the socksproxy from settings file '{0}'", setting); @@ -306,7 +306,7 @@ public static TimeSpan RemoteWebDriverTimeout #if net47 setting = int.Parse(ConfigurationManager.AppSettings["remoteTimeout"], CultureInfo.InvariantCulture); #endif -#if netcoreapp3_1 +#if net6_0 setting = int.Parse(Builder["appSettings:remoteTimeout"], CultureInfo.InvariantCulture); #endif Logger.Trace(CultureInfo.CurrentCulture, "Gets the remote timeout from settings file '{0}'", setting); @@ -325,7 +325,7 @@ public static string Username #if net47 setting = ConfigurationManager.AppSettings["username"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:username"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Gets the username from settings file '{0}'", setting); @@ -344,7 +344,7 @@ public static string Password #if net47 setting = ConfigurationManager.AppSettings["password"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:password"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Gets the password from settings file '{0}'", setting); @@ -366,8 +366,8 @@ public static double MediumTimeout #if net47 setting = Convert.ToDouble(ConfigurationManager.AppSettings["mediumTimeout"], CultureInfo.CurrentCulture); #endif -#if netcoreapp3_1 - setting = Convert.ToDouble(Builder["appSettings:mediumTimeout"]); +#if net6_0 + setting = Convert.ToDouble(Builder["appSettings:mediumTimeout"], CultureInfo.InvariantCulture); #endif Logger.Trace(CultureInfo.CurrentCulture, "Gets the mediumTimeout from settings file '{0}'", setting); return setting; @@ -388,8 +388,8 @@ public static double LongTimeout #if net47 setting = Convert.ToDouble(ConfigurationManager.AppSettings["longTimeout"], CultureInfo.CurrentCulture); #endif -#if netcoreapp3_1 - setting = Convert.ToDouble(Builder["appSettings:longTimeout"]); +#if net6_0 + setting = Convert.ToDouble(Builder["appSettings:longTimeout"], CultureInfo.InvariantCulture); #endif Logger.Trace(CultureInfo.CurrentCulture, "Gets the longTimeout from settings file '{0}'", setting); return setting; @@ -410,8 +410,8 @@ public static double ShortTimeout #if net47 setting = Convert.ToDouble(ConfigurationManager.AppSettings["shortTimeout"], CultureInfo.CurrentCulture); #endif -#if netcoreapp3_1 - setting = Convert.ToDouble(Builder["appSettings:shortTimeout"]); +#if net6_0 + setting = Convert.ToDouble(Builder["appSettings:shortTimeout"], CultureInfo.InvariantCulture); #endif Logger.Trace(CultureInfo.CurrentCulture, "Gets the shortTimeout from settings file '{0}'", setting); return setting; @@ -429,8 +429,8 @@ public static double ImplicitlyWaitMilliseconds #if net47 setting = Convert.ToDouble(ConfigurationManager.AppSettings["ImplicitlyWaitMilliseconds"], CultureInfo.CurrentCulture); #endif -#if netcoreapp3_1 - setting = Convert.ToDouble(Builder["appSettings:ImplicitlyWaitMilliseconds"]); +#if net6_0 + setting = Convert.ToDouble(Builder["appSettings:ImplicitlyWaitMilliseconds"], CultureInfo.InvariantCulture); #endif Logger.Trace(CultureInfo.CurrentCulture, "Gets the ImplicitlyWaitMilliseconds from settings file '{0}'", setting); return setting; @@ -448,7 +448,7 @@ public static string FirefoxBrowserExecutableLocation #if net47 setting = ConfigurationManager.AppSettings["FirefoxBrowserExecutableLocation"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:FirefoxBrowserExecutableLocation"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Gets the path and file name of the Firefox browser executable from settings file '{0}'", setting); @@ -472,7 +472,7 @@ public static string EdgeChromiumBrowserExecutableLocation #if net47 setting = ConfigurationManager.AppSettings["EdgeChromiumBrowserExecutableLocation"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:EdgeChromiumBrowserExecutableLocation"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Gets the path and file name of the Edge Chromium browser executable from settings file '{0}'", setting); @@ -496,7 +496,7 @@ public static string ChromeBrowserExecutableLocation #if net47 setting = ConfigurationManager.AppSettings["ChromeBrowserExecutableLocation"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:ChromeBrowserExecutableLocation"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Gets the path and file name of the Chrome browser executable from settings file '{0}'", setting); @@ -521,7 +521,7 @@ public static Uri RemoteWebDriverHub #if net47 setting = ConfigurationManager.AppSettings["RemoteWebDriverHub"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:RemoteWebDriverHub"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "RemoteWebDriverHub from settings file '{0}'", setting); @@ -568,7 +568,7 @@ public static string PathToChromeDriverLog #if net47 setting = ConfigurationManager.AppSettings["PathToChromeDriverLog"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:PathToChromeDriverLog"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Gets the PathToChromeDriverLog from settings file '{0}'", setting); @@ -592,7 +592,7 @@ public static bool EnableVerboseLoggingChrome #if net47 setting = ConfigurationManager.AppSettings["EnableVerboseLoggingChrome"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:EnableVerboseLoggingChrome"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Verbose logging for Chrome value from settings file '{0}'", setting); @@ -601,7 +601,7 @@ public static bool EnableVerboseLoggingChrome return false; } - if (setting.ToLower(CultureInfo.CurrentCulture).Equals("true")) + if (setting.ToLower(CultureInfo.CurrentCulture).Equals("true", StringComparison.Ordinal)) { return true; } @@ -621,7 +621,7 @@ public static string PathToInternetExplorerDriverDirectory #if net47 setting = ConfigurationManager.AppSettings["PathToInternetExplorerDriverDirectory"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:PathToInternetExplorerDriverDirectory"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Gets the PathToInternetExplorerDriverDirectory from settings file '{0}'", setting); @@ -645,7 +645,7 @@ public static string PathToEdgeChromiumDriverDirectory #if net47 setting = ConfigurationManager.AppSettings["PathToEdgeChromiumDriverDirectory"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:PathToEdgeChromiumDriverDirectory"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Gets the PathToEdgeChromiumDriverDirectory from settings file '{0}'", setting); @@ -664,7 +664,7 @@ public static string PathToChromeDriverDirectory #if net47 setting = ConfigurationManager.AppSettings["PathToChromeDriverDirectory"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:PathToChromeDriverDirectory"]; #endif @@ -689,7 +689,7 @@ public static string PathToFirefoxDriverDirectory #if net47 setting = ConfigurationManager.AppSettings["PathToFirefoxDriverDirectory"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:PathToFirefoxDriverDirectory"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Path to the directory containing Firefox Driver from settings file '{0}'", setting); @@ -713,7 +713,7 @@ public static bool JavaScriptErrorLogging #if net47 setting = ConfigurationManager.AppSettings["JavaScriptErrorLogging"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:JavaScriptErrorLogging"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "JavaScript error logging value from settings file '{0}'", setting); @@ -722,7 +722,7 @@ public static bool JavaScriptErrorLogging return false; } - if (setting.ToLower(CultureInfo.CurrentCulture).Equals("true")) + if (setting.ToLower(CultureInfo.CurrentCulture).Equals("true", StringComparison.Ordinal)) { return true; } @@ -742,7 +742,7 @@ public static Collection JavaScriptErrorTypes #if net47 setting = ConfigurationManager.AppSettings["JavaScriptErrorTypes"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:JavaScriptErrorTypes"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "JavaScript error logging value from settings file '{0}'", setting); @@ -777,7 +777,7 @@ public static bool SeleniumScreenShotEnabled #if net47 setting = ConfigurationManager.AppSettings["SeleniumScreenShotEnabled"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:SeleniumScreenShotEnabled"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Selenium Screen Shot Enabled value from settings file '{0}'", setting); @@ -786,7 +786,7 @@ public static bool SeleniumScreenShotEnabled return true; } - if (setting.ToLower(CultureInfo.CurrentCulture).Equals("true")) + if (setting.ToLower(CultureInfo.CurrentCulture).Equals("true", StringComparison.Ordinal)) { return true; } @@ -806,7 +806,7 @@ public static bool EnableEventFiringWebDriver #if net47 setting = ConfigurationManager.AppSettings["EnableEventFiringWebDriver"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:EnableEventFiringWebDriver"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Enable EventFiringWebDriver from settings file '{0}'", setting); @@ -815,7 +815,7 @@ public static bool EnableEventFiringWebDriver return false; } - if (setting.ToLower(CultureInfo.CurrentCulture).Equals("true")) + if (setting.ToLower(CultureInfo.CurrentCulture).Equals("true", StringComparison.Ordinal)) { return true; } @@ -835,7 +835,7 @@ public static bool UseCurrentDirectory #if net47 setting = ConfigurationManager.AppSettings["UseCurrentDirectory"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:UseCurrentDirectory"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Use Current Directory value from settings file '{0}'", setting); @@ -844,7 +844,7 @@ public static bool UseCurrentDirectory return false; } - if (setting.ToLower(CultureInfo.CurrentCulture).Equals("true")) + if (setting.ToLower(CultureInfo.CurrentCulture).Equals("true", StringComparison.Ordinal)) { return true; } @@ -867,7 +867,7 @@ public static bool GetPageSourceEnabled #if net47 setting = ConfigurationManager.AppSettings["GetPageSourceEnabled"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:GetPageSourceEnabled"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Get Page Source Enabled value from settings file '{0}'", setting); @@ -876,12 +876,7 @@ public static bool GetPageSourceEnabled return true; } - if (setting.ToLower(CultureInfo.CurrentCulture).Equals("true")) - { - return true; - } - - return false; + return setting.ToLower(CultureInfo.CurrentCulture).Equals("true", StringComparison.Ordinal); } } @@ -896,7 +891,7 @@ public static string DownloadFolder #if net47 setting = ConfigurationManager.AppSettings["DownloadFolder"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:DownloadFolder"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Get DownloadFolder value from settings file '{0}'", setting); @@ -915,7 +910,7 @@ public static string ScreenShotFolder #if net47 setting = ConfigurationManager.AppSettings["ScreenShotFolder"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:ScreenShotFolder"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Get ScreenShotFolder value from settings file '{0}'", setting); @@ -934,7 +929,7 @@ public static string PageSourceFolder #if net47 setting = ConfigurationManager.AppSettings["PageSourceFolder"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:PageSourceFolder"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Get PageSourceFolder value from settings file '{0}'", setting); @@ -990,7 +985,7 @@ public static bool SynchronizationWithAngularEnabled #if net47 setting = ConfigurationManager.AppSettings["SynchronizationWithAngularEnabled"]; #endif -#if netcoreapp3_1 +#if net6_0 setting = Builder["appSettings:SynchronizationWithAngularEnabled"]; #endif Logger.Trace(CultureInfo.CurrentCulture, "Angular synchronization Enabled value from settings file '{0}'", setting); @@ -999,7 +994,7 @@ public static bool SynchronizationWithAngularEnabled return false; } - if (setting.ToLower(CultureInfo.CurrentCulture).Equals("true")) + if (setting.ToLower(CultureInfo.CurrentCulture).Equals("true", StringComparison.Ordinal)) { return true; } @@ -1007,7 +1002,7 @@ public static bool SynchronizationWithAngularEnabled return false; } } -#if netcoreapp3_1 +#if net6_0 /// /// Converting settings from appsettings.json into the NameValueCollection, key - value pairs. diff --git a/OcarambaLite/DriverContext.cs b/OcarambaLite/DriverContext.cs index f539418d1..9fa755f13 100644 --- a/OcarambaLite/DriverContext.cs +++ b/OcarambaLite/DriverContext.cs @@ -51,7 +51,7 @@ public partial class DriverContext #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif private readonly Collection verifyMessages = new Collection(); @@ -209,7 +209,7 @@ private FirefoxOptions FirefoxOptions firefoxPreferences = ConfigurationManager.GetSection("FirefoxPreferences") as NameValueCollection; firefoxExtensions = ConfigurationManager.GetSection("FirefoxExtensions") as NameValueCollection; #endif -#if netcoreapp3_1 +#if net6_0 firefoxPreferences = BaseConfiguration.GetNameValueCollectionFromAppsettings("FirefoxPreferences"); firefoxExtensions = BaseConfiguration.GetNameValueCollectionFromAppsettings("FirefoxExtensions"); #endif @@ -316,7 +316,7 @@ private ChromeOptions ChromeOptions chromeExtensions = ConfigurationManager.GetSection("ChromeExtensions") as NameValueCollection; chromeArguments = ConfigurationManager.GetSection("ChromeArguments") as NameValueCollection; #endif -#if netcoreapp3_1 +#if net6_0 chromePreferences = BaseConfiguration.GetNameValueCollectionFromAppsettings("ChromePreferences"); chromeExtensions = BaseConfiguration.GetNameValueCollectionFromAppsettings("ChromeExtensions"); chromeArguments = BaseConfiguration.GetNameValueCollectionFromAppsettings("chromeArguments"); @@ -417,7 +417,7 @@ private InternetExplorerOptions InternetExplorerOptions #if net47 internetExplorerPreferences = ConfigurationManager.GetSection("InternetExplorerPreferences") as NameValueCollection; #endif -#if netcoreapp3_1 +#if net6_0 internetExplorerPreferences = BaseConfiguration.GetNameValueCollectionFromAppsettings("InternetExplorerPreferences"); #endif var options = new InternetExplorerOptions @@ -460,7 +460,7 @@ private OpenQA.Selenium.Edge.EdgeOptions EdgeOptions edgeChromiumExtensions = ConfigurationManager.GetSection("EdgeChromiumExtensions") as NameValueCollection; edgeChromiumArguments = ConfigurationManager.GetSection("EdgeChromiumArguments") as NameValueCollection; #endif -#if netcoreapp3_1 +#if net6_0 edgeChromiumPreferences = BaseConfiguration.GetNameValueCollectionFromAppsettings("EdgeChromiumPreferences"); edgeChromiumExtensions = BaseConfiguration.GetNameValueCollectionFromAppsettings("EdgeChromiumExtensions"); edgeChromiumArguments = BaseConfiguration.GetNameValueCollectionFromAppsettings("EdgeChromiumArguments"); @@ -602,7 +602,7 @@ public void Start() { this.FirefoxOptions.BrowserExecutableLocation = BaseConfiguration.FirefoxBrowserExecutableLocation; } -#if netcoreapp3_1 +#if net6_0 FirefoxDriverService serviceFirefox = FirefoxDriverService.CreateDefaultService(); serviceFirefox.Host = "::1"; this.driver = string.IsNullOrEmpty(BaseConfiguration.PathToFirefoxDriverDirectory) ? new FirefoxDriver(serviceFirefox, this.SetDriverOptions(this.FirefoxOptions)) : new FirefoxDriver(BaseConfiguration.PathToFirefoxDriverDirectory, this.SetDriverOptions(this.FirefoxOptions)); @@ -699,7 +699,7 @@ private void SetupRemoteWebDriver() driverCapabilitiesConf = ConfigurationManager.GetSection("DriverCapabilities") as NameValueCollection; settings = ConfigurationManager.GetSection("environments/" + this.CrossBrowserEnvironment) as NameValueCollection; #endif -#if netcoreapp3_1 +#if net6_0 driverCapabilitiesConf = BaseConfiguration.GetNameValueCollectionFromAppsettings("DriverCapabilities"); settings = BaseConfiguration.GetNameValueCollectionFromAppsettings("environments:" + this.CrossBrowserEnvironment); #endif diff --git a/OcarambaLite/DriverContextHelper.cs b/OcarambaLite/DriverContextHelper.cs index 98010dd26..68a44a45b 100644 --- a/OcarambaLite/DriverContextHelper.cs +++ b/OcarambaLite/DriverContextHelper.cs @@ -54,7 +54,12 @@ public partial class DriverContext public string SaveScreenshot(ErrorDetail errorDetail, string folder, string title) { var fileName = string.Format(CultureInfo.CurrentCulture, "{0}_{1}_{2}.png", title, errorDetail.DateTime.ToString("yyyy-MM-dd HH-mm-ss-fff", CultureInfo.CurrentCulture), "browser"); +#if net47 var correctFileName = Path.GetInvalidFileNameChars().Aggregate(fileName, (current, c) => current.Replace(c.ToString(CultureInfo.CurrentCulture), string.Empty)); +#endif +#if net6_0 + var correctFileName = Path.GetInvalidFileNameChars().Aggregate(fileName, (current, c) => current.Replace(c.ToString(CultureInfo.CurrentCulture), string.Empty, StringComparison.InvariantCultureIgnoreCase)); +#endif correctFileName = Regex.Replace(correctFileName, "[^0-9a-zA-Z._]+", "_"); correctFileName = NameHelper.ShortenFileName(folder, correctFileName, "_", 255); @@ -95,7 +100,12 @@ public string SavePageSource(string fileName) } var pageSource = this.driver.PageSource; +#if net47 pageSource = pageSource.Replace("", string.Format(CultureInfo.CurrentCulture, "", BaseConfiguration.Host)); +#endif +#if net6_0 + pageSource = pageSource.Replace("", string.Format(CultureInfo.CurrentCulture, "", BaseConfiguration.Host), StringComparison.InvariantCultureIgnoreCase); +#endif File.WriteAllText(path, pageSource); FilesHelper.WaitForFileOfGivenName(BaseConfiguration.LongTimeout, fileNameWithExtension, this.PageSourceFolder); Logger.Error(CultureInfo.CurrentCulture, "Test failed: page Source saved to {0}.", path); @@ -144,10 +154,18 @@ public bool LogJavaScriptErrors() Logger.Debug(CultureInfo.CurrentCulture, "Checking JavaScript error(s) in browser"); try { +#if net47 jsErrors = this.driver.Manage() .Logs.GetLog(LogType.Browser) - .Where(x => BaseConfiguration.JavaScriptErrorTypes.Any(e => x.Message.Contains(e))); + .Where(x => BaseConfiguration.JavaScriptErrorTypes.Any(predicate: e => x.Message.Contains(e))); +#endif +#if net6_0 + jsErrors = + this.driver.Manage() + .Logs.GetLog(LogType.Browser) + .Where(x => BaseConfiguration.JavaScriptErrorTypes.Any(predicate: e => x.Message.Contains(e, StringComparison.InvariantCultureIgnoreCase))); +#endif } catch (NullReferenceException) { @@ -208,7 +226,7 @@ private FirefoxOptions AddFirefoxArguments(FirefoxOptions option) #if net47 firefoxArguments = ConfigurationManager.GetSection("FirefoxArguments") as NameValueCollection; #endif -#if netcoreapp3_1 +#if net6_0 firefoxArguments = BaseConfiguration.GetNameValueCollectionFromAppsettings("FirefoxArguments"); #endif @@ -287,6 +305,7 @@ private BrowserType GetBrowserTypeForRemoteDriver(NameValueCollection settings) Logger.Info(CultureInfo.CurrentCulture, "supportedBrowser {0} : {1}", supportedBrowser, browserType); } +#if net47 if (!supportedBrowser) { if (this.CrossBrowserEnvironment.ToLower(CultureInfo.CurrentCulture).Contains(BrowserType.Android.ToString().ToLower(CultureInfo.CurrentCulture))) @@ -297,8 +316,21 @@ private BrowserType GetBrowserTypeForRemoteDriver(NameValueCollection settings) { browserType = BrowserType.Safari; } + } +#endif +#if net6_0 + if (!supportedBrowser) + { + if (this.CrossBrowserEnvironment.ToLower(CultureInfo.CurrentCulture).Contains(BrowserType.Android.ToString().ToLower(CultureInfo.CurrentCulture), StringComparison.InvariantCultureIgnoreCase)) + { + browserType = BrowserType.Chrome; + } + else if (this.CrossBrowserEnvironment.ToLower(CultureInfo.CurrentCulture).Contains(BrowserType.Iphone.ToString().ToLower(CultureInfo.CurrentCulture), StringComparison.InvariantCultureIgnoreCase)) + { + browserType = BrowserType.Safari; + } } - +#endif return browserType; } @@ -347,7 +379,7 @@ private void SetRemoteDriverBrowserOptions(NameValueCollection driverCapabilitie { capabilities.Add("sessionName", this.TestTitle); } - +#if net47 if (BaseConfiguration.RemoteWebDriverHub.ToString().ToLower().Contains("browserstack")) { browserOptions.AddAdditionalOption("bstack:options", capabilities); @@ -360,6 +392,21 @@ private void SetRemoteDriverBrowserOptions(NameValueCollection driverCapabilitie { browserOptions.AddAdditionalOption("tb:options", capabilities); } +#endif +#if net6_0 + if (BaseConfiguration.RemoteWebDriverHub.ToString().ToLower(CultureInfo.CurrentCulture).Contains("browserstack", StringComparison.InvariantCultureIgnoreCase)) + { + browserOptions.AddAdditionalOption("bstack:options", capabilities); + } + else if (BaseConfiguration.RemoteWebDriverHub.ToString().ToLower(CultureInfo.CurrentCulture).Contains("saucelabs", StringComparison.InvariantCultureIgnoreCase)) + { + browserOptions.AddAdditionalOption("sauce:options", capabilities); + } + else if (BaseConfiguration.RemoteWebDriverHub.ToString().ToLower(CultureInfo.CurrentCulture).Contains("testingbot", StringComparison.InvariantCultureIgnoreCase)) + { + browserOptions.AddAdditionalOption("tb:options", capabilities); + } +#endif } [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Loop through all internetExplorerPreferences")] diff --git a/OcarambaLite/Extensions/WebDriverExtensions.cs b/OcarambaLite/Extensions/WebDriverExtensions.cs index 020fa1776..5f46dfb2c 100644 --- a/OcarambaLite/Extensions/WebDriverExtensions.cs +++ b/OcarambaLite/Extensions/WebDriverExtensions.cs @@ -40,7 +40,7 @@ public static class WebDriverExtensions #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif @@ -190,7 +190,7 @@ public static void SwitchToWindowUsingUrl(this IWebDriver webDriver, Uri url, do foreach (var handle in webDriver.WindowHandles) { webDriver.SwitchTo().Window(handle); - if (driver.Url.Equals(url.ToString())) + if (driver.Url.Equals(url.ToString(), StringComparison.Ordinal)) { return true; } @@ -242,11 +242,23 @@ public static bool PageSourceContainsCase(this IWebDriver webDriver, string text if (isCaseSensitive) { +#if net47 condition = drv => drv.PageSource.Contains(text); +#endif +#if net6_0 + condition = drv => drv.PageSource.Contains(text, StringComparison.InvariantCultureIgnoreCase); +#endif + } else { +#if net47 condition = drv => drv.PageSource.ToUpperInvariant().Contains(text.ToUpperInvariant()); +#endif +#if net6_0 + condition = drv => drv.PageSource.ToUpperInvariant().Contains(text.ToUpperInvariant(), StringComparison.InvariantCultureIgnoreCase); +#endif + } if (timeoutInSeconds > 0) @@ -366,7 +378,12 @@ public static void DragAndDropJs(this IWebDriver webDriver, IWebElement source, /// The web driver. private static void ApproveCertificateForInternetExplorer(this IWebDriver webDriver) { +#if net47 if ((BaseConfiguration.TestBrowser.Equals(BrowserType.InternetExplorer) || BaseConfiguration.TestBrowser.Equals(BrowserType.IE)) && webDriver.Title.Contains("Certificate")) +#endif +#if net6_0 + if ((BaseConfiguration.TestBrowser.Equals(BrowserType.InternetExplorer) || BaseConfiguration.TestBrowser.Equals(BrowserType.IE)) && webDriver.Title.Contains("Certificate", StringComparison.InvariantCultureIgnoreCase)) +#endif { webDriver.FindElement(By.Id("overridelink")).JavaScriptClick(); } diff --git a/OcarambaLite/Extensions/WebElementExtensions.cs b/OcarambaLite/Extensions/WebElementExtensions.cs index 40a5beddb..78323d739 100644 --- a/OcarambaLite/Extensions/WebElementExtensions.cs +++ b/OcarambaLite/Extensions/WebElementExtensions.cs @@ -40,7 +40,7 @@ public static class WebElementExtensions /// public static bool IsElementTextEqualsToExpected(this IWebElement webElement, string text) { - return webElement.Text.Equals(text); + return webElement.Text.Equals(text, StringComparison.Ordinal); } /// diff --git a/OcarambaLite/Helpers/FilesHelper.cs b/OcarambaLite/Helpers/FilesHelper.cs index aee9b54f1..a32e5ec5b 100644 --- a/OcarambaLite/Helpers/FilesHelper.cs +++ b/OcarambaLite/Helpers/FilesHelper.cs @@ -44,7 +44,7 @@ public static class FilesHelper #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/OcarambaLite/Helpers/NameHelper.cs b/OcarambaLite/Helpers/NameHelper.cs index 44001e367..84546093d 100644 --- a/OcarambaLite/Helpers/NameHelper.cs +++ b/OcarambaLite/Helpers/NameHelper.cs @@ -39,7 +39,7 @@ public static class NameHelper #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif @@ -77,8 +77,12 @@ public static string RandomName(int length) public static string ShortenFileName(string folder, string fileName, string pattern, int maxLength) { Logger.Debug(CultureInfo.CurrentCulture, "Length of the file full name is {0} characters", (folder + fileName).Length); - - while (((folder + fileName).Length > maxLength) && fileName.Contains(pattern)) +#if net47 + while (!((folder + fileName).Length <= maxLength || !fileName.Contains(pattern))) +#endif +#if net6_0 + while (!((folder + fileName).Length <= maxLength || !fileName.Contains(pattern, StringComparison.InvariantCultureIgnoreCase))) +#endif { Logger.Trace(CultureInfo.CurrentCulture, "Length of the file full name is over {0} characters removing first occurrence of {1}", maxLength, pattern); Regex rgx = new Regex(pattern); diff --git a/OcarambaLite/Helpers/PerformanceHelper.cs b/OcarambaLite/Helpers/PerformanceHelper.cs index ac1ecd587..6d583f6ea 100644 --- a/OcarambaLite/Helpers/PerformanceHelper.cs +++ b/OcarambaLite/Helpers/PerformanceHelper.cs @@ -38,7 +38,7 @@ public class PerformanceHelper #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/OcarambaLite/Helpers/PrintPerformanceResultsHelper.cs b/OcarambaLite/Helpers/PrintPerformanceResultsHelper.cs index 1c5999ea2..217ec6ebb 100644 --- a/OcarambaLite/Helpers/PrintPerformanceResultsHelper.cs +++ b/OcarambaLite/Helpers/PrintPerformanceResultsHelper.cs @@ -25,7 +25,7 @@ namespace Ocaramba.Helpers using System.ComponentModel; using System.Diagnostics; using System.Linq; -#if netcoreapp3_1 +#if net6_0 using System.Management.Automation; #endif using NLog; @@ -38,7 +38,7 @@ public static class PrintPerformanceResultsHelper #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif @@ -150,7 +150,7 @@ public static void PrintResultsInAppVeyor(IOrderedEnumerable measuresToP } #endif -#if netcoreapp3_1 +#if net6_0 text = "Add-AppveyorTest -Name " + measuresToPrint.ElementAt(i); using (var ps = PowerShell.Create()) { diff --git a/OcarambaLite/Helpers/WaitHelper.cs b/OcarambaLite/Helpers/WaitHelper.cs index 694aa6bf9..79175fddf 100644 --- a/OcarambaLite/Helpers/WaitHelper.cs +++ b/OcarambaLite/Helpers/WaitHelper.cs @@ -84,39 +84,33 @@ public static void Wait(Func condition, TimeSpan timeout, TimeSpan sleepIn /// public static bool Wait(Func condition, TimeSpan timeout, TimeSpan sleepInterval) { - var result = false; - var start = DateTime.Now; - var canceller = new CancellationTokenSource(); - var task = Task.Factory.StartNew(condition, canceller.Token); + var taskConditionCheck = Task.Run(async () => + { + while (!condition()) + { + await Task.Delay(sleepInterval); + } + }); + + var taskTimeoutCheck = Task.Run(async () => + { + await Task.Delay(timeout); + }); - while ((DateTime.Now - start).TotalSeconds < timeout.TotalSeconds) + while (true) { - if (task.IsCompleted) + if (taskConditionCheck.IsCompleted) { - if (task.Result) - { - result = true; - canceller.Cancel(); - break; - } + return true; + } - task = Task.Factory.StartNew( - () => - { - using (canceller.Token.Register(Thread.CurrentThread.Abort)) - { - return condition(); - } - }, - canceller.Token); + if (taskTimeoutCheck.IsCompleted) + { + return false; } Thread.Sleep(sleepInterval); } - - canceller.Cancel(); - canceller.Dispose(); - return result; } } } diff --git a/OcarambaLite/Logger/MyEventFiringWebDriver.cs b/OcarambaLite/Logger/MyEventFiringWebDriver.cs index 659ca58a3..d9363ce29 100644 --- a/OcarambaLite/Logger/MyEventFiringWebDriver.cs +++ b/OcarambaLite/Logger/MyEventFiringWebDriver.cs @@ -35,8 +35,8 @@ public class MyEventFiringWebDriver : EventFiringWebDriver #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 - private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); +#if net6_0 + private static readonly Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif /// diff --git a/OcarambaLite/Logger/TestLogger.cs b/OcarambaLite/Logger/TestLogger.cs index a5c3c4255..31b3dbb17 100644 --- a/OcarambaLite/Logger/TestLogger.cs +++ b/OcarambaLite/Logger/TestLogger.cs @@ -38,7 +38,7 @@ public class TestLogger #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/OcarambaLite/OcarambaLite.csproj b/OcarambaLite/OcarambaLite.csproj index eefc383d7..f90002fed 100644 --- a/OcarambaLite/OcarambaLite.csproj +++ b/OcarambaLite/OcarambaLite.csproj @@ -1,8 +1,8 @@  - netcoreapp3.1 - net472;netcoreapp3.1 + net472;net6.0 + net472;net6.0 Framework to automate tests using Selenium WebDriver (lighten version without selenium drivers) Copyright © 2015 Objectivity Bespoke Software Specialists @@ -24,10 +24,10 @@ - + - + all @@ -38,15 +38,15 @@ - + - 3.1.2 + 7.0.0 - 3.1.2 + 7.0.0 - 6.2.1 + 7.0.0 6.2.1 @@ -58,9 +58,6 @@ 5.1.1 - - - @@ -68,8 +65,8 @@ - - netcoreapp3_1 + + net6_0 diff --git a/OcarambaLite/Verify.cs b/OcarambaLite/Verify.cs index daf697fb3..f5af59836 100644 --- a/OcarambaLite/Verify.cs +++ b/OcarambaLite/Verify.cs @@ -37,7 +37,7 @@ public static class Verify #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/OcarambaLite/WebElements/Select.cs b/OcarambaLite/WebElements/Select.cs index 8dedfe1a7..0a07368f4 100644 --- a/OcarambaLite/WebElements/Select.cs +++ b/OcarambaLite/WebElements/Select.cs @@ -39,7 +39,7 @@ public class Select : WebElement #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif @@ -190,7 +190,7 @@ public bool IsSelectOptionAvailable(string option, double timeout) var element = this.WaitUntilDropdownIsPopulated(timeout); var selectElement = new SelectElement(element); - return selectElement.Options.Any(el => el.Text.Equals(option)); + return selectElement.Options.Any(el => el.Text.Equals(option, StringComparison.Ordinal)); } /// diff --git a/OcarambaLite/WebElements/Table.cs b/OcarambaLite/WebElements/Table.cs index c4a1c4bfb..01b1f4f59 100644 --- a/OcarambaLite/WebElements/Table.cs +++ b/OcarambaLite/WebElements/Table.cs @@ -36,7 +36,7 @@ public class Table : WebElement #if net47 private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); #endif -#if netcoreapp3_1 +#if net6_0 private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); #endif diff --git a/README.md b/README.md index 7aa2f73ad..fa41f75bd 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Project API documentation can be found here: http://objectivityltd.github.io/Oca **It provides the following features:** -- .NET Frameworks 4.7.2 and .NET Core 3.1 supported +- .NET Frameworks 4.7.2 and .NET 6.0 supported - Cross-Platform Windows, Linux and macOS systems supported - Supports continuous integration tools like Azure DevOps, Teamcity, Jenkins and others. - Ready for parallel tests execution, more details [here](https://github.com/ObjectivityLtd/Ocaramba/wiki/Selenium%20Parallel%20tests%20execution) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e9c0e1767..57ba3fbd9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -29,8 +29,8 @@ variables: buildConfiguration: 'Release' frameworkVersion: '4.0.0' BuildVersion: '$(frameworkVersion)$(Build.BuildNumber)' - seleniumGridVersion: 'selenium-server-4.0.0.jar' - seleniumGridUrl: 'https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.0.0/selenium-server-4.0.0.jar' + seleniumGridVersion: 'selenium-server-4.8.0.jar' + seleniumGridUrl: 'https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.8.0/selenium-server-4.8.0.jar' stages: - stage: build @@ -122,6 +122,7 @@ stages: - job: RunTestsOnDocker pool: vmImage: 'ubuntu-latest' + condition: false steps: - task: DockerCompose@0 inputs: @@ -129,6 +130,14 @@ stages: dockerComposeFile: '**/docker-compose.yml' action: 'Run a Docker Compose command' dockerComposeCommand: 'up -d --build' + enabled: false + + - task: Docker@2 + displayName: Build an image + inputs: + repository: ocaramba_selenium + command: build + Dockerfile: Dockerfile - task: PowerShell@2 inputs: @@ -241,7 +250,7 @@ stages: - task: ArchiveFiles@2 condition: always() inputs: - rootFolderOrFile: '$(System.DefaultWorkingDirectory)/Ocaramba.Tests.NUnitExtentReports/bin/Release/netcoreapp3.1/TestOutput' + rootFolderOrFile: '$(System.DefaultWorkingDirectory)/Ocaramba.Tests.NUnitExtentReports/bin/Release/net6.0/TestOutput' includeRootFolder: true archiveType: 'zip' archiveFile: '$(Build.ArtifactStagingDirectory)/ExtentReports_$(Build.BuildId).zip' diff --git a/docker-compose.yml b/docker-compose.yml index 37f8dbdaa..17916fde0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,10 +1,10 @@ version: '3.7' services: ocaramba_selenium_container: - image: ocaramba/selenium + image: mcr.microsoft.com/dotnet/sdk:6.0 build: context: . - dockerfile: DockerfileBuild + dockerfile: Dockerfile container_name: ocaramba_selenium stdin_open: true tty: true