Skip to content

Commit

Permalink
Browserstack (#473)
Browse files Browse the repository at this point in the history
* Update github-actions.yml

* Update ExecutingTestsOnLinuxBrowserStackGithubActions.ps1

* Update github-actions.yml

* updated packages

* fixed asserts

* fixed tests

* fixed tests

* fixed tests

* updated

* fixed tests

* updated apppsetings file

* Update github-actions.yml

* Update github-actions.yml

* Update github-actions.yml

* updated packages

* Update github-actions.yml

* fixex build issue

* fixed build issue

* Update README.md

* Update github-actions.yml

* fixed build issues

* Update github-actions.yml

* Update README.md

---------

Co-authored-by: Jakub Raczek <[email protected]>
  • Loading branch information
raczeja and jraczek-acc authored Dec 2, 2024
1 parent b22799a commit a6369b5
Show file tree
Hide file tree
Showing 58 changed files with 1,594 additions and 2,226 deletions.
75 changes: 43 additions & 32 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,29 +157,43 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: |
ls
ls
export ASPNETCORE_ENVIRONMENT=Linux
echo $ASPNETCORE_ENVIRONMENT
sed -i '/Documentation/,+5 d' ./Ocaramba.sln
- run: dotnet build ./Ocaramba.sln --configuration ${{ env.buildConfiguration }}
- run: chmod +x ./chromedriver.sh
- run: ./chromedriver.sh
- name: 'BrowserStack Env Setup'
uses: 'browserstack/github-actions/setup-env@master'
with:
username: ${{ secrets.BROWSERSTACKUSER }}
access-key: ${{ secrets.BROWSERSTACKKEY }}
build-name: 'BUILD_INFO'
project-name: 'REPO_NAME'
- name: 'Start BrowserStackLocal Tunnel'
uses: 'browserstack/github-actions/setup-local@master'
with:
local-testing: 'start'
local-logging-level: 'all-logs'
local-identifier: 'random'
- shell: pwsh
if: true
env:
MAPPED_ENV_BROWSERSTACKKEY: ${{ secrets.BROWSERSTACKKEY }}
MAPPED_ENV_BROWSERSTACKUSER: ${{ secrets.BROWSERSTACKUSER }}
MAPPED_ENV_TESTINGBOTKEY: ${{ env.testingbotkey }}
MAPPED_ENV_TESTINGBOTSECRET: ${{ env.testingbotsecret }}
MAPPED_ENV_SAUCELABSACCESSKEY: ${{ env.saucelabsaccessKey }}
MAPPED_ENV_SAUCELABSUSERNAME: ${{ env.saucelabsusername }}
MAPPED_ENV_TESTINGBOTKEY: ${{ secrets.testingbotkey }}
MAPPED_ENV_TESTINGBOTSECRET: ${{ secrets.testingbotsecret }}
MAPPED_ENV_SAUCELABSACCESSKEY: ${{ secrets.saucelabsaccessKey }}
MAPPED_ENV_SAUCELABSUSERNAME: ${{ secrets.saucelabsusername }}
run: ./ExecutingTestsOnLinuxBrowserStackGithubActions.ps1
- name: 'Start BrowserStackLocal Tunnel'
uses: 'browserstack/github-actions/setup-local@master'
with:
local-testing: 'stop'
local-logging-level: 'all-logs'
local-identifier: 'random'
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/linux@v2
if: false
if: true
with:
files: |
/home/runner/work/**/TestResults/*.xml
Expand All @@ -198,13 +212,12 @@ jobs:
name: OcarambaBuild
- run: Expand-Archive -Path OcarambaBuild.zip -DestinationPath ./
- run: ./ExecutingTestsOnWindowsGithubActions1.ps1
- run: Get-ChildItem .\ -Recurse
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/windows@v2
if: always()
with:
files: ${{ env.TestResultsDirWindows }}\*.trx
check_name: ExecutingTestsOnWindowsGithubActions1
check_name: ExecutingTestsOnWindowsGithubActionsCore1
- name: Zip artifact
run: Compress-Archive -Path D:\a\Ocaramba\Ocaramba\Ocaramba\Ocaramba.Tests.NUnitExtentReports\bin\Release\net8.0\TestOutput -Destination ExtentReports_${{ github.run_id }}.zip
- uses: actions/upload-artifact@v4
Expand All @@ -226,14 +239,13 @@ jobs:
name: OcarambaBuild
- run: Expand-Archive -Path OcarambaBuild.zip -DestinationPath ./
- run: ./ExecutingTestsOnWindowsGithubActions2.ps1
- run: Get-ChildItem .\ -Recurse
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/windows@v2
if: always()
with:
files: |
${{ env.TestResultsDirWindows }}\*.xml
check_name: ExecutingTestsOnWindowsGithubActions2
check_name: ExecutingTestsOnWindowsGithubActionsCore2
test_Stage_RunTestsOnWindowsFramework:
runs-on: windows-latest
needs:
Expand All @@ -253,7 +265,7 @@ jobs:
if: always()
with:
files: ${{ env.TestResultsDirWindows }}\*.xml
check_name: ExecutingTestsOnWindowsGithubActions3
check_name: ExecutingTestsOnWindowsGithubActionsNet3
test_Stage_RunTestsOnWindowsBrowserStack:
runs-on: windows-latest
needs:
Expand All @@ -269,18 +281,18 @@ jobs:
- run: Expand-Archive -Path OcarambaBuild.zip -DestinationPath ./
- run: ./ExecutingTestsOnWindowsGithubActions4.ps1
env:
MAPPED_ENV_BROWSERSTACKKEY: ${{ env.browserstackkey }}
MAPPED_ENV_BROWSERSTACKUSER: ${{ env.browserstackuser }}
MAPPED_ENV_TESTINGBOTKEY: ${{ env.testingbotkey }}
MAPPED_ENV_TESTINGBOTSECRET: ${{ env.testingbotsecret }}
MAPPED_ENV_SAUCELABSACCESSKEY: ${{ env.saucelabsaccessKey }}
MAPPED_ENV_SAUCELABSUSERNAME: ${{ env.saucelabsusername }}
MAPPED_ENV_BROWSERSTACKKEY: ${{ secrets.BROWSERSTACKKEY }}
MAPPED_ENV_BROWSERSTACKUSER: ${{ secrets.BROWSERSTACKUSER }}
MAPPED_ENV_TESTINGBOTKEY: ${{ secrets.testingbotkey }}
MAPPED_ENV_TESTINGBOTSECRET: ${{ secrets.testingbotsecret }}
MAPPED_ENV_SAUCELABSACCESSKEY: ${{ secrets.saucelabsaccessKey }}
MAPPED_ENV_SAUCELABSUSERNAME: ${{ secrets.saucelabsusername }}
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/windows@v2
if: always()
with:
files: ${{ env.TestResultsDirWindows }}\*.xml
check_name: ExecutingTestsOnWindowsGithubActions4
check_name: ExecutingTestsOnWindowsGithubActionsBrowserStack4
test_Stage_RunTestsSeleniumGrid:
runs-on: windows-latest
needs:
Expand All @@ -301,7 +313,7 @@ jobs:
with:
files: |
${{ env.TestResultsDirWindows }}\*.xml
check_name: ExecutingTestsOnWindowsGithubActions5
check_name: ExecutingTestsOnWindowsGithubActionsSeleniumGrid5
test_Stage_RunTestsOnWindowsSaucelabs:
runs-on: windows-latest
needs:
Expand All @@ -317,19 +329,19 @@ jobs:
- run: Expand-Archive -Path OcarambaBuild.zip -DestinationPath ./
- run: ./ExecutingTestsOnWindowsGithubActions6.ps1
env:
MAPPED_ENV_BROWSERSTACKKEY: ${{ env.browserstackkey }}
MAPPED_ENV_BROWSERSTACKUSER: ${{ env.browserstackuser }}
MAPPED_ENV_TESTINGBOTKEY: ${{ env.testingbotkey }}
MAPPED_ENV_TESTINGBOTSECRET: ${{ env.testingbotsecret }}
MAPPED_ENV_SAUCELABSACCESSKEY: ${{ env.saucelabsaccessKey }}
MAPPED_ENV_SAUCELABSUSERNAME: ${{ env.saucelabsusername }}
MAPPED_ENV_BROWSERSTACKKEY: ${{ secrets.BROWSERSTACKKEY }}
MAPPED_ENV_BROWSERSTACKUSER: ${{ secrets.BROWSERSTACKUSER }}
MAPPED_ENV_TESTINGBOTKEY: ${{ secrets.testingbotkey }}
MAPPED_ENV_TESTINGBOTSECRET: ${{ secrets.testingbotsecret }}
MAPPED_ENV_SAUCELABSACCESSKEY: ${{ secrets.saucelabsaccessKey }}
MAPPED_ENV_SAUCELABSUSERNAME: ${{ secrets.saucelabsusername }}
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/windows@v2
if: always()
with:
files: |
${{ env.TestResultsDirWindows }}\*.xml
check_name: ExecutingTestsOnWindowsGithubActions6
check_name: ExecutingTestsOnWindowsGithubActionsSaucelabs6
release_Stage_PublishNuget:
runs-on: windows-latest
needs:
Expand Down Expand Up @@ -363,7 +375,6 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: OcarambaLiteS${{ env.frameworkVersion }}
- run: Get-ChildItem ./ -Recurse
- name: Push Nuget Package
run: dotnet push .\Ocaramba\Ocaramba\Ocaramba.${{ env.frameworkVersion }}.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }}
if: (success() && startsWith(github.ref, 'refs/tags/'))
Expand Down
2 changes: 0 additions & 2 deletions ExecutingTestsOnLinuxBrowserStackGithubActions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ $Env:ASPNETCORE_ENVIRONMENT="Linux"

echo $Env:ASPNETCORE_ENVIRONMENT

Copy-Item -Path .\chromedriver -Destination ".\Ocaramba.Tests.CloudProviderCrossBrowser\bin\Release\net8.0" -Force

.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.CloudProviderCrossBrowser\bin\Release\net8.0" "appsettings.Linux.json" "appSettings" "browser" "Chrome" -logValues -json

.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.CloudProviderCrossBrowser\bin\Release\net8.0" "appsettings.Linux.json" "appSettings" "RemoteWebDriverHub" "https://$($env:MAPPED_ENV_BROWSERSTACKUSER):$($env:MAPPED_ENV_BROWSERSTACKKEY)@hub-cloud.browserstack.com/wd/hub/" -logValues -json
Expand Down
20 changes: 20 additions & 0 deletions Ocaramba.Tests.Angular/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,24 @@
<add key="EnablePersistentHover" value="false" />
<add key="IntroduceInstabilityByIgnoringProtectedModeSettings" value="true" />
</InternetExplorerPreferences>
<startup>
<supportedRuntime version="v4.7.2" sku=".NETFramework,Version=v4.7.2"/>
</startup>

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
15 changes: 6 additions & 9 deletions Ocaramba.Tests.Angular/Ocaramba.Tests.Angular.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,22 @@
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Unix'">net472;net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />

<PackageReference Include="NLog" Version="5.3.4" />


<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit.Runners" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Selenium.Support" Version="4.4.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.4.0" />
<PackageReference Include="Selenium.Support" Version="4.27.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.27.0" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="131.0.6778.8500" />
<PackageReference Include="Selenium.WebDriver.GeckoDriver" Version="0.35.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
<Reference Include="System.Configuration" />
<PackageReference Include="EWSoftware.SHFB" Version="2024.9.12" />
Expand All @@ -32,7 +29,7 @@

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="NLog.Web.AspNetCore" Version="5.3.14" />
<PackageReference Include="NLog.Web.AspNetCore" Version="5.3.15" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Ocaramba.Tests.Angular/Tests/AngularTestNunit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void AngularPageNavigationTest()
.ClickProtractorApi()
.ClickElementToBeSelected();

Assert.True(protractorApiPage.IsElementToBeSelectedHeaderDisplayed(), "Header is not displayed.");
Assert.That(protractorApiPage.IsElementToBeSelectedHeaderDisplayed(), Is.True, "Header is not displayed.");
}
}
}
Loading

0 comments on commit a6369b5

Please sign in to comment.