From d8e789f8644d1a9b63485ad7914acf4f489f3ef9 Mon Sep 17 00:00:00 2001 From: Jakub Raczek Date: Wed, 4 Dec 2024 07:12:43 +0100 Subject: [PATCH] moved scripts to subfolder --- .github/workflows/github-actions.yml | 18 +- Ocaramba.Tests.Angular/App.config | 242 +++++----- .../Ocaramba.Tests.Angular.csproj | 146 +++--- .../Tests/AngularTestNunit.cs | 94 ++-- .../App.config | 360 +++++++------- ...mba.Tests.CloudProviderCrossBrowser.csproj | 142 +++--- .../Tests/HerokuappTestsNUnit.cs | 140 +++--- .../appsettings.Linux.json | 196 ++++---- .../appsettings.json | 196 ++++---- Ocaramba.Tests.Features/App.config | 288 +++++------ .../Ocaramba.Tests.Features.csproj | 156 +++--- Ocaramba.Tests.MsTest/App.config | 254 +++++----- .../Ocaramba.Tests.MsTest.csproj | 164 +++---- Ocaramba.Tests.NUnit/App.config | 296 ++++++------ .../Ocaramba.Tests.NUnit.csproj | 196 ++++---- .../Tests/CompareFilesDataDrivenTests.cs | 198 ++++---- .../Tests/HerokuappTestsDataDrivenNUnit.cs | 220 ++++----- .../Tests/HerokuappTestsNUnit.cs | 452 +++++++++--------- .../Tests/JavaScriptAlertsTestsNUnit.cs | 170 +++---- .../SaveScreenShotsPageSourceTestsNUnit.cs | 148 +++--- .../Tests/SelectWebElementTests.cs | 110 ++--- .../ExtentLogger/ExtentTestLogger.cs | 94 ++-- .../Ocaramba.Tests.NUnitExtentReports.csproj | 190 ++++---- .../PageObject/DragAndDropPage.cs | 114 ++--- .../PageObject/DropdownPage.cs | 140 +++--- .../PageObject/InternetPage.cs | 262 +++++----- .../PageObject/MultipleWindowsPage.cs | 104 ++-- .../PageObject/NestedFramesPage.cs | 170 +++---- .../PageObject/TablesPage.cs | 110 ++--- .../TestExecutionManager.cs | 96 ++-- .../Tests/HerokuappTestsNUnit.cs | 344 ++++++------- .../Tests/SelectWebElementTests.cs | 136 +++--- .../Ocaramba.Tests.PageObjects.csproj | 104 ++-- .../Ocaramba.Tests.Xunit.csproj | 150 +++--- Ocaramba.UnitTests/App.config | 256 +++++----- Ocaramba.UnitTests/Ocaramba.UnitTests.csproj | 148 +++--- Ocaramba.UnitTests/Tests/DateHelperTests.cs | 70 +-- .../Tests/DriversCustomSettingsUnitTests.cs | 110 ++--- Ocaramba.UnitTests/Tests/FilesHelperTests.cs | 168 +++---- .../Tests/LocatorExtensionsTests.cs | 248 +++++----- Ocaramba.UnitTests/Tests/NameHelperTests.cs | 88 ++-- .../Tests/TakingScreehShotsOfElementsTests.cs | 168 +++---- Ocaramba.UnitTests/Tests/WaitHelperTests.cs | 82 ++-- Ocaramba/Ocaramba.csproj | 200 ++++---- OcarambaLite/OcarambaLite.csproj | 168 +++---- README.md | 270 +++++------ .../ExecutingTestsOnDocker.ps1 | 0 .../ExecutingTestsOnDockerAzure.ps1 | 30 +- .../ExecutingTestsOnDockerGithubActions.ps1 | 32 +- .../ExecutingTestsOnLinux.ps1 | 0 .../ExecutingTestsOnLinuxAzure.ps1 | 34 +- ...ExecutingTestsOnLinuxBrowserStackAzure.ps1 | 0 ...gTestsOnLinuxBrowserStackGithubActions.ps1 | 40 +- .../ExecutingTestsOnWindows.ps1 | 0 .../ExecutingTestsOnWindowsAzure1.ps1 | 0 .../ExecutingTestsOnWindowsAzure2.ps1 | 0 .../ExecutingTestsOnWindowsAzure3.ps1 | 0 .../ExecutingTestsOnWindowsAzure4.ps1 | 0 .../ExecutingTestsOnWindowsAzure5.ps1 | 0 .../ExecutingTestsOnWindowsAzure6.ps1 | 0 .../ExecutingTestsOnWindowsGithubActions1.ps1 | 0 .../ExecutingTestsOnWindowsGithubActions2.ps1 | 0 .../ExecutingTestsOnWindowsGithubActions3.ps1 | 0 .../ExecutingTestsOnWindowsGithubActions4.ps1 | 0 .../ExecutingTestsOnWindowsGithubActions5.ps1 | 0 .../ExecutingTestsOnWindowsGithubActions6.ps1 | 0 .../PublishingApiDocumentationOn_gh-pages.ps1 | 0 .../removeSubprojectFromSolution.ps1 | 0 68 files changed, 4156 insertions(+), 4156 deletions(-) rename ExecutingTestsOnDocker.ps1 => scripts/ExecutingTestsOnDocker.ps1 (100%) rename ExecutingTestsOnDockerAzure.ps1 => scripts/ExecutingTestsOnDockerAzure.ps1 (98%) rename ExecutingTestsOnDockerGithubActions.ps1 => scripts/ExecutingTestsOnDockerGithubActions.ps1 (98%) rename ExecutingTestsOnLinux.ps1 => scripts/ExecutingTestsOnLinux.ps1 (100%) rename ExecutingTestsOnLinuxAzure.ps1 => scripts/ExecutingTestsOnLinuxAzure.ps1 (97%) rename ExecutingTestsOnLinuxBrowserStackAzure.ps1 => scripts/ExecutingTestsOnLinuxBrowserStackAzure.ps1 (100%) rename ExecutingTestsOnLinuxBrowserStackGithubActions.ps1 => scripts/ExecutingTestsOnLinuxBrowserStackGithubActions.ps1 (98%) rename ExecutingTestsOnWindows.ps1 => scripts/ExecutingTestsOnWindows.ps1 (100%) rename ExecutingTestsOnWindowsAzure1.ps1 => scripts/ExecutingTestsOnWindowsAzure1.ps1 (100%) rename ExecutingTestsOnWindowsAzure2.ps1 => scripts/ExecutingTestsOnWindowsAzure2.ps1 (100%) rename ExecutingTestsOnWindowsAzure3.ps1 => scripts/ExecutingTestsOnWindowsAzure3.ps1 (100%) rename ExecutingTestsOnWindowsAzure4.ps1 => scripts/ExecutingTestsOnWindowsAzure4.ps1 (100%) rename ExecutingTestsOnWindowsAzure5.ps1 => scripts/ExecutingTestsOnWindowsAzure5.ps1 (100%) rename ExecutingTestsOnWindowsAzure6.ps1 => scripts/ExecutingTestsOnWindowsAzure6.ps1 (100%) rename ExecutingTestsOnWindowsGithubActions1.ps1 => scripts/ExecutingTestsOnWindowsGithubActions1.ps1 (100%) rename ExecutingTestsOnWindowsGithubActions2.ps1 => scripts/ExecutingTestsOnWindowsGithubActions2.ps1 (100%) rename ExecutingTestsOnWindowsGithubActions3.ps1 => scripts/ExecutingTestsOnWindowsGithubActions3.ps1 (100%) rename ExecutingTestsOnWindowsGithubActions4.ps1 => scripts/ExecutingTestsOnWindowsGithubActions4.ps1 (100%) rename ExecutingTestsOnWindowsGithubActions5.ps1 => scripts/ExecutingTestsOnWindowsGithubActions5.ps1 (100%) rename ExecutingTestsOnWindowsGithubActions6.ps1 => scripts/ExecutingTestsOnWindowsGithubActions6.ps1 (100%) rename PublishingApiDocumentationOn_gh-pages.ps1 => scripts/PublishingApiDocumentationOn_gh-pages.ps1 (100%) rename removeSubprojectFromSolution.ps1 => scripts/removeSubprojectFromSolution.ps1 (100%) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index ed05414d8..657b9df98 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -118,7 +118,7 @@ jobs: sudo apt-get install docker-compose -y - run: docker-compose -f docker-compose.yml up -d - shell: pwsh - run: ./ExecutingTestsOnDockerGithubActions.ps1 + run: ./scripts/ExecutingTestsOnDockerGithubActions.ps1 if: true - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action/linux@v2 @@ -143,7 +143,7 @@ jobs: sed -i '/Documentation/,+5 d' ./Ocaramba.sln - run: dotnet build ./Ocaramba.sln --configuration ${{ env.buildConfiguration }} - shell: pwsh - run: ./ExecutingTestsOnLinuxAzure.ps1 + run: ./scripts/ExecutingTestsOnLinuxAzure.ps1 - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action/linux@v2 if: true @@ -184,7 +184,7 @@ jobs: MAPPED_ENV_TESTINGBOTSECRET: ${{ secrets.testingbotsecret }} MAPPED_ENV_SAUCELABSACCESSKEY: ${{ secrets.saucelabsaccessKey }} MAPPED_ENV_SAUCELABSUSERNAME: ${{ secrets.saucelabsusername }} - run: ./ExecutingTestsOnLinuxBrowserStackGithubActions.ps1 + run: ./scripts/ExecutingTestsOnLinuxBrowserStackGithubActions.ps1 - name: 'Start BrowserStackLocal Tunnel' uses: 'browserstack/github-actions/setup-local@master' with: @@ -211,7 +211,7 @@ jobs: with: name: OcarambaBuild - run: Expand-Archive -Path OcarambaBuild.zip -DestinationPath ./ - - run: ./ExecutingTestsOnWindowsGithubActions1.ps1 + - run: ./scripts/ExecutingTestsOnWindowsGithubActions1.ps1 - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action/windows@v2 if: always() @@ -238,7 +238,7 @@ jobs: with: name: OcarambaBuild - run: Expand-Archive -Path OcarambaBuild.zip -DestinationPath ./ - - run: ./ExecutingTestsOnWindowsGithubActions2.ps1 + - run: ./scripts/ExecutingTestsOnWindowsGithubActions2.ps1 - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action/windows@v2 if: always() @@ -259,7 +259,7 @@ jobs: with: name: OcarambaBuild - run: Expand-Archive -Path OcarambaBuild.zip -DestinationPath ./ - - run: ./ExecutingTestsOnWindowsGithubActions3.ps1 + - run: ./scripts/ExecutingTestsOnWindowsGithubActions3.ps1 - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action/windows@v2 if: always() @@ -279,7 +279,7 @@ jobs: with: name: OcarambaBuild - run: Expand-Archive -Path OcarambaBuild.zip -DestinationPath ./ - - run: ./ExecutingTestsOnWindowsGithubActions4.ps1 + - run: ./scripts/ExecutingTestsOnWindowsGithubActions4.ps1 env: MAPPED_ENV_BROWSERSTACKKEY: ${{ secrets.BROWSERSTACKKEY }} MAPPED_ENV_BROWSERSTACKUSER: ${{ secrets.BROWSERSTACKUSER }} @@ -306,7 +306,7 @@ jobs: with: name: OcarambaBuild - run: Expand-Archive -Path OcarambaBuild.zip -DestinationPath ./ - - run: ./ExecutingTestsOnWindowsGithubActions5.ps1 + - run: ./scripts/ExecutingTestsOnWindowsGithubActions5.ps1 - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action/windows@v2 if: always() @@ -327,7 +327,7 @@ jobs: with: name: OcarambaBuild - run: Expand-Archive -Path OcarambaBuild.zip -DestinationPath ./ - - run: ./ExecutingTestsOnWindowsGithubActions6.ps1 + - run: ./scripts/ExecutingTestsOnWindowsGithubActions6.ps1 env: MAPPED_ENV_BROWSERSTACKKEY: ${{ secrets.BROWSERSTACKKEY }} MAPPED_ENV_BROWSERSTACKUSER: ${{ secrets.BROWSERSTACKUSER }} diff --git a/Ocaramba.Tests.Angular/App.config b/Ocaramba.Tests.Angular/App.config index fdf899b37..bdd373d53 100644 --- a/Ocaramba.Tests.Angular/App.config +++ b/Ocaramba.Tests.Angular/App.config @@ -1,122 +1,122 @@ - - - -
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - add key="FirefoxPluginName.xpi" value=""/--> - - - - - - add key="ChromePluginName.crx" value=""/--> - - - add key="CapabilityName" value=""/--> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + +
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + add key="FirefoxPluginName.xpi" value=""/--> + + + + + + add key="ChromePluginName.crx" value=""/--> + + + add key="CapabilityName" value=""/--> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Ocaramba.Tests.Angular/Ocaramba.Tests.Angular.csproj b/Ocaramba.Tests.Angular/Ocaramba.Tests.Angular.csproj index 196ae8ad5..538ea95c1 100644 --- a/Ocaramba.Tests.Angular/Ocaramba.Tests.Angular.csproj +++ b/Ocaramba.Tests.Angular/Ocaramba.Tests.Angular.csproj @@ -1,73 +1,73 @@ - - - - net8.0 - net472;net8.0 - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - - - - - - - - - - - - Never - - - Always - - - Always - - - Always - - - - - net8_0 - - - - net47 - - - - ..\Ocaramba\fxcop-sonarqube.tests.ruleset - - - - ..\Ocaramba\fxcop-sonarqube.tests.ruleset - - - true - - + + + + net8.0 + net472;net8.0 + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + + + + + + + + Never + + + Always + + + Always + + + Always + + + + + net8_0 + + + + net47 + + + + ..\Ocaramba\fxcop-sonarqube.tests.ruleset + + + + ..\Ocaramba\fxcop-sonarqube.tests.ruleset + + + true + + diff --git a/Ocaramba.Tests.Angular/Tests/AngularTestNunit.cs b/Ocaramba.Tests.Angular/Tests/AngularTestNunit.cs index d3ac7d184..a1d7b5e42 100644 --- a/Ocaramba.Tests.Angular/Tests/AngularTestNunit.cs +++ b/Ocaramba.Tests.Angular/Tests/AngularTestNunit.cs @@ -1,47 +1,47 @@ -// -// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. -// -// -// The MIT License (MIT) -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// - -using NUnit.Framework; - -namespace Ocaramba.Tests.Angular.Tests -{ - using Ocaramba.Tests.Angular.PageObjects; - - [TestFixture] - [Parallelizable(ParallelScope.Fixtures)] - public class AngularTestNunit : ProjectTestBase - { - [Test] - public void AngularPageNavigationTest() - { - var protractorApiPage = new ProtractorHomePage(this.DriverContext) - .OpenProtractorHomePage() - .ClickQuickStart() - .ClickTutorial() - .ClickTableOfContents() - .ClickProtractorApi() - .ClickElementToBeSelected(); - - Assert.That(protractorApiPage.IsElementToBeSelectedHeaderDisplayed(), Is.True, "Header is not displayed."); - } - } -} +// +// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. +// +// +// The MIT License (MIT) +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// + +using NUnit.Framework; + +namespace Ocaramba.Tests.Angular.Tests +{ + using Ocaramba.Tests.Angular.PageObjects; + + [TestFixture] + [Parallelizable(ParallelScope.Fixtures)] + public class AngularTestNunit : ProjectTestBase + { + [Test] + public void AngularPageNavigationTest() + { + var protractorApiPage = new ProtractorHomePage(this.DriverContext) + .OpenProtractorHomePage() + .ClickQuickStart() + .ClickTutorial() + .ClickTableOfContents() + .ClickProtractorApi() + .ClickElementToBeSelected(); + + Assert.That(protractorApiPage.IsElementToBeSelectedHeaderDisplayed(), Is.True, "Header is not displayed."); + } + } +} diff --git a/Ocaramba.Tests.CloudProviderCrossBrowser/App.config b/Ocaramba.Tests.CloudProviderCrossBrowser/App.config index 70ccef9bb..14e202c5a 100644 --- a/Ocaramba.Tests.CloudProviderCrossBrowser/App.config +++ b/Ocaramba.Tests.CloudProviderCrossBrowser/App.config @@ -1,180 +1,180 @@ - - - -
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - add key="FirefoxPluginName.xpi" value=""/--> - - - - - - - - - add key="ChromePluginName.crx" value=""/--> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + +
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + add key="FirefoxPluginName.xpi" value=""/--> + + + + + + + + + add key="ChromePluginName.crx" value=""/--> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ocaramba.Tests.CloudProviderCrossBrowser/Ocaramba.Tests.CloudProviderCrossBrowser.csproj b/Ocaramba.Tests.CloudProviderCrossBrowser/Ocaramba.Tests.CloudProviderCrossBrowser.csproj index ca02e6617..2a69a1d57 100644 --- a/Ocaramba.Tests.CloudProviderCrossBrowser/Ocaramba.Tests.CloudProviderCrossBrowser.csproj +++ b/Ocaramba.Tests.CloudProviderCrossBrowser/Ocaramba.Tests.CloudProviderCrossBrowser.csproj @@ -1,71 +1,71 @@ - - - - net8.0 - net472;net8.0 - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - - - - - - - - - - - - - Always - - - Always - - - Always - - - - - net8_0 - - - - net47 - - - - ..\Ocaramba\fxcop-sonarqube.tests.ruleset - - - - ..\Ocaramba\fxcop-sonarqube.tests.ruleset - - - true - - + + + + net8.0 + net472;net8.0 + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + + + + + + + + + Always + + + Always + + + Always + + + + + net8_0 + + + + net47 + + + + ..\Ocaramba\fxcop-sonarqube.tests.ruleset + + + + ..\Ocaramba\fxcop-sonarqube.tests.ruleset + + + true + + diff --git a/Ocaramba.Tests.CloudProviderCrossBrowser/Tests/HerokuappTestsNUnit.cs b/Ocaramba.Tests.CloudProviderCrossBrowser/Tests/HerokuappTestsNUnit.cs index 2bcec6b14..8403c70d1 100644 --- a/Ocaramba.Tests.CloudProviderCrossBrowser/Tests/HerokuappTestsNUnit.cs +++ b/Ocaramba.Tests.CloudProviderCrossBrowser/Tests/HerokuappTestsNUnit.cs @@ -1,70 +1,70 @@ -// -// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. -// -// -// The MIT License (MIT) -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// - -using System; - -namespace Ocaramba.Tests.CloudProviderCrossBrowser.Tests -{ - using global::NUnit.Framework; - using Ocaramba; - using Ocaramba.Tests.PageObjects.PageObjects.TheInternet; - - [TestFixture("ChromeWindows")] - [TestFixture("Android")] - [TestFixture("Iphone")] - [TestFixture("FirefoxWindows")] - [TestFixture("SafariMac")] - [TestFixture("EdgeChromiumWindows")] - [TestFixture("IEWindows")] - [Parallelizable(ParallelScope.Fixtures)] - public class HerokuappTestsNUnit : ProjectTestBase - { - public HerokuappTestsNUnit(string environment) - : base(environment) - { - } - - [Test] - public void TablesTest() - { - var tableElements = new InternetPage(this.DriverContext) - .OpenHomePage() - .GoToTablesPage(); - var table = tableElements.GetTableElements(); - - Assert.That(table[0][0], Is.EqualTo("Smith")); - Assert.That(table[3][5].Trim().Replace("\r", String.Empty).Replace(" ", String.Empty).Replace("\n", String.Empty), Is.EqualTo("edit delete")); - } - - [Test] - public void DynamicallyLoadedPageElementsTest() - { - var page = new InternetPage(this.DriverContext) - .OpenHomePage() - .GoToDynamicLoading() - .ClickOnExample2(); - - page.ClickStart(); - Assert.That(page.Text, Is.EqualTo("Hello World!")); - } - } -} +// +// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. +// +// +// The MIT License (MIT) +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// + +using System; + +namespace Ocaramba.Tests.CloudProviderCrossBrowser.Tests +{ + using global::NUnit.Framework; + using Ocaramba; + using Ocaramba.Tests.PageObjects.PageObjects.TheInternet; + + [TestFixture("ChromeWindows")] + [TestFixture("Android")] + [TestFixture("Iphone")] + [TestFixture("FirefoxWindows")] + [TestFixture("SafariMac")] + [TestFixture("EdgeChromiumWindows")] + [TestFixture("IEWindows")] + [Parallelizable(ParallelScope.Fixtures)] + public class HerokuappTestsNUnit : ProjectTestBase + { + public HerokuappTestsNUnit(string environment) + : base(environment) + { + } + + [Test] + public void TablesTest() + { + var tableElements = new InternetPage(this.DriverContext) + .OpenHomePage() + .GoToTablesPage(); + var table = tableElements.GetTableElements(); + + Assert.That(table[0][0], Is.EqualTo("Smith")); + Assert.That(table[3][5].Trim().Replace("\r", String.Empty).Replace(" ", String.Empty).Replace("\n", String.Empty), Is.EqualTo("edit delete")); + } + + [Test] + public void DynamicallyLoadedPageElementsTest() + { + var page = new InternetPage(this.DriverContext) + .OpenHomePage() + .GoToDynamicLoading() + .ClickOnExample2(); + + page.ClickStart(); + Assert.That(page.Text, Is.EqualTo("Hello World!")); + } + } +} diff --git a/Ocaramba.Tests.CloudProviderCrossBrowser/appsettings.Linux.json b/Ocaramba.Tests.CloudProviderCrossBrowser/appsettings.Linux.json index e04b17d52..8fe2000fe 100644 --- a/Ocaramba.Tests.CloudProviderCrossBrowser/appsettings.Linux.json +++ b/Ocaramba.Tests.CloudProviderCrossBrowser/appsettings.Linux.json @@ -1,98 +1,98 @@ -{ - "appSettings": { - "protocol": "http", - "host": "the-internet.herokuapp.com", - "browser": "RemoteWebDriver", - "url": "", - "PathToChromeDriverDirectory": "", - "PathToFirefoxDriverDirectory": "", - "PathToInternetExplorerDriverDirectory": "", - "ChromeBrowserExecutableLocation": "", - "FireFoxBrowserExecutableLocation": "", - "FirefoxUseLegacyImplementation": "false", - "PathToFirefoxProfile": "", - "RemoteWebDriverHub": "http://localhost:4444/wd/hub", - "DriverCapabilities": "CloudProvider", - "longTimeout": "30", - "mediumTimeout": "10", - "shortTimeout": "3", - "ImplicitlyWaitMilliseconds": "200", - "username": "admin", - "password": "admin", - "UseCurrentDirectory": "true", - "DownloadFolder": "TestOutput", - "ScreenShotFolder": "TestOutput", - "PageSourceFolder": "TestOutput", - "FullDesktopScreenShotEnabled": "true", - "SeleniumScreenShotEnabled": "true", - "GetPageSourceEnabled": "true", - "JavaScriptErrorLogging": "false", - "JavaScriptErrorTypes": "SyntaxError,EvalError,ReferenceError,RangeError,TypeError,URIError,Refused to display,Internal Server Error,Cannot read property", - "EnableEventFiringWebDriver": "false", - "DataDrivenFile": "DataDriven\\DataDriven.xml", - "DataDrivenFileXlsx": "DataDriven\\DataDriven.xlsx" - }, - "FirefoxPreferences": { - }, - "FirefoxExtensions": { - }, - "FirefoxArguments": { - }, - "ChromePreferences": { - }, - "ChromeExtensions": { - }, - "DriverCapabilities": { - "projectName": "Ocaramba", - "debug": "true", - "buildName": "Ocaramba.Tests.CloudProviderCrossBrowser", - "networkLogs": "true", - "local": "false" - }, - "ChromeArguments": { - }, - "InternetExplorerPreferences": { - }, - "environments": { - "ChromeWindows": { - "browser": "Chrome", - "os": "Windows", - "osVersion": "11", - "sessionName": "parallel_test" - }, - "SafariMac": { - "os": "OS X", - "osVersion": "Monterey", - "sessionName": "parallel_test" - }, - "EdgeChromiumWindows": { - "browser": "Edge", - "os": "Windows", - "osVersion": "11", - "sessionName": "parallel_test" - }, - "IEWindows": { - "browser": "IE", - "os": "Windows", - "osVersion": "10", - "sessionName": "parallel_test" - }, - "Android": { - "browser": "samsung", - "deviceName": "Samsung Galaxy S23 Ultra", - "realMobile": "true", - "sessionName": "parallel_test" - }, - "Iphone": { - "deviceName": "iPhone 13", - "realMobile": "true", - "sessionName": "parallel_test" - }, - "FirefoxWindows": { - "browser": "firefox", - "os": "Windows", - "osVersion": "10", - "sessionName": "parallel_test" - } - } -} +{ + "appSettings": { + "protocol": "http", + "host": "the-internet.herokuapp.com", + "browser": "RemoteWebDriver", + "url": "", + "PathToChromeDriverDirectory": "", + "PathToFirefoxDriverDirectory": "", + "PathToInternetExplorerDriverDirectory": "", + "ChromeBrowserExecutableLocation": "", + "FireFoxBrowserExecutableLocation": "", + "FirefoxUseLegacyImplementation": "false", + "PathToFirefoxProfile": "", + "RemoteWebDriverHub": "http://localhost:4444/wd/hub", + "DriverCapabilities": "CloudProvider", + "longTimeout": "30", + "mediumTimeout": "10", + "shortTimeout": "3", + "ImplicitlyWaitMilliseconds": "200", + "username": "admin", + "password": "admin", + "UseCurrentDirectory": "true", + "DownloadFolder": "TestOutput", + "ScreenShotFolder": "TestOutput", + "PageSourceFolder": "TestOutput", + "FullDesktopScreenShotEnabled": "true", + "SeleniumScreenShotEnabled": "true", + "GetPageSourceEnabled": "true", + "JavaScriptErrorLogging": "false", + "JavaScriptErrorTypes": "SyntaxError,EvalError,ReferenceError,RangeError,TypeError,URIError,Refused to display,Internal Server Error,Cannot read property", + "EnableEventFiringWebDriver": "false", + "DataDrivenFile": "DataDriven\\DataDriven.xml", + "DataDrivenFileXlsx": "DataDriven\\DataDriven.xlsx" + }, + "FirefoxPreferences": { + }, + "FirefoxExtensions": { + }, + "FirefoxArguments": { + }, + "ChromePreferences": { + }, + "ChromeExtensions": { + }, + "DriverCapabilities": { + "projectName": "Ocaramba", + "debug": "true", + "buildName": "Ocaramba.Tests.CloudProviderCrossBrowser", + "networkLogs": "true", + "local": "false" + }, + "ChromeArguments": { + }, + "InternetExplorerPreferences": { + }, + "environments": { + "ChromeWindows": { + "browser": "Chrome", + "os": "Windows", + "osVersion": "11", + "sessionName": "parallel_test" + }, + "SafariMac": { + "os": "OS X", + "osVersion": "Monterey", + "sessionName": "parallel_test" + }, + "EdgeChromiumWindows": { + "browser": "Edge", + "os": "Windows", + "osVersion": "11", + "sessionName": "parallel_test" + }, + "IEWindows": { + "browser": "IE", + "os": "Windows", + "osVersion": "10", + "sessionName": "parallel_test" + }, + "Android": { + "browser": "samsung", + "deviceName": "Samsung Galaxy S23 Ultra", + "realMobile": "true", + "sessionName": "parallel_test" + }, + "Iphone": { + "deviceName": "iPhone 13", + "realMobile": "true", + "sessionName": "parallel_test" + }, + "FirefoxWindows": { + "browser": "firefox", + "os": "Windows", + "osVersion": "10", + "sessionName": "parallel_test" + } + } +} diff --git a/Ocaramba.Tests.CloudProviderCrossBrowser/appsettings.json b/Ocaramba.Tests.CloudProviderCrossBrowser/appsettings.json index 2ce9febcc..f72eb7c9e 100644 --- a/Ocaramba.Tests.CloudProviderCrossBrowser/appsettings.json +++ b/Ocaramba.Tests.CloudProviderCrossBrowser/appsettings.json @@ -1,98 +1,98 @@ -{ - "appSettings": { - "protocol": "http", - "host": "the-internet.herokuapp.com", - "browser": "RemoteWebDriver", - "url": "", - "PathToChromeDriverDirectory": "", - "PathToFirefoxDriverDirectory": "", - "PathToInternetExplorerDriverDirectory": "", - "ChromeBrowserExecutableLocation": "", - "FireFoxBrowserExecutableLocation": "", - "FirefoxUseLegacyImplementation": "false", - "PathToFirefoxProfile": "", - "RemoteWebDriverHub": "http://localhost:4444/wd/hub", - "DriverCapabilities": "CloudProvider", - "longTimeout": "30", - "mediumTimeout": "10", - "shortTimeout": "3", - "ImplicitlyWaitMilliseconds": "200", - "username": "admin", - "password": "admin", - "UseCurrentDirectory": "true", - "DownloadFolder": "TestOutput", - "ScreenShotFolder": "TestOutput", - "PageSourceFolder": "TestOutput", - "FullDesktopScreenShotEnabled": "true", - "SeleniumScreenShotEnabled": "true", - "GetPageSourceEnabled": "true", - "JavaScriptErrorLogging": "false", - "JavaScriptErrorTypes": "SyntaxError,EvalError,ReferenceError,RangeError,TypeError,URIError,Refused to display,Internal Server Error,Cannot read property", - "EnableEventFiringWebDriver": "false", - "DataDrivenFile": "DataDriven\\DataDriven.xml", - "DataDrivenFileXlsx": "DataDriven\\DataDriven.xlsx" - }, - "FirefoxPreferences": { - }, - "FirefoxExtensions": { - }, - "FirefoxArguments": { - }, - "ChromePreferences": { - }, - "ChromeExtensions": { - }, - "DriverCapabilities": { - "projectName": "Ocaramba", - "debug": "true", - "buildName": "Ocaramba.Tests.CloudProviderCrossBrowser", - "networkLogs": "true", - "local": "false" - }, - "ChromeArguments": { - }, - "InternetExplorerPreferences": { - }, - "environments": { - "ChromeWindows": { - "browser": "Chrome", - "os": "Windows", - "osVersion": "11", - "sessionName": "parallel_test" - }, - "SafariMac": { - "os": "OS X", - "osVersion": "Monterey", - "sessionName": "parallel_test" - }, - "EdgeChromiumWindows": { - "browser": "Edge", - "os": "Windows", - "osVersion": "11", - "sessionName": "parallel_test" - }, - "IEWindows": { - "browser": "IE", - "os": "Windows", - "osVersion": "10", - "sessionName": "parallel_test" - }, - "Android": { - "browser": "samsung", - "deviceName": "Samsung Galaxy S23 Ultra", - "realMobile": "true", - "sessionName": "parallel_test" - }, - "Iphone": { - "deviceName": "iPhone 13", - "realMobile": "true", - "sessionName": "parallel_test" - }, - "FirefoxWindows": { - "browser": "firefox", - "os": "Windows", - "osVersion": "10", - "sessionName": "parallel_test" - } - } -} +{ + "appSettings": { + "protocol": "http", + "host": "the-internet.herokuapp.com", + "browser": "RemoteWebDriver", + "url": "", + "PathToChromeDriverDirectory": "", + "PathToFirefoxDriverDirectory": "", + "PathToInternetExplorerDriverDirectory": "", + "ChromeBrowserExecutableLocation": "", + "FireFoxBrowserExecutableLocation": "", + "FirefoxUseLegacyImplementation": "false", + "PathToFirefoxProfile": "", + "RemoteWebDriverHub": "http://localhost:4444/wd/hub", + "DriverCapabilities": "CloudProvider", + "longTimeout": "30", + "mediumTimeout": "10", + "shortTimeout": "3", + "ImplicitlyWaitMilliseconds": "200", + "username": "admin", + "password": "admin", + "UseCurrentDirectory": "true", + "DownloadFolder": "TestOutput", + "ScreenShotFolder": "TestOutput", + "PageSourceFolder": "TestOutput", + "FullDesktopScreenShotEnabled": "true", + "SeleniumScreenShotEnabled": "true", + "GetPageSourceEnabled": "true", + "JavaScriptErrorLogging": "false", + "JavaScriptErrorTypes": "SyntaxError,EvalError,ReferenceError,RangeError,TypeError,URIError,Refused to display,Internal Server Error,Cannot read property", + "EnableEventFiringWebDriver": "false", + "DataDrivenFile": "DataDriven\\DataDriven.xml", + "DataDrivenFileXlsx": "DataDriven\\DataDriven.xlsx" + }, + "FirefoxPreferences": { + }, + "FirefoxExtensions": { + }, + "FirefoxArguments": { + }, + "ChromePreferences": { + }, + "ChromeExtensions": { + }, + "DriverCapabilities": { + "projectName": "Ocaramba", + "debug": "true", + "buildName": "Ocaramba.Tests.CloudProviderCrossBrowser", + "networkLogs": "true", + "local": "false" + }, + "ChromeArguments": { + }, + "InternetExplorerPreferences": { + }, + "environments": { + "ChromeWindows": { + "browser": "Chrome", + "os": "Windows", + "osVersion": "11", + "sessionName": "parallel_test" + }, + "SafariMac": { + "os": "OS X", + "osVersion": "Monterey", + "sessionName": "parallel_test" + }, + "EdgeChromiumWindows": { + "browser": "Edge", + "os": "Windows", + "osVersion": "11", + "sessionName": "parallel_test" + }, + "IEWindows": { + "browser": "IE", + "os": "Windows", + "osVersion": "10", + "sessionName": "parallel_test" + }, + "Android": { + "browser": "samsung", + "deviceName": "Samsung Galaxy S23 Ultra", + "realMobile": "true", + "sessionName": "parallel_test" + }, + "Iphone": { + "deviceName": "iPhone 13", + "realMobile": "true", + "sessionName": "parallel_test" + }, + "FirefoxWindows": { + "browser": "firefox", + "os": "Windows", + "osVersion": "10", + "sessionName": "parallel_test" + } + } +} diff --git a/Ocaramba.Tests.Features/App.config b/Ocaramba.Tests.Features/App.config index 186f1dae0..960edf865 100644 --- a/Ocaramba.Tests.Features/App.config +++ b/Ocaramba.Tests.Features/App.config @@ -1,145 +1,145 @@ - - - -
-
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - add key="FirefoxPluginName.xpi" value=""/--> - - - - - - - - - add key="ChromePluginName.crx" value=""/--> - - - add key="CapabilityName" value=""/--> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + +
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + add key="FirefoxPluginName.xpi" value=""/--> + + + + + + + + + add key="ChromePluginName.crx" value=""/--> + + + add key="CapabilityName" value=""/--> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Ocaramba.Tests.Features/Ocaramba.Tests.Features.csproj b/Ocaramba.Tests.Features/Ocaramba.Tests.Features.csproj index 81063ef97..82e5bf412 100644 --- a/Ocaramba.Tests.Features/Ocaramba.Tests.Features.csproj +++ b/Ocaramba.Tests.Features/Ocaramba.Tests.Features.csproj @@ -1,78 +1,78 @@ - - - - net8.0 - net472;net8.0 - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - - - - - - - - - - - - Always - - - Always - - - Always - - - - - - - - - - - net8_0 - - - - net47 - - - - ..\Ocaramba\fxcop-sonarqube.tests.ruleset - - - - ..\Ocaramba\fxcop-sonarqube.tests.ruleset - - - true - - + + + + net8.0 + net472;net8.0 + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + + + + + + + + Always + + + Always + + + Always + + + + + + + + + + + net8_0 + + + + net47 + + + + ..\Ocaramba\fxcop-sonarqube.tests.ruleset + + + + ..\Ocaramba\fxcop-sonarqube.tests.ruleset + + + true + + diff --git a/Ocaramba.Tests.MsTest/App.config b/Ocaramba.Tests.MsTest/App.config index 1ef8e73b5..eebd33a06 100644 --- a/Ocaramba.Tests.MsTest/App.config +++ b/Ocaramba.Tests.MsTest/App.config @@ -1,128 +1,128 @@ - - - -
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - add key="FirefoxPluginName.xpi" value=""/--> - - - - - - - - - add key="ChromePluginName.crx" value=""/--> - - - add key="CapabilityName" value=""/--> - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + +
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + add key="FirefoxPluginName.xpi" value=""/--> + + + + + + + + + add key="ChromePluginName.crx" value=""/--> + + + add key="CapabilityName" value=""/--> + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Ocaramba.Tests.MsTest/Ocaramba.Tests.MsTest.csproj b/Ocaramba.Tests.MsTest/Ocaramba.Tests.MsTest.csproj index 2442062e0..37620f526 100644 --- a/Ocaramba.Tests.MsTest/Ocaramba.Tests.MsTest.csproj +++ b/Ocaramba.Tests.MsTest/Ocaramba.Tests.MsTest.csproj @@ -1,82 +1,82 @@ - - - - net8.0 - net472;net8.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - - - - - - - net8_0 - - - - net47 - - - - ..\Ocaramba\fxcop-sonarqube.tests.ruleset - - - - ..\Ocaramba\fxcop-sonarqube.tests.ruleset - - - true - - + + + + net8.0 + net472;net8.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + + + + + + + net8_0 + + + + net47 + + + + ..\Ocaramba\fxcop-sonarqube.tests.ruleset + + + + ..\Ocaramba\fxcop-sonarqube.tests.ruleset + + + true + + diff --git a/Ocaramba.Tests.NUnit/App.config b/Ocaramba.Tests.NUnit/App.config index 1bf5943bc..9dd3296cd 100644 --- a/Ocaramba.Tests.NUnit/App.config +++ b/Ocaramba.Tests.NUnit/App.config @@ -1,148 +1,148 @@ - - - -
-
-
-
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - add key="FirefoxPluginName.xpi" value=""/--> - - - - - - - - - add key="ChromePluginName.crx" value=""/--> - - - - - - - - - - - - - - - - - add key="FirefoxPluginName.xpi" value=""/--> - - - - - - - - - - - - - - - - - - - - - - - + + + +
+
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + add key="FirefoxPluginName.xpi" value=""/--> + + + + + + + + + add key="ChromePluginName.crx" value=""/--> + + + + + + + + + + + + + + + + + add key="FirefoxPluginName.xpi" value=""/--> + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ocaramba.Tests.NUnit/Ocaramba.Tests.NUnit.csproj b/Ocaramba.Tests.NUnit/Ocaramba.Tests.NUnit.csproj index 540d64de6..c733abbcb 100644 --- a/Ocaramba.Tests.NUnit/Ocaramba.Tests.NUnit.csproj +++ b/Ocaramba.Tests.NUnit/Ocaramba.Tests.NUnit.csproj @@ -1,98 +1,98 @@ - - - - net8.0 - net472;net8.0 - - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - 2.2.0 - - - - - - - - - - - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - - - net8_0 - - - - net47 - - - - ..\Ocaramba\fxcop-sonarqube.tests.ruleset - - - - ..\Ocaramba\fxcop-sonarqube.tests.ruleset - - - true - - + + + + net8.0 + net472;net8.0 + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + 2.2.0 + + + + + + + + + + + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + + + net8_0 + + + + net47 + + + + ..\Ocaramba\fxcop-sonarqube.tests.ruleset + + + + ..\Ocaramba\fxcop-sonarqube.tests.ruleset + + + true + + diff --git a/Ocaramba.Tests.NUnit/Tests/CompareFilesDataDrivenTests.cs b/Ocaramba.Tests.NUnit/Tests/CompareFilesDataDrivenTests.cs index 86f859ae9..a4aa70311 100644 --- a/Ocaramba.Tests.NUnit/Tests/CompareFilesDataDrivenTests.cs +++ b/Ocaramba.Tests.NUnit/Tests/CompareFilesDataDrivenTests.cs @@ -1,99 +1,99 @@ -// -// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. -// -// -// The MIT License (MIT) -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// - -using NLog; - -namespace Ocaramba.Tests.NUnit.Tests -{ - using System.IO; - using global::NUnit.Framework; - using Ocaramba.Tests.NUnit.DataDriven; - - [TestFixture] - public class CompareFilesDataDrivenTests - { -#if net47 - private readonly NLog.Logger logger = LogManager.GetCurrentClassLogger(); -#endif -#if net8_0 - private readonly NLog.Logger logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); -#endif - - private readonly char separator = Path.DirectorySeparatorChar; - - /// - /// Compares the CSV files, find files to compare by DataDriven methods from NUnit. - /// Execute that tests after UploadDownloadFilesTestsNUnit TestFeature - /// - /// The live files. - /// The test files. - [Test] - [Category("CompareFiles")] - [TestCaseSource(typeof(CompareFiles), "GetCsvFileToCompare")] - public void CompareCsvFiles(string liveFiles, string testFiles) - { - var folder = ProjectBaseConfiguration.DownloadFolderPath; - if (!File.Exists(folder + this.separator + testFiles)) - { - this.logger.Info(ProjectBaseConfiguration.DownloadFolderPath + liveFiles); - this.logger.Error("Missing file:\n{0}{1}", folder, testFiles); - Assert.That(false, Is.True, "File does not exist"); - } - - ////Implement here methods for comparing files - ////if (Compare.Files(ProjectBaseConfiguration.DownloadFolderPath + this.separator, testFiles, liveFiles)) - ////{ - //// Assert.That(false, Is.True,"Files are different"); - ////} - - this.logger.Info("Files are identical"); - } - - /// - /// Compares the TXT files, find files to compare by DataDriven methods from NUnit. - /// Execute that tests after UploadDownloadFilesTestsNUnit TestFeature - /// - /// The live files. - /// The test files. - [Test] - [Category("CompareFiles")] - [TestCaseSource(typeof(CompareFiles), "GetTxtFileToCompare")] - public void CompareTxtFiles(string liveFiles, string testFiles) - { - var folder = ProjectBaseConfiguration.DownloadFolderPath; - if (!File.Exists(folder + this.separator + testFiles)) - { - this.logger.Info(ProjectBaseConfiguration.DownloadFolderPath + liveFiles); - this.logger.Error("Missing file:\n{0}{1}", folder, testFiles); - // Assert.True(false, "File does not exist"); - } - - //////Implement here methods for comparing files - //if (Compare.Files(ProjectBaseConfiguration.DownloadFolderPath + this.separator, testFiles, liveFiles)) - //{ - // Assert.That(false, Is.True, "Files are different"); - //} - - this.logger.Info("Files are identical"); - } - } -} +// +// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. +// +// +// The MIT License (MIT) +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// + +using NLog; + +namespace Ocaramba.Tests.NUnit.Tests +{ + using System.IO; + using global::NUnit.Framework; + using Ocaramba.Tests.NUnit.DataDriven; + + [TestFixture] + public class CompareFilesDataDrivenTests + { +#if net47 + private readonly NLog.Logger logger = LogManager.GetCurrentClassLogger(); +#endif +#if net8_0 + private readonly NLog.Logger logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); +#endif + + private readonly char separator = Path.DirectorySeparatorChar; + + /// + /// Compares the CSV files, find files to compare by DataDriven methods from NUnit. + /// Execute that tests after UploadDownloadFilesTestsNUnit TestFeature + /// + /// The live files. + /// The test files. + [Test] + [Category("CompareFiles")] + [TestCaseSource(typeof(CompareFiles), "GetCsvFileToCompare")] + public void CompareCsvFiles(string liveFiles, string testFiles) + { + var folder = ProjectBaseConfiguration.DownloadFolderPath; + if (!File.Exists(folder + this.separator + testFiles)) + { + this.logger.Info(ProjectBaseConfiguration.DownloadFolderPath + liveFiles); + this.logger.Error("Missing file:\n{0}{1}", folder, testFiles); + Assert.That(false, Is.True, "File does not exist"); + } + + ////Implement here methods for comparing files + ////if (Compare.Files(ProjectBaseConfiguration.DownloadFolderPath + this.separator, testFiles, liveFiles)) + ////{ + //// Assert.That(false, Is.True,"Files are different"); + ////} + + this.logger.Info("Files are identical"); + } + + /// + /// Compares the TXT files, find files to compare by DataDriven methods from NUnit. + /// Execute that tests after UploadDownloadFilesTestsNUnit TestFeature + /// + /// The live files. + /// The test files. + [Test] + [Category("CompareFiles")] + [TestCaseSource(typeof(CompareFiles), "GetTxtFileToCompare")] + public void CompareTxtFiles(string liveFiles, string testFiles) + { + var folder = ProjectBaseConfiguration.DownloadFolderPath; + if (!File.Exists(folder + this.separator + testFiles)) + { + this.logger.Info(ProjectBaseConfiguration.DownloadFolderPath + liveFiles); + this.logger.Error("Missing file:\n{0}{1}", folder, testFiles); + // Assert.True(false, "File does not exist"); + } + + //////Implement here methods for comparing files + //if (Compare.Files(ProjectBaseConfiguration.DownloadFolderPath + this.separator, testFiles, liveFiles)) + //{ + // Assert.That(false, Is.True, "Files are different"); + //} + + this.logger.Info("Files are identical"); + } + } +} diff --git a/Ocaramba.Tests.NUnit/Tests/HerokuappTestsDataDrivenNUnit.cs b/Ocaramba.Tests.NUnit/Tests/HerokuappTestsDataDrivenNUnit.cs index 1b16f6a36..1bbb35a14 100644 --- a/Ocaramba.Tests.NUnit/Tests/HerokuappTestsDataDrivenNUnit.cs +++ b/Ocaramba.Tests.NUnit/Tests/HerokuappTestsDataDrivenNUnit.cs @@ -1,110 +1,110 @@ -// -// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. -// -// -// The MIT License (MIT) -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// - -namespace Ocaramba.Tests.NUnit.Tests -{ - using System.Collections.Generic; - using global::NUnit.Framework; - using Ocaramba; - using Ocaramba.Tests.NUnit.DataDriven; - using Ocaramba.Tests.PageObjects.PageObjects.TheInternet; - - [TestFixture] - [Parallelizable(ParallelScope.Fixtures)] - public class HerokuappTestsDataDrivenNUnit : ProjectTestBase - { - [Test] - [TestCaseSource(typeof(TestData), "Credentials")] - public void FormAuthenticationPageTest(IDictionary parameters) - { - new InternetPage(this.DriverContext).OpenHomePage().GoToFormAuthenticationPage(); - - var formFormAuthentication = new FormAuthenticationPage(this.DriverContext); - formFormAuthentication.EnterUserName(parameters["user"]); - formFormAuthentication.EnterPassword(parameters["password"]); - formFormAuthentication.LogOn(); - Verify.That( - this.DriverContext, - () => Assert.That(formFormAuthentication.GetMessage, Is.EqualTo(parameters["message"]))); - } - - [Test] - [TestCaseSource(typeof(TestData), "CredentialsExcel")] - public void FormAuthenticationPageExcelTest(IDictionary parameters) - { - new InternetPage(this.DriverContext).OpenHomePage().GoToFormAuthenticationPage(); - - var formFormAuthentication = new FormAuthenticationPage(this.DriverContext); - formFormAuthentication.EnterUserName(parameters["user"]); - formFormAuthentication.EnterPassword(parameters["password"]); - formFormAuthentication.LogOn(); - Verify.That( - this.DriverContext, - () => Assert.That(formFormAuthentication.GetMessage, Is.EqualTo(parameters["message"]))); - } - - [Test] - [TestCaseSource(typeof(TestData), "CredentialsCSV")] - public void CSVTest(IDictionary parameters) - { - new InternetPage(this.DriverContext).OpenHomePage().GoToFormAuthenticationPage(); - - var formFormAuthentication = new FormAuthenticationPage(this.DriverContext); - formFormAuthentication.EnterUserName(parameters["user"]); - formFormAuthentication.EnterPassword(parameters["password"]); - formFormAuthentication.LogOn(); - Verify.That( - this.DriverContext, - () => Assert.That(formFormAuthentication.GetMessage, Is.EqualTo(parameters["message"]))); - } - - [Test] - [TestCaseSource(typeof(TestData), "LinksSetTestName")] - public void CountLinksAndSetTestNameAtShiftingContentTest(IDictionary parameters) - { - new InternetPage(this.DriverContext).OpenHomePage().GoToShiftingContentPage(); - - var links = new ShiftingContentPage(this.DriverContext); - Verify.That(this.DriverContext, () => Assert.That(links.CountLinks(), Is.EqualTo(parameters["number"]))); - } - - [Test] - [TestCaseSource(typeof(TestData), "LinksExcel")] - public void CountLinksAndSetTestNameAtShiftingContentExcelTest(IDictionary parameters) - { - new InternetPage(this.DriverContext).OpenHomePage().GoToShiftingContentPage(); - - var links = new ShiftingContentPage(this.DriverContext); - Verify.That(this.DriverContext, () => Assert.That(links.CountLinksGetElementsBasic(), Is.EqualTo(parameters["number"]))); - } - - [Test] - [TestCaseSource(typeof(TestData), "Links")] - public void CountLinksAtShiftingContentTest(IDictionary parameters) - { - new InternetPage(this.DriverContext).OpenHomePage().GoToShiftingContentPage(); - - var links = new ShiftingContentPage(this.DriverContext); - Verify.That(this.DriverContext, () => Assert.That(links.CountLinks(), Is.EqualTo(parameters["number"]))); - } - } -} +// +// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. +// +// +// The MIT License (MIT) +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// + +namespace Ocaramba.Tests.NUnit.Tests +{ + using System.Collections.Generic; + using global::NUnit.Framework; + using Ocaramba; + using Ocaramba.Tests.NUnit.DataDriven; + using Ocaramba.Tests.PageObjects.PageObjects.TheInternet; + + [TestFixture] + [Parallelizable(ParallelScope.Fixtures)] + public class HerokuappTestsDataDrivenNUnit : ProjectTestBase + { + [Test] + [TestCaseSource(typeof(TestData), "Credentials")] + public void FormAuthenticationPageTest(IDictionary parameters) + { + new InternetPage(this.DriverContext).OpenHomePage().GoToFormAuthenticationPage(); + + var formFormAuthentication = new FormAuthenticationPage(this.DriverContext); + formFormAuthentication.EnterUserName(parameters["user"]); + formFormAuthentication.EnterPassword(parameters["password"]); + formFormAuthentication.LogOn(); + Verify.That( + this.DriverContext, + () => Assert.That(formFormAuthentication.GetMessage, Is.EqualTo(parameters["message"]))); + } + + [Test] + [TestCaseSource(typeof(TestData), "CredentialsExcel")] + public void FormAuthenticationPageExcelTest(IDictionary parameters) + { + new InternetPage(this.DriverContext).OpenHomePage().GoToFormAuthenticationPage(); + + var formFormAuthentication = new FormAuthenticationPage(this.DriverContext); + formFormAuthentication.EnterUserName(parameters["user"]); + formFormAuthentication.EnterPassword(parameters["password"]); + formFormAuthentication.LogOn(); + Verify.That( + this.DriverContext, + () => Assert.That(formFormAuthentication.GetMessage, Is.EqualTo(parameters["message"]))); + } + + [Test] + [TestCaseSource(typeof(TestData), "CredentialsCSV")] + public void CSVTest(IDictionary parameters) + { + new InternetPage(this.DriverContext).OpenHomePage().GoToFormAuthenticationPage(); + + var formFormAuthentication = new FormAuthenticationPage(this.DriverContext); + formFormAuthentication.EnterUserName(parameters["user"]); + formFormAuthentication.EnterPassword(parameters["password"]); + formFormAuthentication.LogOn(); + Verify.That( + this.DriverContext, + () => Assert.That(formFormAuthentication.GetMessage, Is.EqualTo(parameters["message"]))); + } + + [Test] + [TestCaseSource(typeof(TestData), "LinksSetTestName")] + public void CountLinksAndSetTestNameAtShiftingContentTest(IDictionary parameters) + { + new InternetPage(this.DriverContext).OpenHomePage().GoToShiftingContentPage(); + + var links = new ShiftingContentPage(this.DriverContext); + Verify.That(this.DriverContext, () => Assert.That(links.CountLinks(), Is.EqualTo(parameters["number"]))); + } + + [Test] + [TestCaseSource(typeof(TestData), "LinksExcel")] + public void CountLinksAndSetTestNameAtShiftingContentExcelTest(IDictionary parameters) + { + new InternetPage(this.DriverContext).OpenHomePage().GoToShiftingContentPage(); + + var links = new ShiftingContentPage(this.DriverContext); + Verify.That(this.DriverContext, () => Assert.That(links.CountLinksGetElementsBasic(), Is.EqualTo(parameters["number"]))); + } + + [Test] + [TestCaseSource(typeof(TestData), "Links")] + public void CountLinksAtShiftingContentTest(IDictionary parameters) + { + new InternetPage(this.DriverContext).OpenHomePage().GoToShiftingContentPage(); + + var links = new ShiftingContentPage(this.DriverContext); + Verify.That(this.DriverContext, () => Assert.That(links.CountLinks(), Is.EqualTo(parameters["number"]))); + } + } +} diff --git a/Ocaramba.Tests.NUnit/Tests/HerokuappTestsNUnit.cs b/Ocaramba.Tests.NUnit/Tests/HerokuappTestsNUnit.cs index bd6082e6d..c7f380ee4 100644 --- a/Ocaramba.Tests.NUnit/Tests/HerokuappTestsNUnit.cs +++ b/Ocaramba.Tests.NUnit/Tests/HerokuappTestsNUnit.cs @@ -1,226 +1,226 @@ -// -// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. -// -// -// The MIT License (MIT) -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// - -namespace Ocaramba.Tests.NUnit.Tests -{ - using global::NUnit.Framework; - using Ocaramba; - using Ocaramba.Tests.PageObjects.PageObjects.TheInternet; - using OpenQA.Selenium; - - [TestFixture] - [Category("BasicNUnit")] - [Parallelizable(ParallelScope.Fixtures)] - public class HerokuappTestsNUnit : ProjectTestBase - { - [Test] - public void BasicAuthTest() - { - var basicAuthPage = - new InternetPage(this.DriverContext).OpenHomePageWithUserCredentials().GoToBasicAuthPage(); - - //Verify.That( - // this.DriverContext, - // () => - //Assert.AreEqual( - // "Congratulations! You must have the proper credentials.", - // basicAuthPage.GetCongratulationsInfo)); - } - - [Test] - [Ignore("ForgotPasswordPage doesn't work")] - public void ForgotPasswordTest() - { - new InternetPage(this.DriverContext).OpenHomePage().GoToForgotPasswordPage(); - - var forgotPassword = new ForgotPasswordPage(this.DriverContext); - - //Verify.That( - // this.DriverContext, - // () => Assert.AreEqual(5 + 7 + 2, forgotPassword.EnterEmail(5, 7, 2)), - // () => Assert.AreEqual("Your e-mail's been sent!", forgotPassword.ClickRetrievePassword)); - } - - [Test] - public void MultipleWindowsTest() - { - const string PageTitle = "New Window"; - - var newWindowPage = new InternetPage(this.DriverContext) - .OpenHomePage() - .GoToMultipleWindowsPage() - .OpenNewWindowPage(); - - // Assert.True(newWindowPage.IsPageTile(PageTitle), "wrong page title, should be {0}", PageTitle); - //Assert.True(newWindowPage.IsNewWindowH3TextVisible(PageTitle), "text is not equal to {0}", PageTitle); - } - - [Test] - public void NestedFramesTest() - { - var nestedFramesPage = new InternetPage(this.DriverContext) - .OpenHomePage() - .GoToNestedFramesPage() - .SwitchToFrame("frame-top"); - - nestedFramesPage.SwitchToFrame("frame-left"); - Assert.That(nestedFramesPage.LeftBody, Is.EqualTo("LEFT")); - - nestedFramesPage.SwitchToParentFrame().SwitchToFrame("frame-middle"); - Assert.That(nestedFramesPage.MiddleBody, Is.EqualTo("MIDDLE")); - - nestedFramesPage.SwitchToParentFrame().SwitchToFrame("frame-right"); - Assert.That(nestedFramesPage.RightBody, Is.EqualTo("RIGHT")); - - nestedFramesPage.ReturnToDefaultContent().SwitchToFrame("frame-bottom"); - Assert.That(nestedFramesPage.BottomBody, Is.EqualTo("BOTTOM")); - } - - [Test] - public void ContextMenuTest() - { - const string H3Value = "Context Menu"; - var browser = BaseConfiguration.TestBrowser; - if (browser.Equals(BrowserType.Firefox)) - { - var contextMenuPage = new InternetPage(this.DriverContext) - .OpenHomePage() - .GoToContextMenuPage() - .SelectTheInternetOptionFromContextMenu(); - - Assert.That(contextMenuPage.JavaScriptText, Is.EqualTo("You selected a context menu")); - Assert.That(contextMenuPage.ConfirmJavaScript().IsH3ElementEqualsToExpected(H3Value), Is.True, $"h3 element is not equal to expected {H3Value}"); - - } - } - - [Test] - public void HoversTest() - { - var expected = new[] { "name: user1", "name: user2", "name: user3" }; - - var homePage = new InternetPage(this.DriverContext) - .OpenHomePageWithUserCredentials() - .GoToHoversPage(); - - var text1Before = homePage.GetHoverText(1); - this.LogTest.Info("Text before: '{0}'", text1Before); - homePage.MouseHoverAt(1); - var text1After = homePage.GetHoverText(1); - this.LogTest.Info("Text after: '{0}'", text1After); - - var text2Before = homePage.GetHoverText(2); - this.LogTest.Info("Text before: '{0}'", text2Before); - homePage.MouseHoverAt(2); - var text2After = homePage.GetHoverText(2); - this.LogTest.Info("Text after: '{0}'", text2After); - - var text3Before = homePage.GetHoverText(3); - this.LogTest.Info("Text before: '{0}'", text3Before); - homePage.MouseHoverAt(3); - var text3After = homePage.GetHoverText(3); - this.LogTest.Info("Text after: '{0}'", text3After); - - Assert.That(text1Before, Is.EqualTo(string.Empty)); - Assert.That(text2Before, Is.EqualTo(string.Empty)); - Assert.That(text3Before, Is.EqualTo(string.Empty)); - - Assert.That(text1After, Is.EqualTo(expected[0])); - Assert.That(text2After, Is.EqualTo(expected[1])); - Assert.That(text3After, Is.EqualTo(expected[2])); - } - - [Test] - public void SetAttributeTest() - { - var internetPage = new InternetPage(this.DriverContext) - .OpenHomePage(); - - internetPage.ChangeBasicAuthLink("/broken_images"); - internetPage.BasicAuthLinkClick(); - - var brokenImagesPage = new BrokenImagesPage(this.DriverContext); - - Assert.That(brokenImagesPage.IsPageHeaderElementEqualsToExpected("Broken Images"), Is.True, "Page header element is not equal to expected 'Broken Images'"); - } - - [Test] - public void SlowResourcesTest() - { - int timeout = 35; - new InternetPage(this.DriverContext) - .OpenHomePage() - .GoToSlowResources() - .WaitForIt(timeout); - } - - [Test] - [Category("Grid")] - public void TablesTest() - { - var tableElements = new InternetPage(this.DriverContext) - .OpenHomePage() - .GoToTablesPage(); - var table = tableElements.GetTableElements(); - - Assert.That(table[0][0], Is.EqualTo("Smith")); - Assert.That(table[3][5], Is.EqualTo("edit delete")); - } - - [Test] - public void DragAndDropTest() - { - var dragAndDrop = new InternetPage(this.DriverContext) - .OpenHomePage() - .GoToDragAndDropPage() - .MoveElementAtoElementB(); - - Assert.That(dragAndDrop.IsElementAMovedToB(), Is.True, "Element is not moved."); - } - - [Test] - public void DynamicallyLoadedPageElementsTest() - { - var page = new InternetPage(this.DriverContext) - .OpenHomePage() - .GoToDynamicLoading() - .ClickOnExample2(); - - this.DriverContext.PerformanceMeasures.StartMeasure(); - page.ClickStart(); - Assert.That("Hello World!", Is.EqualTo(page.Text)); - this.DriverContext.PerformanceMeasures.StopMeasure(TestContext.CurrentContext.Test.Name + "WaitForTest"); - } - - [Test] - public void DynamicallyLoadedPageElementsTimeOutTest() - { - var page = new InternetPage(this.DriverContext) - .OpenHomePage() - .GoToDynamicLoading() - .ClickOnExample2(); - - page.ClickStart(); - Assert.Throws(() => page.ShortTimeoutText()); - } - } -} +// +// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. +// +// +// The MIT License (MIT) +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// + +namespace Ocaramba.Tests.NUnit.Tests +{ + using global::NUnit.Framework; + using Ocaramba; + using Ocaramba.Tests.PageObjects.PageObjects.TheInternet; + using OpenQA.Selenium; + + [TestFixture] + [Category("BasicNUnit")] + [Parallelizable(ParallelScope.Fixtures)] + public class HerokuappTestsNUnit : ProjectTestBase + { + [Test] + public void BasicAuthTest() + { + var basicAuthPage = + new InternetPage(this.DriverContext).OpenHomePageWithUserCredentials().GoToBasicAuthPage(); + + //Verify.That( + // this.DriverContext, + // () => + //Assert.AreEqual( + // "Congratulations! You must have the proper credentials.", + // basicAuthPage.GetCongratulationsInfo)); + } + + [Test] + [Ignore("ForgotPasswordPage doesn't work")] + public void ForgotPasswordTest() + { + new InternetPage(this.DriverContext).OpenHomePage().GoToForgotPasswordPage(); + + var forgotPassword = new ForgotPasswordPage(this.DriverContext); + + //Verify.That( + // this.DriverContext, + // () => Assert.AreEqual(5 + 7 + 2, forgotPassword.EnterEmail(5, 7, 2)), + // () => Assert.AreEqual("Your e-mail's been sent!", forgotPassword.ClickRetrievePassword)); + } + + [Test] + public void MultipleWindowsTest() + { + const string PageTitle = "New Window"; + + var newWindowPage = new InternetPage(this.DriverContext) + .OpenHomePage() + .GoToMultipleWindowsPage() + .OpenNewWindowPage(); + + // Assert.True(newWindowPage.IsPageTile(PageTitle), "wrong page title, should be {0}", PageTitle); + //Assert.True(newWindowPage.IsNewWindowH3TextVisible(PageTitle), "text is not equal to {0}", PageTitle); + } + + [Test] + public void NestedFramesTest() + { + var nestedFramesPage = new InternetPage(this.DriverContext) + .OpenHomePage() + .GoToNestedFramesPage() + .SwitchToFrame("frame-top"); + + nestedFramesPage.SwitchToFrame("frame-left"); + Assert.That(nestedFramesPage.LeftBody, Is.EqualTo("LEFT")); + + nestedFramesPage.SwitchToParentFrame().SwitchToFrame("frame-middle"); + Assert.That(nestedFramesPage.MiddleBody, Is.EqualTo("MIDDLE")); + + nestedFramesPage.SwitchToParentFrame().SwitchToFrame("frame-right"); + Assert.That(nestedFramesPage.RightBody, Is.EqualTo("RIGHT")); + + nestedFramesPage.ReturnToDefaultContent().SwitchToFrame("frame-bottom"); + Assert.That(nestedFramesPage.BottomBody, Is.EqualTo("BOTTOM")); + } + + [Test] + public void ContextMenuTest() + { + const string H3Value = "Context Menu"; + var browser = BaseConfiguration.TestBrowser; + if (browser.Equals(BrowserType.Firefox)) + { + var contextMenuPage = new InternetPage(this.DriverContext) + .OpenHomePage() + .GoToContextMenuPage() + .SelectTheInternetOptionFromContextMenu(); + + Assert.That(contextMenuPage.JavaScriptText, Is.EqualTo("You selected a context menu")); + Assert.That(contextMenuPage.ConfirmJavaScript().IsH3ElementEqualsToExpected(H3Value), Is.True, $"h3 element is not equal to expected {H3Value}"); + + } + } + + [Test] + public void HoversTest() + { + var expected = new[] { "name: user1", "name: user2", "name: user3" }; + + var homePage = new InternetPage(this.DriverContext) + .OpenHomePageWithUserCredentials() + .GoToHoversPage(); + + var text1Before = homePage.GetHoverText(1); + this.LogTest.Info("Text before: '{0}'", text1Before); + homePage.MouseHoverAt(1); + var text1After = homePage.GetHoverText(1); + this.LogTest.Info("Text after: '{0}'", text1After); + + var text2Before = homePage.GetHoverText(2); + this.LogTest.Info("Text before: '{0}'", text2Before); + homePage.MouseHoverAt(2); + var text2After = homePage.GetHoverText(2); + this.LogTest.Info("Text after: '{0}'", text2After); + + var text3Before = homePage.GetHoverText(3); + this.LogTest.Info("Text before: '{0}'", text3Before); + homePage.MouseHoverAt(3); + var text3After = homePage.GetHoverText(3); + this.LogTest.Info("Text after: '{0}'", text3After); + + Assert.That(text1Before, Is.EqualTo(string.Empty)); + Assert.That(text2Before, Is.EqualTo(string.Empty)); + Assert.That(text3Before, Is.EqualTo(string.Empty)); + + Assert.That(text1After, Is.EqualTo(expected[0])); + Assert.That(text2After, Is.EqualTo(expected[1])); + Assert.That(text3After, Is.EqualTo(expected[2])); + } + + [Test] + public void SetAttributeTest() + { + var internetPage = new InternetPage(this.DriverContext) + .OpenHomePage(); + + internetPage.ChangeBasicAuthLink("/broken_images"); + internetPage.BasicAuthLinkClick(); + + var brokenImagesPage = new BrokenImagesPage(this.DriverContext); + + Assert.That(brokenImagesPage.IsPageHeaderElementEqualsToExpected("Broken Images"), Is.True, "Page header element is not equal to expected 'Broken Images'"); + } + + [Test] + public void SlowResourcesTest() + { + int timeout = 35; + new InternetPage(this.DriverContext) + .OpenHomePage() + .GoToSlowResources() + .WaitForIt(timeout); + } + + [Test] + [Category("Grid")] + public void TablesTest() + { + var tableElements = new InternetPage(this.DriverContext) + .OpenHomePage() + .GoToTablesPage(); + var table = tableElements.GetTableElements(); + + Assert.That(table[0][0], Is.EqualTo("Smith")); + Assert.That(table[3][5], Is.EqualTo("edit delete")); + } + + [Test] + public void DragAndDropTest() + { + var dragAndDrop = new InternetPage(this.DriverContext) + .OpenHomePage() + .GoToDragAndDropPage() + .MoveElementAtoElementB(); + + Assert.That(dragAndDrop.IsElementAMovedToB(), Is.True, "Element is not moved."); + } + + [Test] + public void DynamicallyLoadedPageElementsTest() + { + var page = new InternetPage(this.DriverContext) + .OpenHomePage() + .GoToDynamicLoading() + .ClickOnExample2(); + + this.DriverContext.PerformanceMeasures.StartMeasure(); + page.ClickStart(); + Assert.That("Hello World!", Is.EqualTo(page.Text)); + this.DriverContext.PerformanceMeasures.StopMeasure(TestContext.CurrentContext.Test.Name + "WaitForTest"); + } + + [Test] + public void DynamicallyLoadedPageElementsTimeOutTest() + { + var page = new InternetPage(this.DriverContext) + .OpenHomePage() + .GoToDynamicLoading() + .ClickOnExample2(); + + page.ClickStart(); + Assert.Throws(() => page.ShortTimeoutText()); + } + } +} diff --git a/Ocaramba.Tests.NUnit/Tests/JavaScriptAlertsTestsNUnit.cs b/Ocaramba.Tests.NUnit/Tests/JavaScriptAlertsTestsNUnit.cs index b87fbeecc..ab16345e6 100644 --- a/Ocaramba.Tests.NUnit/Tests/JavaScriptAlertsTestsNUnit.cs +++ b/Ocaramba.Tests.NUnit/Tests/JavaScriptAlertsTestsNUnit.cs @@ -1,85 +1,85 @@ -// -// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. -// -// -// The MIT License (MIT) -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// - -namespace Ocaramba.Tests.NUnit.Tests -{ - using global::NUnit.Framework; - using Ocaramba.Tests.PageObjects.PageObjects.TheInternet; - - [TestFixture] - [Parallelizable(ParallelScope.Fixtures)] - public class JavaScriptAlertsTestsNUnit : ProjectTestBase - { - [Test] - public void ClickJsAlertTest() - { - var internetPage = new InternetPage(this.DriverContext).OpenHomePage(); - var jsAlertsPage = internetPage.GoToJavaScriptAlerts(); - jsAlertsPage.OpenJsAlert(); - jsAlertsPage.AcceptAlert(); - Assert.That(jsAlertsPage.ResultText, Is.EqualTo("You successfully clicked an alert")); - } - - [Test] - public void AcceptJsConfirmTest() - { - var internetPage = new InternetPage(this.DriverContext).OpenHomePage(); - var jsAlertsPage = internetPage.GoToJavaScriptAlerts(); - jsAlertsPage.OpenJsConfirm(); - jsAlertsPage.AcceptAlert(); - Assert.That(jsAlertsPage.ResultText, Is.EqualTo("You clicked: Ok")); - - } - - [Test] - public void DismissJsConfirmTest() - { - var internetPage = new InternetPage(this.DriverContext).OpenHomePage(); - var jsAlertsPage = internetPage.GoToJavaScriptAlerts(); - jsAlertsPage.OpenJsConfirm(); - jsAlertsPage.DismissAlert(); - Assert.That(jsAlertsPage.ResultText, Is.EqualTo("You clicked: Cancel")); - } - - [Test] - public void TypeTextAndAcceptJsPromptTest() - { - var text = "Sample text"; - var internetPage = new InternetPage(this.DriverContext).OpenHomePage(); - var jsAlertsPage = internetPage.GoToJavaScriptAlerts(); - jsAlertsPage.OpenJsPrompt(); - jsAlertsPage.TypeTextOnAlert(text); - jsAlertsPage.AcceptAlert(); - Assert.That(jsAlertsPage.ResultText, Is.EqualTo("You entered: " + text)); - } - - [Test] - public void DismissJsPromptTest() - { - var internetPage = new InternetPage(this.DriverContext).OpenHomePage(); - var jsAlertsPage = internetPage.GoToJavaScriptAlerts(); - jsAlertsPage.OpenJsPrompt(); - jsAlertsPage.DismissAlert(); - Assert.That(jsAlertsPage.ResultText, Is.EqualTo("You entered: null")); - } - } -} +// +// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. +// +// +// The MIT License (MIT) +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// + +namespace Ocaramba.Tests.NUnit.Tests +{ + using global::NUnit.Framework; + using Ocaramba.Tests.PageObjects.PageObjects.TheInternet; + + [TestFixture] + [Parallelizable(ParallelScope.Fixtures)] + public class JavaScriptAlertsTestsNUnit : ProjectTestBase + { + [Test] + public void ClickJsAlertTest() + { + var internetPage = new InternetPage(this.DriverContext).OpenHomePage(); + var jsAlertsPage = internetPage.GoToJavaScriptAlerts(); + jsAlertsPage.OpenJsAlert(); + jsAlertsPage.AcceptAlert(); + Assert.That(jsAlertsPage.ResultText, Is.EqualTo("You successfully clicked an alert")); + } + + [Test] + public void AcceptJsConfirmTest() + { + var internetPage = new InternetPage(this.DriverContext).OpenHomePage(); + var jsAlertsPage = internetPage.GoToJavaScriptAlerts(); + jsAlertsPage.OpenJsConfirm(); + jsAlertsPage.AcceptAlert(); + Assert.That(jsAlertsPage.ResultText, Is.EqualTo("You clicked: Ok")); + + } + + [Test] + public void DismissJsConfirmTest() + { + var internetPage = new InternetPage(this.DriverContext).OpenHomePage(); + var jsAlertsPage = internetPage.GoToJavaScriptAlerts(); + jsAlertsPage.OpenJsConfirm(); + jsAlertsPage.DismissAlert(); + Assert.That(jsAlertsPage.ResultText, Is.EqualTo("You clicked: Cancel")); + } + + [Test] + public void TypeTextAndAcceptJsPromptTest() + { + var text = "Sample text"; + var internetPage = new InternetPage(this.DriverContext).OpenHomePage(); + var jsAlertsPage = internetPage.GoToJavaScriptAlerts(); + jsAlertsPage.OpenJsPrompt(); + jsAlertsPage.TypeTextOnAlert(text); + jsAlertsPage.AcceptAlert(); + Assert.That(jsAlertsPage.ResultText, Is.EqualTo("You entered: " + text)); + } + + [Test] + public void DismissJsPromptTest() + { + var internetPage = new InternetPage(this.DriverContext).OpenHomePage(); + var jsAlertsPage = internetPage.GoToJavaScriptAlerts(); + jsAlertsPage.OpenJsPrompt(); + jsAlertsPage.DismissAlert(); + Assert.That(jsAlertsPage.ResultText, Is.EqualTo("You entered: null")); + } + } +} diff --git a/Ocaramba.Tests.NUnit/Tests/SaveScreenShotsPageSourceTestsNUnit.cs b/Ocaramba.Tests.NUnit/Tests/SaveScreenShotsPageSourceTestsNUnit.cs index 9386d3664..d535fba98 100644 --- a/Ocaramba.Tests.NUnit/Tests/SaveScreenShotsPageSourceTestsNUnit.cs +++ b/Ocaramba.Tests.NUnit/Tests/SaveScreenShotsPageSourceTestsNUnit.cs @@ -1,74 +1,74 @@ -// -// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. -// -// -// The MIT License (MIT) -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// - -namespace Ocaramba.Tests.NUnit.Tests -{ - using System.Drawing.Imaging; - using System.Globalization; - using global::NUnit.Framework; - using Ocaramba.Helpers; - using Ocaramba.Tests.PageObjects.PageObjects.TheInternet; - - [TestFixture] - public class SaveScreenShotsPageSourceTestsNUnit : ProjectTestBase - { - [Test] - [Category("TakingScreehShots")] - [Category("NotImplementedInCoreOrUploadDownload")] - public void SaveFullScreenShotTest() - { - var downloadPage = new InternetPage(this.DriverContext).OpenHomePage().GoToFileDownloader(); - var screenShotNumber = FilesHelper.CountFiles(this.DriverContext.ScreenShotFolder, FileType.Png); -#if net47 - // Assert.IsNotNull(TakeScreenShot.Save(TakeScreenShot.DoIt(), ImageFormat.Png, this.DriverContext.ScreenShotFolder, string.Format(CultureInfo.CurrentCulture, this.DriverContext.TestTitle + "_first"))); -#endif - var nameOfScreenShot = downloadPage.CheckIfScreenShotIsSaved(screenShotNumber); - TestContext.AddTestAttachment(nameOfScreenShot); - Assert.That(nameOfScreenShot.Contains(this.DriverContext.TestTitle), Is.True, "Name of screenshot doesn't contain Test Title"); - Assert.That(this.DriverContext.TakeAndSaveScreenshot(), Is.Not.Null); - } - - [Test] - public void SaveWebDriverScreenShotTest() - { - var downloadPage = new InternetPage(this.DriverContext).OpenHomePage().GoToFileDownloader(); - var screenShotNumber = FilesHelper.CountFiles(this.DriverContext.ScreenShotFolder, FileType.Png); - Assert.That(downloadPage.SaveWebDriverScreenShot(), Is.Not.Null); - var nameOfScreenShot = downloadPage.CheckIfScreenShotIsSaved(screenShotNumber); - TestContext.AddTestAttachment(nameOfScreenShot); - Assert.That(nameOfScreenShot.Contains(this.DriverContext.TestTitle), Is.True, "Name of screenshot doesn't contain Test Title"); - } - - [Test] - [Category("NotImplementedInCoreOrUploadDownload")] - public void SaveSourcePageTest() - { - var basicAuthPage = new InternetPage(this.DriverContext).OpenHomePageWithUserCredentials().GoToBasicAuthPage(); - var name = this.DriverContext.TestTitle + FilesHelper.ReturnFileExtension(FileType.Html); - FilesHelper.DeleteFile(name, this.DriverContext.PageSourceFolder); - var pageSourceNumber = FilesHelper.CountFiles(this.DriverContext.PageSourceFolder, FileType.Html); - Assert.That(basicAuthPage.SaveSourcePage(), Is.Not.Null); - basicAuthPage.CheckIfPageSourceSaved(); - Assert.That(pageSourceNumber < FilesHelper.CountFiles(this.DriverContext.PageSourceFolder, FileType.Html), "Number of html files did not increase"); - } - } -} +// +// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. +// +// +// The MIT License (MIT) +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// + +namespace Ocaramba.Tests.NUnit.Tests +{ + using System.Drawing.Imaging; + using System.Globalization; + using global::NUnit.Framework; + using Ocaramba.Helpers; + using Ocaramba.Tests.PageObjects.PageObjects.TheInternet; + + [TestFixture] + public class SaveScreenShotsPageSourceTestsNUnit : ProjectTestBase + { + [Test] + [Category("TakingScreehShots")] + [Category("NotImplementedInCoreOrUploadDownload")] + public void SaveFullScreenShotTest() + { + var downloadPage = new InternetPage(this.DriverContext).OpenHomePage().GoToFileDownloader(); + var screenShotNumber = FilesHelper.CountFiles(this.DriverContext.ScreenShotFolder, FileType.Png); +#if net47 + // Assert.IsNotNull(TakeScreenShot.Save(TakeScreenShot.DoIt(), ImageFormat.Png, this.DriverContext.ScreenShotFolder, string.Format(CultureInfo.CurrentCulture, this.DriverContext.TestTitle + "_first"))); +#endif + var nameOfScreenShot = downloadPage.CheckIfScreenShotIsSaved(screenShotNumber); + TestContext.AddTestAttachment(nameOfScreenShot); + Assert.That(nameOfScreenShot.Contains(this.DriverContext.TestTitle), Is.True, "Name of screenshot doesn't contain Test Title"); + Assert.That(this.DriverContext.TakeAndSaveScreenshot(), Is.Not.Null); + } + + [Test] + public void SaveWebDriverScreenShotTest() + { + var downloadPage = new InternetPage(this.DriverContext).OpenHomePage().GoToFileDownloader(); + var screenShotNumber = FilesHelper.CountFiles(this.DriverContext.ScreenShotFolder, FileType.Png); + Assert.That(downloadPage.SaveWebDriverScreenShot(), Is.Not.Null); + var nameOfScreenShot = downloadPage.CheckIfScreenShotIsSaved(screenShotNumber); + TestContext.AddTestAttachment(nameOfScreenShot); + Assert.That(nameOfScreenShot.Contains(this.DriverContext.TestTitle), Is.True, "Name of screenshot doesn't contain Test Title"); + } + + [Test] + [Category("NotImplementedInCoreOrUploadDownload")] + public void SaveSourcePageTest() + { + var basicAuthPage = new InternetPage(this.DriverContext).OpenHomePageWithUserCredentials().GoToBasicAuthPage(); + var name = this.DriverContext.TestTitle + FilesHelper.ReturnFileExtension(FileType.Html); + FilesHelper.DeleteFile(name, this.DriverContext.PageSourceFolder); + var pageSourceNumber = FilesHelper.CountFiles(this.DriverContext.PageSourceFolder, FileType.Html); + Assert.That(basicAuthPage.SaveSourcePage(), Is.Not.Null); + basicAuthPage.CheckIfPageSourceSaved(); + Assert.That(pageSourceNumber < FilesHelper.CountFiles(this.DriverContext.PageSourceFolder, FileType.Html), "Number of html files did not increase"); + } + } +} diff --git a/Ocaramba.Tests.NUnit/Tests/SelectWebElementTests.cs b/Ocaramba.Tests.NUnit/Tests/SelectWebElementTests.cs index bc6116fce..77666bd8b 100644 --- a/Ocaramba.Tests.NUnit/Tests/SelectWebElementTests.cs +++ b/Ocaramba.Tests.NUnit/Tests/SelectWebElementTests.cs @@ -1,56 +1,56 @@ -// -// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. -// - -namespace Ocaramba.Tests.NUnit.Tests -{ - using global::NUnit.Framework; - using Ocaramba.Tests.PageObjects.PageObjects.TheInternet; - - [TestFixture] - [Parallelizable(ParallelScope.Fixtures)] - public class SelectWebElementTests : ProjectTestBase - { - [Test] - public void SelectByIndexTest() - { - var dropdownPage = new InternetPage(this.DriverContext) - .OpenHomePage() - .GoToDropdownPage(); - - dropdownPage.SelectByIndex(1); - - Assert.That(dropdownPage.SelectedOption(), Is.EqualTo("Option 1")); - } - - [Test] - public void NoSuchElementExceptionByTextTest() - { - var dropdownPage = new InternetPage(this.DriverContext) - .OpenHomePage() - .GoToDropdownPage(); - - Assert.That(() => dropdownPage.SelectByText("Qwerty.", 10), Throws.Nothing); - } - - [Test] - public void NoSuchElementExceptionByIndexTest() - { - var dropdownPage = new InternetPage(this.DriverContext) - .OpenHomePage() - .GoToDropdownPage(); - - Assert.That(() => dropdownPage.SelectByIndex(7), Throws.Nothing); - } - - [Test] - public void NoSuchElementExceptionByValueTest() - { - var dropdownPage = new InternetPage(this.DriverContext) - .OpenHomePage() - .GoToDropdownPage(); - - Assert.That(() => dropdownPage.SelectByValue("qwerty"), Throws.Nothing); - } - } +// +// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. +// + +namespace Ocaramba.Tests.NUnit.Tests +{ + using global::NUnit.Framework; + using Ocaramba.Tests.PageObjects.PageObjects.TheInternet; + + [TestFixture] + [Parallelizable(ParallelScope.Fixtures)] + public class SelectWebElementTests : ProjectTestBase + { + [Test] + public void SelectByIndexTest() + { + var dropdownPage = new InternetPage(this.DriverContext) + .OpenHomePage() + .GoToDropdownPage(); + + dropdownPage.SelectByIndex(1); + + Assert.That(dropdownPage.SelectedOption(), Is.EqualTo("Option 1")); + } + + [Test] + public void NoSuchElementExceptionByTextTest() + { + var dropdownPage = new InternetPage(this.DriverContext) + .OpenHomePage() + .GoToDropdownPage(); + + Assert.That(() => dropdownPage.SelectByText("Qwerty.", 10), Throws.Nothing); + } + + [Test] + public void NoSuchElementExceptionByIndexTest() + { + var dropdownPage = new InternetPage(this.DriverContext) + .OpenHomePage() + .GoToDropdownPage(); + + Assert.That(() => dropdownPage.SelectByIndex(7), Throws.Nothing); + } + + [Test] + public void NoSuchElementExceptionByValueTest() + { + var dropdownPage = new InternetPage(this.DriverContext) + .OpenHomePage() + .GoToDropdownPage(); + + Assert.That(() => dropdownPage.SelectByValue("qwerty"), Throws.Nothing); + } + } } \ No newline at end of file diff --git a/Ocaramba.Tests.NUnitExtentReports/ExtentLogger/ExtentTestLogger.cs b/Ocaramba.Tests.NUnitExtentReports/ExtentLogger/ExtentTestLogger.cs index d3eada4e9..25a3aee08 100644 --- a/Ocaramba.Tests.NUnitExtentReports/ExtentLogger/ExtentTestLogger.cs +++ b/Ocaramba.Tests.NUnitExtentReports/ExtentLogger/ExtentTestLogger.cs @@ -1,48 +1,48 @@ -using NUnit.Framework.Interfaces; -using AventStack.ExtentReports; // Add this using directive - -namespace Ocaramba.Tests.NUnitExtentReports.ExtentLogger -{ - /// - /// Class containing methods enabling writing messages to Extent Report HTML file - /// - class ExtentTestLogger : ProjectTestBase - { - /// - /// Log Info entry in HTML file - /// - /// The message - public static void Info(string message) - { - test.Info(message); - } - - /// - /// Log Warning entry in HTML file - /// - /// The message - public static void Warning(string message) - { - test.Warning(message); - } - - /// - /// Log Test Pass status in HTML file - /// - /// The message - public static void Pass(string message) - { - test.Pass(message); - } - - /// - /// Log Test Failed status in HTML file - /// - /// Test status - /// Error message - public static void Fail(TestStatus status, string errorMessage) - { - test.Fail(status + ": " + errorMessage); - } - } +using NUnit.Framework.Interfaces; +using AventStack.ExtentReports; // Add this using directive + +namespace Ocaramba.Tests.NUnitExtentReports.ExtentLogger +{ + /// + /// Class containing methods enabling writing messages to Extent Report HTML file + /// + class ExtentTestLogger : ProjectTestBase + { + /// + /// Log Info entry in HTML file + /// + /// The message + public static void Info(string message) + { + test.Info(message); + } + + /// + /// Log Warning entry in HTML file + /// + /// The message + public static void Warning(string message) + { + test.Warning(message); + } + + /// + /// Log Test Pass status in HTML file + /// + /// The message + public static void Pass(string message) + { + test.Pass(message); + } + + /// + /// Log Test Failed status in HTML file + /// + /// Test status + /// Error message + public static void Fail(TestStatus status, string errorMessage) + { + test.Fail(status + ": " + errorMessage); + } + } } \ No newline at end of file diff --git a/Ocaramba.Tests.NUnitExtentReports/Ocaramba.Tests.NUnitExtentReports.csproj b/Ocaramba.Tests.NUnitExtentReports/Ocaramba.Tests.NUnitExtentReports.csproj index e56304908..0585812ad 100644 --- a/Ocaramba.Tests.NUnitExtentReports/Ocaramba.Tests.NUnitExtentReports.csproj +++ b/Ocaramba.Tests.NUnitExtentReports/Ocaramba.Tests.NUnitExtentReports.csproj @@ -1,95 +1,95 @@ - - - - net8.0 - net8.0 - true - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - 5.0.4 - - - 2.2.0 - - - - - - - - - - - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - - - - 4.1.0 - - - - - net8_0 - - - - net47 - - - - ..\Ocaramba\fxcop-sonarqube.tests.ruleset - - - - ..\Ocaramba\fxcop-sonarqube.tests.ruleset - - - true - - + + + + net8.0 + net8.0 + true + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + 5.0.4 + + + 2.2.0 + + + + + + + + + + + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + + + + 4.1.0 + + + + + net8_0 + + + + net47 + + + + ..\Ocaramba\fxcop-sonarqube.tests.ruleset + + + + ..\Ocaramba\fxcop-sonarqube.tests.ruleset + + + true + + diff --git a/Ocaramba.Tests.NUnitExtentReports/PageObject/DragAndDropPage.cs b/Ocaramba.Tests.NUnitExtentReports/PageObject/DragAndDropPage.cs index 8499837f7..fe65e8538 100644 --- a/Ocaramba.Tests.NUnitExtentReports/PageObject/DragAndDropPage.cs +++ b/Ocaramba.Tests.NUnitExtentReports/PageObject/DragAndDropPage.cs @@ -1,57 +1,57 @@ -// -// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. -// -// -// The MIT License (MIT) -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// - -namespace Ocaramba.Tests.NUnitExtentReports.PageObjects -{ - using Ocaramba; - using Ocaramba.Extensions; - using Ocaramba.Tests.NUnitExtentReports.ExtentLogger; - using Ocaramba.Tests.PageObjects; - using Ocaramba.Types; - - public class DragAndDropPage : ProjectPageBase - { - private readonly ElementLocator boxA = new ElementLocator(Locator.Id, "column-a"); - private readonly ElementLocator boxB = new ElementLocator(Locator.Id, "column-b"); - private readonly ElementLocator boxBtext = new ElementLocator(Locator.XPath, "//div[@id='column-b']/header"); - private readonly ElementLocator classNameLocator = new ElementLocator(Locator.ClassName, "example"); - - private readonly ElementLocator cssSelectorLocator = new ElementLocator(Locator.CssSelector, "[class='example']"); - - public DragAndDropPage(DriverContext driverContext) - : base(driverContext) - { - } - - public DragAndDropPage MoveElementAtoElementB() - { - ExtentTestLogger.Info("DragAndDropPage: Moving Box A element to Box B"); - this.Driver.DragAndDropJs(this.Driver.GetElement(this.boxA), this.Driver.GetElement(this.boxB)); - return this; - } - - public bool IsElementAMovedToB() - { - return this.Driver.GetElement(this.boxBtext).Text.Equals("A"); - } - } -} +// +// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. +// +// +// The MIT License (MIT) +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// + +namespace Ocaramba.Tests.NUnitExtentReports.PageObjects +{ + using Ocaramba; + using Ocaramba.Extensions; + using Ocaramba.Tests.NUnitExtentReports.ExtentLogger; + using Ocaramba.Tests.PageObjects; + using Ocaramba.Types; + + public class DragAndDropPage : ProjectPageBase + { + private readonly ElementLocator boxA = new ElementLocator(Locator.Id, "column-a"); + private readonly ElementLocator boxB = new ElementLocator(Locator.Id, "column-b"); + private readonly ElementLocator boxBtext = new ElementLocator(Locator.XPath, "//div[@id='column-b']/header"); + private readonly ElementLocator classNameLocator = new ElementLocator(Locator.ClassName, "example"); + + private readonly ElementLocator cssSelectorLocator = new ElementLocator(Locator.CssSelector, "[class='example']"); + + public DragAndDropPage(DriverContext driverContext) + : base(driverContext) + { + } + + public DragAndDropPage MoveElementAtoElementB() + { + ExtentTestLogger.Info("DragAndDropPage: Moving Box A element to Box B"); + this.Driver.DragAndDropJs(this.Driver.GetElement(this.boxA), this.Driver.GetElement(this.boxB)); + return this; + } + + public bool IsElementAMovedToB() + { + return this.Driver.GetElement(this.boxBtext).Text.Equals("A"); + } + } +} diff --git a/Ocaramba.Tests.NUnitExtentReports/PageObject/DropdownPage.cs b/Ocaramba.Tests.NUnitExtentReports/PageObject/DropdownPage.cs index 1f7f67c10..5af39557f 100644 --- a/Ocaramba.Tests.NUnitExtentReports/PageObject/DropdownPage.cs +++ b/Ocaramba.Tests.NUnitExtentReports/PageObject/DropdownPage.cs @@ -1,70 +1,70 @@ -// -// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. -// -// -// The MIT License (MIT) -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// - -namespace Ocaramba.Tests.NUnitExtentReports.PageObjects -{ - using Ocaramba; - using Ocaramba.Extensions; - using Ocaramba.Tests.NUnitExtentReports.ExtentLogger; - using Ocaramba.Tests.PageObjects; - using Ocaramba.Types; - using Ocaramba.WebElements; - - public class DropdownPage : ProjectPageBase - { - private readonly ElementLocator dropDownLocator = new ElementLocator( - Locator.Id, "dropdown"); - - public DropdownPage(DriverContext driverContext) - : base(driverContext) - { - } - - public void SelectByIndex(int index) - { - ExtentTestLogger.Info("DropdownPage: Selecting element on dropdown by index: " + index); - Select select = this.Driver.GetElement(this.dropDownLocator, 300); - select.SelectByValue(value); - } - - public void SelectByText(string text, int timeout) - { - ExtentTestLogger.Info("DropdownPage: Selecting element on dropdown by visible text: " + text); - Select select = this.Driver.GetElement(this.dropDownLocator); - return select.SelectElement().SelectedOption.Text; - } - } -} +// +// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. +// +// +// The MIT License (MIT) +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// + +namespace Ocaramba.Tests.NUnitExtentReports.PageObjects +{ + using Ocaramba; + using Ocaramba.Extensions; + using Ocaramba.Tests.NUnitExtentReports.ExtentLogger; + using Ocaramba.Tests.PageObjects; + using Ocaramba.Types; + using Ocaramba.WebElements; + + public class DropdownPage : ProjectPageBase + { + private readonly ElementLocator dropDownLocator = new ElementLocator( + Locator.Id, "dropdown"); + + public DropdownPage(DriverContext driverContext) + : base(driverContext) + { + } + + public void SelectByIndex(int index) + { + ExtentTestLogger.Info("DropdownPage: Selecting element on dropdown by index: " + index); + Select select = this.Driver.GetElement(this.dropDownLocator, 300); + select.SelectByValue(value); + } + + public void SelectByText(string text, int timeout) + { + ExtentTestLogger.Info("DropdownPage: Selecting element on dropdown by visible text: " + text); + Select select = this.Driver.GetElement(this.dropDownLocator); + return select.SelectElement().SelectedOption.Text; + } + } +} diff --git a/Ocaramba.Tests.NUnitExtentReports/PageObject/InternetPage.cs b/Ocaramba.Tests.NUnitExtentReports/PageObject/InternetPage.cs index d12830085..d2027bca4 100644 --- a/Ocaramba.Tests.NUnitExtentReports/PageObject/InternetPage.cs +++ b/Ocaramba.Tests.NUnitExtentReports/PageObject/InternetPage.cs @@ -1,131 +1,131 @@ -// -// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. -// -// -// The MIT License (MIT) -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// - -namespace Ocaramba.Tests.NUnitExtentReports.PageObjects -{ - using System; - using System.Globalization; - using NLog; - using Ocaramba; - using Ocaramba.Extensions; - using Ocaramba.Tests.NUnitExtentReports.ExtentLogger; - using Ocaramba.Tests.PageObjects; - using Ocaramba.Types; - - public class InternetPage : ProjectPageBase - { - [ThreadStatic] - private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); - - /// - /// Locators for elements - /// - private readonly ElementLocator - linkLocator = new ElementLocator(Locator.CssSelector, "a[href='/{0}']"), - basicAuthLink = new ElementLocator(Locator.XPath, "//a[contains(text(),'Auth')]"), - dropdownPageByLinkTextLocator = new ElementLocator(Locator.LinkText, "Dropdown"), - partialLinkTextLocator = new ElementLocator(Locator.PartialLinkText, "Drag"); - - public InternetPage(DriverContext driverContext) - : base(driverContext) - { - } - - /// - /// Methods for this HomePage - /// - /// Returns HomePage - public InternetPage OpenHomePage() - { - var url = BaseConfiguration.GetUrlValue; - this.Driver.NavigateTo(new Uri(url)); - Logger.Info(CultureInfo.CurrentCulture, "Opening page {0}", url); - return this; - } - - public InternetPage OpenHomePageWithUserCredentials() - { - var url = BaseConfiguration.GetUrlValueWithUserCredentials; - this.Driver.NavigateTo(new Uri(url)); - Logger.Info(CultureInfo.CurrentCulture, "Opening page {0}", url); - ExtentTestLogger.Info("InternetPage: Opening page: " + url); - return this; - } - - public DropdownPage GoToDropdownPage() - { - ExtentTestLogger.Info("InternetPage: Opening Dropdown page"); - this.Driver.GetElement(this.linkLocator.Format("dropdown")).Click(); - return new DropdownPage(this.DriverContext); - } - - public MultipleWindowsPage GoToMultipleWindowsPage() - { - ExtentTestLogger.Info("InternetPage: Opening Multiple Windows page"); - this.Driver.GetElement(this.linkLocator.Format("windows")).Click(); - return new MultipleWindowsPage(this.DriverContext); - } - - public BasicAuthPage GoToBasicAuthPage() - { - ExtentTestLogger.Info("InternetPage: Opening Basic Auth Page"); - this.Driver.GetElement(this.linkLocator.Format("basic_auth")).Click(); - return new BasicAuthPage(this.DriverContext); - } - - public NestedFramesPage GoToNestedFramesPage() - { - ExtentTestLogger.Info("InternetPage: Opening Nested Frames page"); - this.Driver.GetElement(this.linkLocator.Format("nested_frames")).Click(); - return new NestedFramesPage(this.DriverContext); - } - - public TablesPage GoToTablesPage() - { - ExtentTestLogger.Info("InternetPage: Opening Tables page"); - this.Driver.GetElement(this.linkLocator.Format("tables")).Click(); - return new TablesPage(this.DriverContext); - } - - public DragAndDropPage GoToDragAndDropPage() - { - ExtentTestLogger.Info("InternetPage: Opening Drag And Drop page"); - this.Driver.GetElement(this.linkLocator.Format("drag_and_drop")).Click(); - return new DragAndDropPage(this.DriverContext); - } - - public void ChangeBasicAuthLink(string newAttributeValue) - { - ExtentTestLogger.Info("InternetPage: Changing BasicAuthLink to: " + newAttributeValue); - var element = this.Driver.GetElement(this.basicAuthLink); - element.SetAttribute("href", newAttributeValue); - } - - public void BasicAuthLinkClick() - { - ExtentTestLogger.Info("InternetPage: Clicking BasicAuthLink"); - var element = this.Driver.GetElement(this.basicAuthLink); - element.Click(); - } - - } -} +// +// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. +// +// +// The MIT License (MIT) +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// + +namespace Ocaramba.Tests.NUnitExtentReports.PageObjects +{ + using System; + using System.Globalization; + using NLog; + using Ocaramba; + using Ocaramba.Extensions; + using Ocaramba.Tests.NUnitExtentReports.ExtentLogger; + using Ocaramba.Tests.PageObjects; + using Ocaramba.Types; + + public class InternetPage : ProjectPageBase + { + [ThreadStatic] + private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); + + /// + /// Locators for elements + /// + private readonly ElementLocator + linkLocator = new ElementLocator(Locator.CssSelector, "a[href='/{0}']"), + basicAuthLink = new ElementLocator(Locator.XPath, "//a[contains(text(),'Auth')]"), + dropdownPageByLinkTextLocator = new ElementLocator(Locator.LinkText, "Dropdown"), + partialLinkTextLocator = new ElementLocator(Locator.PartialLinkText, "Drag"); + + public InternetPage(DriverContext driverContext) + : base(driverContext) + { + } + + /// + /// Methods for this HomePage + /// + /// Returns HomePage + public InternetPage OpenHomePage() + { + var url = BaseConfiguration.GetUrlValue; + this.Driver.NavigateTo(new Uri(url)); + Logger.Info(CultureInfo.CurrentCulture, "Opening page {0}", url); + return this; + } + + public InternetPage OpenHomePageWithUserCredentials() + { + var url = BaseConfiguration.GetUrlValueWithUserCredentials; + this.Driver.NavigateTo(new Uri(url)); + Logger.Info(CultureInfo.CurrentCulture, "Opening page {0}", url); + ExtentTestLogger.Info("InternetPage: Opening page: " + url); + return this; + } + + public DropdownPage GoToDropdownPage() + { + ExtentTestLogger.Info("InternetPage: Opening Dropdown page"); + this.Driver.GetElement(this.linkLocator.Format("dropdown")).Click(); + return new DropdownPage(this.DriverContext); + } + + public MultipleWindowsPage GoToMultipleWindowsPage() + { + ExtentTestLogger.Info("InternetPage: Opening Multiple Windows page"); + this.Driver.GetElement(this.linkLocator.Format("windows")).Click(); + return new MultipleWindowsPage(this.DriverContext); + } + + public BasicAuthPage GoToBasicAuthPage() + { + ExtentTestLogger.Info("InternetPage: Opening Basic Auth Page"); + this.Driver.GetElement(this.linkLocator.Format("basic_auth")).Click(); + return new BasicAuthPage(this.DriverContext); + } + + public NestedFramesPage GoToNestedFramesPage() + { + ExtentTestLogger.Info("InternetPage: Opening Nested Frames page"); + this.Driver.GetElement(this.linkLocator.Format("nested_frames")).Click(); + return new NestedFramesPage(this.DriverContext); + } + + public TablesPage GoToTablesPage() + { + ExtentTestLogger.Info("InternetPage: Opening Tables page"); + this.Driver.GetElement(this.linkLocator.Format("tables")).Click(); + return new TablesPage(this.DriverContext); + } + + public DragAndDropPage GoToDragAndDropPage() + { + ExtentTestLogger.Info("InternetPage: Opening Drag And Drop page"); + this.Driver.GetElement(this.linkLocator.Format("drag_and_drop")).Click(); + return new DragAndDropPage(this.DriverContext); + } + + public void ChangeBasicAuthLink(string newAttributeValue) + { + ExtentTestLogger.Info("InternetPage: Changing BasicAuthLink to: " + newAttributeValue); + var element = this.Driver.GetElement(this.basicAuthLink); + element.SetAttribute("href", newAttributeValue); + } + + public void BasicAuthLinkClick() + { + ExtentTestLogger.Info("InternetPage: Clicking BasicAuthLink"); + var element = this.Driver.GetElement(this.basicAuthLink); + element.Click(); + } + + } +} diff --git a/Ocaramba.Tests.NUnitExtentReports/PageObject/MultipleWindowsPage.cs b/Ocaramba.Tests.NUnitExtentReports/PageObject/MultipleWindowsPage.cs index a170efe22..d79a4f7a1 100644 --- a/Ocaramba.Tests.NUnitExtentReports/PageObject/MultipleWindowsPage.cs +++ b/Ocaramba.Tests.NUnitExtentReports/PageObject/MultipleWindowsPage.cs @@ -1,52 +1,52 @@ -// -// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. -// -// -// The MIT License (MIT) -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// - -namespace Ocaramba.Tests.NUnitExtentReports.PageObjects -{ - using System; - using Ocaramba; - using Ocaramba.Extensions; - using Ocaramba.Tests.NUnitExtentReports.ExtentLogger; - using Ocaramba.Tests.PageObjects; - using Ocaramba.Types; - - public class MultipleWindowsPage : ProjectPageBase - { - private readonly ElementLocator - clickHerePageLocator = new ElementLocator(Locator.CssSelector, "a[href='/windows/new']"); - - public MultipleWindowsPage(DriverContext driverContext) - : base(driverContext) - { - } - - public NewWindowPage OpenNewWindowPage() - { - const string UriString = "http://the-internet.herokuapp.com/windows/new"; - - ExtentTestLogger.Info("MultipleWindowsPage: Opening new Uri: " + UriString); - this.Driver.GetElement(this.clickHerePageLocator).Click(); - this.Driver.SwitchToWindowUsingUrl(new Uri(UriString), 5); - return new NewWindowPage(this.DriverContext); - } - } -} +// +// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. +// +// +// The MIT License (MIT) +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// + +namespace Ocaramba.Tests.NUnitExtentReports.PageObjects +{ + using System; + using Ocaramba; + using Ocaramba.Extensions; + using Ocaramba.Tests.NUnitExtentReports.ExtentLogger; + using Ocaramba.Tests.PageObjects; + using Ocaramba.Types; + + public class MultipleWindowsPage : ProjectPageBase + { + private readonly ElementLocator + clickHerePageLocator = new ElementLocator(Locator.CssSelector, "a[href='/windows/new']"); + + public MultipleWindowsPage(DriverContext driverContext) + : base(driverContext) + { + } + + public NewWindowPage OpenNewWindowPage() + { + const string UriString = "http://the-internet.herokuapp.com/windows/new"; + + ExtentTestLogger.Info("MultipleWindowsPage: Opening new Uri: " + UriString); + this.Driver.GetElement(this.clickHerePageLocator).Click(); + this.Driver.SwitchToWindowUsingUrl(new Uri(UriString), 5); + return new NewWindowPage(this.DriverContext); + } + } +} diff --git a/Ocaramba.Tests.NUnitExtentReports/PageObject/NestedFramesPage.cs b/Ocaramba.Tests.NUnitExtentReports/PageObject/NestedFramesPage.cs index 70e600a16..f1deff556 100644 --- a/Ocaramba.Tests.NUnitExtentReports/PageObject/NestedFramesPage.cs +++ b/Ocaramba.Tests.NUnitExtentReports/PageObject/NestedFramesPage.cs @@ -1,85 +1,85 @@ -// -// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. -// -// -// The MIT License (MIT) -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// - -namespace Ocaramba.Tests.NUnitExtentReports.PageObjects -{ - using Ocaramba; - using Ocaramba.Extensions; - using Ocaramba.Tests.NUnitExtentReports.ExtentLogger; - using Ocaramba.Tests.PageObjects; - using Ocaramba.Types; - - public class NestedFramesPage : ProjectPageBase - { - private readonly ElementLocator - leftBody = new ElementLocator(Locator.CssSelector, "body"), - middleBody = new ElementLocator(Locator.CssSelector, "div#content"), - rightBody = new ElementLocator(Locator.CssSelector, "body"), - bottomBody = new ElementLocator(Locator.CssSelector, "body"); - - public NestedFramesPage(DriverContext driverContext) - : base(driverContext) - { - } - - public string LeftBody - { - get { return this.Driver.GetElement(this.leftBody).Text; } - } - - public string MiddleBody - { - get { return this.Driver.GetElement(this.middleBody).Text; } - } - - public string RightBody - { - get { return this.Driver.GetElement(this.rightBody).Text; } - } - - public string BottomBody - { - get { return this.Driver.GetElement(this.bottomBody).Text; } - } - - public NestedFramesPage SwitchToFrame(string frame) - { - ExtentTestLogger.Info("NestedFramesPage: Switching to frame: " + frame); - this.Driver.SwitchTo().Frame(frame); - return this; - } - - public NestedFramesPage SwitchToParentFrame() - { - ExtentTestLogger.Info("NestedFramesPage: Switching to parent frame"); - this.Driver.SwitchTo().ParentFrame(); - return this; - } - - public NestedFramesPage ReturnToDefaultContent() - { - ExtentTestLogger.Info("NestedFramesPage: Switching to default content"); - this.Driver.SwitchTo().DefaultContent(); - return this; - } - } -} +// +// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. +// +// +// The MIT License (MIT) +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// + +namespace Ocaramba.Tests.NUnitExtentReports.PageObjects +{ + using Ocaramba; + using Ocaramba.Extensions; + using Ocaramba.Tests.NUnitExtentReports.ExtentLogger; + using Ocaramba.Tests.PageObjects; + using Ocaramba.Types; + + public class NestedFramesPage : ProjectPageBase + { + private readonly ElementLocator + leftBody = new ElementLocator(Locator.CssSelector, "body"), + middleBody = new ElementLocator(Locator.CssSelector, "div#content"), + rightBody = new ElementLocator(Locator.CssSelector, "body"), + bottomBody = new ElementLocator(Locator.CssSelector, "body"); + + public NestedFramesPage(DriverContext driverContext) + : base(driverContext) + { + } + + public string LeftBody + { + get { return this.Driver.GetElement(this.leftBody).Text; } + } + + public string MiddleBody + { + get { return this.Driver.GetElement(this.middleBody).Text; } + } + + public string RightBody + { + get { return this.Driver.GetElement(this.rightBody).Text; } + } + + public string BottomBody + { + get { return this.Driver.GetElement(this.bottomBody).Text; } + } + + public NestedFramesPage SwitchToFrame(string frame) + { + ExtentTestLogger.Info("NestedFramesPage: Switching to frame: " + frame); + this.Driver.SwitchTo().Frame(frame); + return this; + } + + public NestedFramesPage SwitchToParentFrame() + { + ExtentTestLogger.Info("NestedFramesPage: Switching to parent frame"); + this.Driver.SwitchTo().ParentFrame(); + return this; + } + + public NestedFramesPage ReturnToDefaultContent() + { + ExtentTestLogger.Info("NestedFramesPage: Switching to default content"); + this.Driver.SwitchTo().DefaultContent(); + return this; + } + } +} diff --git a/Ocaramba.Tests.NUnitExtentReports/PageObject/TablesPage.cs b/Ocaramba.Tests.NUnitExtentReports/PageObject/TablesPage.cs index 1efaf505e..c612a2ca5 100644 --- a/Ocaramba.Tests.NUnitExtentReports/PageObject/TablesPage.cs +++ b/Ocaramba.Tests.NUnitExtentReports/PageObject/TablesPage.cs @@ -1,55 +1,55 @@ -// -// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. -// -// -// The MIT License (MIT) -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// - -namespace Ocaramba.Tests.NUnitExtentReports.PageObjects -{ - using Ocaramba; - using Ocaramba.Extensions; - using Ocaramba.Tests.NUnitExtentReports.ExtentLogger; - using Ocaramba.Tests.PageObjects; - using Ocaramba.Types; - using Ocaramba.WebElements; - - public class TablesPage : ProjectPageBase - { - /// - /// Locators for elements - /// - private readonly ElementLocator - tableLocator = new ElementLocator(Locator.ClassName, "tablesorter"), - column = new ElementLocator(Locator.CssSelector, "tr td"), - row = new ElementLocator(Locator.CssSelector, "tbody tr"), - tagNameLocator = new ElementLocator(Locator.TagName, "th"), - xPathLocator = new ElementLocator(Locator.XPath, "//span"); - - public TablesPage(DriverContext driverContext) - : base(driverContext) - { - } - - public string[][] GetTableElements() - { - ExtentTestLogger.Info("TablesPage: Getting table elements"); - return this.Driver.GetElement(this.tableLocator).GetTable(this.row, this.column); - } - } -} +// +// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. +// +// +// The MIT License (MIT) +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// + +namespace Ocaramba.Tests.NUnitExtentReports.PageObjects +{ + using Ocaramba; + using Ocaramba.Extensions; + using Ocaramba.Tests.NUnitExtentReports.ExtentLogger; + using Ocaramba.Tests.PageObjects; + using Ocaramba.Types; + using Ocaramba.WebElements; + + public class TablesPage : ProjectPageBase + { + /// + /// Locators for elements + /// + private readonly ElementLocator + tableLocator = new ElementLocator(Locator.ClassName, "tablesorter"), + column = new ElementLocator(Locator.CssSelector, "tr td"), + row = new ElementLocator(Locator.CssSelector, "tbody tr"), + tagNameLocator = new ElementLocator(Locator.TagName, "th"), + xPathLocator = new ElementLocator(Locator.XPath, "//span"); + + public TablesPage(DriverContext driverContext) + : base(driverContext) + { + } + + public string[][] GetTableElements() + { + ExtentTestLogger.Info("TablesPage: Getting table elements"); + return this.Driver.GetElement
(this.tableLocator).GetTable(this.row, this.column); + } + } +} diff --git a/Ocaramba.Tests.NUnitExtentReports/TestExecutionManager.cs b/Ocaramba.Tests.NUnitExtentReports/TestExecutionManager.cs index f513e45db..0ec8ba91f 100644 --- a/Ocaramba.Tests.NUnitExtentReports/TestExecutionManager.cs +++ b/Ocaramba.Tests.NUnitExtentReports/TestExecutionManager.cs @@ -1,49 +1,49 @@ -using System.IO; -using AventStack.ExtentReports; -using AventStack.ExtentReports.Reporter; -using AventStack.ExtentReports.Reporter.Config; -using NUnit.Framework; - -namespace Ocaramba.Tests.NUnitExtentReports -{ - /// - /// Class containing setup and teardown definitions which are executed only once before and after entire test suite is executed - /// - [SetUpFixture] - class TestExecutionManager : TestBase - { - protected readonly DriverContext driverContext = new DriverContext(); - public static ExtentReports extent; - - protected DriverContext DriverContext - { - get - { - return this.driverContext; - } - } - - /// - /// Method executed once only before all the tests are started - /// - [OneTimeSetUp] - public void BeforeSuite() - { - this.DriverContext.CurrentDirectory = Directory.GetCurrentDirectory(); - extent = new ExtentReports(); - var reporter = new ExtentSparkReporter(this.DriverContext.CurrentDirectory + "\\TestOutput\\index.html"); - reporter.Config.ReportName = "Ocaramba UITests Report - " + BaseConfiguration.TestBrowser; - reporter.Config.Theme = Theme.Standard; - extent.AttachReporter(reporter); - } - - /// - /// Method executed once only after all the tests are finished - /// - [OneTimeTearDown] - public void AfterSuite() - { - extent.Flush(); - } - } +using System.IO; +using AventStack.ExtentReports; +using AventStack.ExtentReports.Reporter; +using AventStack.ExtentReports.Reporter.Config; +using NUnit.Framework; + +namespace Ocaramba.Tests.NUnitExtentReports +{ + /// + /// Class containing setup and teardown definitions which are executed only once before and after entire test suite is executed + /// + [SetUpFixture] + class TestExecutionManager : TestBase + { + protected readonly DriverContext driverContext = new DriverContext(); + public static ExtentReports extent; + + protected DriverContext DriverContext + { + get + { + return this.driverContext; + } + } + + /// + /// Method executed once only before all the tests are started + /// + [OneTimeSetUp] + public void BeforeSuite() + { + this.DriverContext.CurrentDirectory = Directory.GetCurrentDirectory(); + extent = new ExtentReports(); + var reporter = new ExtentSparkReporter(this.DriverContext.CurrentDirectory + "\\TestOutput\\index.html"); + reporter.Config.ReportName = "Ocaramba UITests Report - " + BaseConfiguration.TestBrowser; + reporter.Config.Theme = Theme.Standard; + extent.AttachReporter(reporter); + } + + /// + /// Method executed once only after all the tests are finished + /// + [OneTimeTearDown] + public void AfterSuite() + { + extent.Flush(); + } + } } \ No newline at end of file diff --git a/Ocaramba.Tests.NUnitExtentReports/Tests/HerokuappTestsNUnit.cs b/Ocaramba.Tests.NUnitExtentReports/Tests/HerokuappTestsNUnit.cs index 79d61b8a7..4997b3deb 100644 --- a/Ocaramba.Tests.NUnitExtentReports/Tests/HerokuappTestsNUnit.cs +++ b/Ocaramba.Tests.NUnitExtentReports/Tests/HerokuappTestsNUnit.cs @@ -1,172 +1,172 @@ -// -// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. -// -// -// The MIT License (MIT) -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// - -namespace Ocaramba.Tests.NUnitExtentReports.Tests -{ - using global::NUnit.Framework; - using Ocaramba; - using Ocaramba.Tests.NUnitExtentReports; - using Ocaramba.Tests.NUnitExtentReports.PageObjects; - - [TestFixture] - [Category("BasicNUnit")] - [Parallelizable(ParallelScope.Fixtures)] - public class HerokuappTestsNUnit : ProjectTestBase - { - - [Test] - public void BasicAuthTest() - { - const string ExpectedCongratulationsInfo = "Congratulations! You must have the proper credentials."; - - var basicAuthPage = - new InternetPage(this.DriverContext).OpenHomePageWithUserCredentials().GoToBasicAuthPage(); - - test.Info("Verifying congratulations info, expected: " + ExpectedCongratulationsInfo); - Verify.That( - this.DriverContext, - () => - Assert.That(basicAuthPage.GetCongratulationsInfo, Is.EqualTo(ExpectedCongratulationsInfo))); - } - - [Test] - public void MultipleWindowsTest() - { - const string PageTitle = "New Window"; - - var newWindowPage = new InternetPage(this.DriverContext) - .OpenHomePage() - .GoToMultipleWindowsPage() - .OpenNewWindowPage(); - - test.Info("Verifying page title, expected: " + PageTitle); - Assert.That(newWindowPage.IsPageTile(PageTitle), Is.True, "wrong page title, should be {0}", PageTitle); - - test.Info("Verifying H3 header text displayd on te page, expected: " + PageTitle); - Assert.That(newWindowPage.IsNewWindowH3TextVisible(PageTitle), Is.True, "text is not equal to {0}", PageTitle); - } - - [Test] - public void NestedFramesTest() - { - const string ExpectedLeftFrameText = "LEFT"; - const string ExpectedMiddleFrameText = "MIDDLE"; - const string ExpectedRightFrameText = "RIGHT"; - const string ExpectedBottomFrameText = "BOTTOM"; - - var nestedFramesPage = new InternetPage(this.DriverContext) - .OpenHomePage() - .GoToNestedFramesPage() - .SwitchToFrame("frame-top"); - - nestedFramesPage.SwitchToFrame("frame-left"); - - test.Info("Verifying text displayed in left frame, expected: " + ExpectedLeftFrameText); - Assert.That(nestedFramesPage.LeftBody, Is.EqualTo(ExpectedLeftFrameText)); - - nestedFramesPage.SwitchToParentFrame().SwitchToFrame("frame-middle"); - - test.Info("Verifying text displayed in middle frame, expected: " + ExpectedMiddleFrameText); - Assert.That(nestedFramesPage.MiddleBody, Is.EqualTo(ExpectedMiddleFrameText)); - - nestedFramesPage.SwitchToParentFrame().SwitchToFrame("frame-right"); - - test.Info("Verifying text displayed in right frame, expected: " + ExpectedRightFrameText); - Assert.That(nestedFramesPage.RightBody, Is.EqualTo(ExpectedRightFrameText)); - - nestedFramesPage.ReturnToDefaultContent().SwitchToFrame("frame-bottom"); - - test.Info("Verifying text displayed in bottom frame, expected: " + ExpectedBottomFrameText); - Assert.That(nestedFramesPage.BottomBody, Is.EqualTo(ExpectedBottomFrameText)); - } - - [Test] - public void SetAttributeTest() - { - const string PageHeader = "Broken Images"; - - var internetPage = new InternetPage(this.DriverContext) - .OpenHomePage(); - - internetPage.ChangeBasicAuthLink("/broken_images"); - internetPage.BasicAuthLinkClick(); - - var brokenImagesPage = new BrokenImagesPage(this.DriverContext); - - test.Info("Verifying page header, expected: " + PageHeader); - Assert.That(brokenImagesPage.IsPageHeaderElementEqualsToExpected(PageHeader), - Is.True, "Page header element is not equal to expected " + PageHeader); - } - - [Test] - public void TablesTest() - { - const string ExpectedSurname = "Smith"; - const string ExpectedActionLinks = "edit delete"; - - var tableElements = new InternetPage(this.DriverContext) - .OpenHomePage() - .GoToTablesPage(); - var table = tableElements.GetTableElements(); - - test.Info("Verifying surname displayed in the table, expected: " + ExpectedSurname); - Assert.That(table[0][0], Is.EqualTo(ExpectedSurname)); - - test.Info("Verifying action links displayed in the table, expected: " + ExpectedActionLinks); - Assert.That(table[3][5], Is.EqualTo(ExpectedActionLinks)); - } - - [Test] - public void DragAndDropTest() - { - var dragAndDrop = new InternetPage(this.DriverContext) - .OpenHomePage() - .GoToDragAndDropPage() - .MoveElementAtoElementB(); - - test.Info("Verifying element A was moved to element B"); - Assert.That(dragAndDrop.IsElementAMovedToB(), Is.True, "Element is not moved."); - } - - [Test] - public void ReportDemoFailingTest() - { - const string ExpectedLeftFrameText = "LEFT"; - const string ExpectedMiddleFrameText = "CENTER"; - - var nestedFramesPage = new InternetPage(this.DriverContext) - .OpenHomePage() - .GoToNestedFramesPage() - .SwitchToFrame("frame-top"); - - nestedFramesPage.SwitchToFrame("frame-left"); - - test.Info("Verifying text displayed in left frame, expected: " + ExpectedLeftFrameText); - Assert.That(nestedFramesPage.LeftBody, Is.EqualTo(ExpectedLeftFrameText)); - - nestedFramesPage.SwitchToParentFrame().SwitchToFrame("frame-middle"); - - test.Info("Verifying text displayed in middle frame, expected: " + ExpectedMiddleFrameText); - Assert.That(nestedFramesPage.MiddleBody, Is.EqualTo(ExpectedMiddleFrameText)); - } - } -} +// +// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. +// +// +// The MIT License (MIT) +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// + +namespace Ocaramba.Tests.NUnitExtentReports.Tests +{ + using global::NUnit.Framework; + using Ocaramba; + using Ocaramba.Tests.NUnitExtentReports; + using Ocaramba.Tests.NUnitExtentReports.PageObjects; + + [TestFixture] + [Category("BasicNUnit")] + [Parallelizable(ParallelScope.Fixtures)] + public class HerokuappTestsNUnit : ProjectTestBase + { + + [Test] + public void BasicAuthTest() + { + const string ExpectedCongratulationsInfo = "Congratulations! You must have the proper credentials."; + + var basicAuthPage = + new InternetPage(this.DriverContext).OpenHomePageWithUserCredentials().GoToBasicAuthPage(); + + test.Info("Verifying congratulations info, expected: " + ExpectedCongratulationsInfo); + Verify.That( + this.DriverContext, + () => + Assert.That(basicAuthPage.GetCongratulationsInfo, Is.EqualTo(ExpectedCongratulationsInfo))); + } + + [Test] + public void MultipleWindowsTest() + { + const string PageTitle = "New Window"; + + var newWindowPage = new InternetPage(this.DriverContext) + .OpenHomePage() + .GoToMultipleWindowsPage() + .OpenNewWindowPage(); + + test.Info("Verifying page title, expected: " + PageTitle); + Assert.That(newWindowPage.IsPageTile(PageTitle), Is.True, "wrong page title, should be {0}", PageTitle); + + test.Info("Verifying H3 header text displayd on te page, expected: " + PageTitle); + Assert.That(newWindowPage.IsNewWindowH3TextVisible(PageTitle), Is.True, "text is not equal to {0}", PageTitle); + } + + [Test] + public void NestedFramesTest() + { + const string ExpectedLeftFrameText = "LEFT"; + const string ExpectedMiddleFrameText = "MIDDLE"; + const string ExpectedRightFrameText = "RIGHT"; + const string ExpectedBottomFrameText = "BOTTOM"; + + var nestedFramesPage = new InternetPage(this.DriverContext) + .OpenHomePage() + .GoToNestedFramesPage() + .SwitchToFrame("frame-top"); + + nestedFramesPage.SwitchToFrame("frame-left"); + + test.Info("Verifying text displayed in left frame, expected: " + ExpectedLeftFrameText); + Assert.That(nestedFramesPage.LeftBody, Is.EqualTo(ExpectedLeftFrameText)); + + nestedFramesPage.SwitchToParentFrame().SwitchToFrame("frame-middle"); + + test.Info("Verifying text displayed in middle frame, expected: " + ExpectedMiddleFrameText); + Assert.That(nestedFramesPage.MiddleBody, Is.EqualTo(ExpectedMiddleFrameText)); + + nestedFramesPage.SwitchToParentFrame().SwitchToFrame("frame-right"); + + test.Info("Verifying text displayed in right frame, expected: " + ExpectedRightFrameText); + Assert.That(nestedFramesPage.RightBody, Is.EqualTo(ExpectedRightFrameText)); + + nestedFramesPage.ReturnToDefaultContent().SwitchToFrame("frame-bottom"); + + test.Info("Verifying text displayed in bottom frame, expected: " + ExpectedBottomFrameText); + Assert.That(nestedFramesPage.BottomBody, Is.EqualTo(ExpectedBottomFrameText)); + } + + [Test] + public void SetAttributeTest() + { + const string PageHeader = "Broken Images"; + + var internetPage = new InternetPage(this.DriverContext) + .OpenHomePage(); + + internetPage.ChangeBasicAuthLink("/broken_images"); + internetPage.BasicAuthLinkClick(); + + var brokenImagesPage = new BrokenImagesPage(this.DriverContext); + + test.Info("Verifying page header, expected: " + PageHeader); + Assert.That(brokenImagesPage.IsPageHeaderElementEqualsToExpected(PageHeader), + Is.True, "Page header element is not equal to expected " + PageHeader); + } + + [Test] + public void TablesTest() + { + const string ExpectedSurname = "Smith"; + const string ExpectedActionLinks = "edit delete"; + + var tableElements = new InternetPage(this.DriverContext) + .OpenHomePage() + .GoToTablesPage(); + var table = tableElements.GetTableElements(); + + test.Info("Verifying surname displayed in the table, expected: " + ExpectedSurname); + Assert.That(table[0][0], Is.EqualTo(ExpectedSurname)); + + test.Info("Verifying action links displayed in the table, expected: " + ExpectedActionLinks); + Assert.That(table[3][5], Is.EqualTo(ExpectedActionLinks)); + } + + [Test] + public void DragAndDropTest() + { + var dragAndDrop = new InternetPage(this.DriverContext) + .OpenHomePage() + .GoToDragAndDropPage() + .MoveElementAtoElementB(); + + test.Info("Verifying element A was moved to element B"); + Assert.That(dragAndDrop.IsElementAMovedToB(), Is.True, "Element is not moved."); + } + + [Test] + public void ReportDemoFailingTest() + { + const string ExpectedLeftFrameText = "LEFT"; + const string ExpectedMiddleFrameText = "CENTER"; + + var nestedFramesPage = new InternetPage(this.DriverContext) + .OpenHomePage() + .GoToNestedFramesPage() + .SwitchToFrame("frame-top"); + + nestedFramesPage.SwitchToFrame("frame-left"); + + test.Info("Verifying text displayed in left frame, expected: " + ExpectedLeftFrameText); + Assert.That(nestedFramesPage.LeftBody, Is.EqualTo(ExpectedLeftFrameText)); + + nestedFramesPage.SwitchToParentFrame().SwitchToFrame("frame-middle"); + + test.Info("Verifying text displayed in middle frame, expected: " + ExpectedMiddleFrameText); + Assert.That(nestedFramesPage.MiddleBody, Is.EqualTo(ExpectedMiddleFrameText)); + } + } +} diff --git a/Ocaramba.Tests.NUnitExtentReports/Tests/SelectWebElementTests.cs b/Ocaramba.Tests.NUnitExtentReports/Tests/SelectWebElementTests.cs index bd74f2633..71b2661d8 100644 --- a/Ocaramba.Tests.NUnitExtentReports/Tests/SelectWebElementTests.cs +++ b/Ocaramba.Tests.NUnitExtentReports/Tests/SelectWebElementTests.cs @@ -1,69 +1,69 @@ -// -// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. -// - -namespace Ocaramba.Tests.NUnitExtentReports.Tests -{ - using global::NUnit.Framework; - using Ocaramba.Tests.NUnitExtentReports; - using Ocaramba.Tests.NUnitExtentReports.PageObjects; - - [TestFixture] - [Parallelizable(ParallelScope.Fixtures)] - public class SelectWebElementTests : ProjectTestBase - { - [Test] - public void SelectByIndexTest() - { - const string ExpectedOption = "Option 1"; - - var dropdownPage = new InternetPage(this.DriverContext) - .OpenHomePage() - .GoToDropdownPage(); - - dropdownPage.SelectByIndex(1); - - Assert.That(dropdownPage.SelectedOption(), Is.EqualTo(ExpectedOption)); - test.Info("Verifying selected option, expected: " + ExpectedOption); - } - - [Test] - public void NoSuchElementExceptionByTextTest() - { - const string ElementText = "Qwerty."; - - var dropdownPage = new InternetPage(this.DriverContext) - .OpenHomePage() - .GoToDropdownPage(); - - Assert.That(() => dropdownPage.SelectByText(ElementText, 10), Throws.Nothing); - test.Info("Verifying it's possible to select element on dropdown by text: " + ElementText); - } - - [Test] - public void NoSuchElementExceptionByIndexTest() - { - const int ElementIndex = 7; - - var dropdownPage = new InternetPage(this.DriverContext) - .OpenHomePage() - .GoToDropdownPage(); - - Assert.That(() => dropdownPage.SelectByIndex(ElementIndex), Throws.Nothing); - test.Info("Verifying it's possible to select element on dropdown by element index: " + ElementIndex.ToString()); - } - - [Test] - public void NoSuchElementExceptionByValueTest() - { - const string ElementValue = "qwerty"; - - var dropdownPage = new InternetPage(this.DriverContext) - .OpenHomePage() - .GoToDropdownPage(); - - Assert.That(() => dropdownPage.SelectByValue(ElementValue), Throws.Nothing); - test.Info("Verifying it's possible to select element on dropdown by value: " + ElementValue); - } - } +// +// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. +// + +namespace Ocaramba.Tests.NUnitExtentReports.Tests +{ + using global::NUnit.Framework; + using Ocaramba.Tests.NUnitExtentReports; + using Ocaramba.Tests.NUnitExtentReports.PageObjects; + + [TestFixture] + [Parallelizable(ParallelScope.Fixtures)] + public class SelectWebElementTests : ProjectTestBase + { + [Test] + public void SelectByIndexTest() + { + const string ExpectedOption = "Option 1"; + + var dropdownPage = new InternetPage(this.DriverContext) + .OpenHomePage() + .GoToDropdownPage(); + + dropdownPage.SelectByIndex(1); + + Assert.That(dropdownPage.SelectedOption(), Is.EqualTo(ExpectedOption)); + test.Info("Verifying selected option, expected: " + ExpectedOption); + } + + [Test] + public void NoSuchElementExceptionByTextTest() + { + const string ElementText = "Qwerty."; + + var dropdownPage = new InternetPage(this.DriverContext) + .OpenHomePage() + .GoToDropdownPage(); + + Assert.That(() => dropdownPage.SelectByText(ElementText, 10), Throws.Nothing); + test.Info("Verifying it's possible to select element on dropdown by text: " + ElementText); + } + + [Test] + public void NoSuchElementExceptionByIndexTest() + { + const int ElementIndex = 7; + + var dropdownPage = new InternetPage(this.DriverContext) + .OpenHomePage() + .GoToDropdownPage(); + + Assert.That(() => dropdownPage.SelectByIndex(ElementIndex), Throws.Nothing); + test.Info("Verifying it's possible to select element on dropdown by element index: " + ElementIndex.ToString()); + } + + [Test] + public void NoSuchElementExceptionByValueTest() + { + const string ElementValue = "qwerty"; + + var dropdownPage = new InternetPage(this.DriverContext) + .OpenHomePage() + .GoToDropdownPage(); + + Assert.That(() => dropdownPage.SelectByValue(ElementValue), Throws.Nothing); + test.Info("Verifying it's possible to select element on dropdown by value: " + ElementValue); + } + } } \ No newline at end of file diff --git a/Ocaramba.Tests.PageObjects/Ocaramba.Tests.PageObjects.csproj b/Ocaramba.Tests.PageObjects/Ocaramba.Tests.PageObjects.csproj index 49a09f514..c00759df9 100644 --- a/Ocaramba.Tests.PageObjects/Ocaramba.Tests.PageObjects.csproj +++ b/Ocaramba.Tests.PageObjects/Ocaramba.Tests.PageObjects.csproj @@ -1,52 +1,52 @@ - - - - net8.0 - net472;net8.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - net8_0 - - - - net47 - - - - - ..\Ocaramba\fxcop-sonarqube.tests.ruleset - - - - ..\Ocaramba\fxcop-sonarqube.tests.ruleset - - - true - - + + + + net8.0 + net472;net8.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + net8_0 + + + + net47 + + + + + ..\Ocaramba\fxcop-sonarqube.tests.ruleset + + + + ..\Ocaramba\fxcop-sonarqube.tests.ruleset + + + true + + diff --git a/Ocaramba.Tests.Xunit/Ocaramba.Tests.Xunit.csproj b/Ocaramba.Tests.Xunit/Ocaramba.Tests.Xunit.csproj index ca949b327..a9d6d6b98 100644 --- a/Ocaramba.Tests.Xunit/Ocaramba.Tests.Xunit.csproj +++ b/Ocaramba.Tests.Xunit/Ocaramba.Tests.Xunit.csproj @@ -1,76 +1,76 @@ - - - - net8.0 - net472;net8.0 - - - - - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - - - - - - Always - - - Always - - - Always - - - - - net8_0 - - - - net47 - - - - ..\Ocaramba\fxcop-sonarqube.tests.ruleset - - - - ..\Ocaramba\fxcop-sonarqube.tests.ruleset - - - true - + + + + net8.0 + net472;net8.0 + + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + + Always + + + Always + + + Always + + + + + net8_0 + + + + net47 + + + + ..\Ocaramba\fxcop-sonarqube.tests.ruleset + + + + ..\Ocaramba\fxcop-sonarqube.tests.ruleset + + + true + \ No newline at end of file diff --git a/Ocaramba.UnitTests/App.config b/Ocaramba.UnitTests/App.config index ca213d8be..527d19985 100644 --- a/Ocaramba.UnitTests/App.config +++ b/Ocaramba.UnitTests/App.config @@ -1,128 +1,128 @@ - - - -
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - add key="FirefoxPluginName.xpi" value=""/--> - - - - - - - - - - add key="ChromePluginName.crx" value=""/--> - - - add key="CapabilityName" value=""/--> - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + +
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + add key="FirefoxPluginName.xpi" value=""/--> + + + + + + + + + + add key="ChromePluginName.crx" value=""/--> + + + add key="CapabilityName" value=""/--> + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ocaramba.UnitTests/Ocaramba.UnitTests.csproj b/Ocaramba.UnitTests/Ocaramba.UnitTests.csproj index 9f63e504d..8a7d2b235 100644 --- a/Ocaramba.UnitTests/Ocaramba.UnitTests.csproj +++ b/Ocaramba.UnitTests/Ocaramba.UnitTests.csproj @@ -1,74 +1,74 @@ - - - -net8.0 -net472;net8.0 - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - - - - - - - - - - - - Always - - - Always - - - Always - - - PreserveNewest - - - - - net8_0 - - - - net47 - - - - ..\Ocaramba\fxcop-sonarqube.tests.ruleset - - - - ..\Ocaramba\fxcop-sonarqube.tests.ruleset - - - true - - + + + +net8.0 +net472;net8.0 + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + + + + + + + + Always + + + Always + + + Always + + + PreserveNewest + + + + + net8_0 + + + + net47 + + + + ..\Ocaramba\fxcop-sonarqube.tests.ruleset + + + + ..\Ocaramba\fxcop-sonarqube.tests.ruleset + + + true + + diff --git a/Ocaramba.UnitTests/Tests/DateHelperTests.cs b/Ocaramba.UnitTests/Tests/DateHelperTests.cs index fa76a636c..457560c3e 100644 --- a/Ocaramba.UnitTests/Tests/DateHelperTests.cs +++ b/Ocaramba.UnitTests/Tests/DateHelperTests.cs @@ -1,36 +1,36 @@ -using System; -using System.Globalization; -using NUnit.Framework; -using Ocaramba.Helpers; - -namespace Ocaramba.UnitTests.Tests -{ - [TestFixture()] - [TestFixture, Parallelizable(ParallelScope.Self)] - public class DateHelperTests - { - [Test()] - public void TomorrowDateTest() - { - Assert.That(DateHelper.TomorrowDate, Is.EqualTo(DateTime.Now.AddDays(1).ToString("ddMMyyyy", CultureInfo.CurrentCulture))); - } - - [Test()] - public void CurrentDateTest() - { - Assert.That(DateHelper.CurrentDate, Is.EqualTo(DateTime.Now.ToString("dd-MM-yyyy", CultureInfo.CurrentCulture))); - } - - [Test()] - public void CurrentTimeStampTest() - { - Assert.That(DateTime.Now, Is.EqualTo(DateTime.ParseExact(DateHelper.CurrentTimeStamp, "ddMMyyyyHHmmss", null))); - } - - [Test()] - public void GetFutureDateTest() - { - Assert.That(DateHelper.GetFutureDate(3), Is.EqualTo(DateTime.Now.AddDays(3).ToString("ddMMyyyy", CultureInfo.CurrentCulture))); - } - } +using System; +using System.Globalization; +using NUnit.Framework; +using Ocaramba.Helpers; + +namespace Ocaramba.UnitTests.Tests +{ + [TestFixture()] + [TestFixture, Parallelizable(ParallelScope.Self)] + public class DateHelperTests + { + [Test()] + public void TomorrowDateTest() + { + Assert.That(DateHelper.TomorrowDate, Is.EqualTo(DateTime.Now.AddDays(1).ToString("ddMMyyyy", CultureInfo.CurrentCulture))); + } + + [Test()] + public void CurrentDateTest() + { + Assert.That(DateHelper.CurrentDate, Is.EqualTo(DateTime.Now.ToString("dd-MM-yyyy", CultureInfo.CurrentCulture))); + } + + [Test()] + public void CurrentTimeStampTest() + { + Assert.That(DateTime.Now, Is.EqualTo(DateTime.ParseExact(DateHelper.CurrentTimeStamp, "ddMMyyyyHHmmss", null))); + } + + [Test()] + public void GetFutureDateTest() + { + Assert.That(DateHelper.GetFutureDate(3), Is.EqualTo(DateTime.Now.AddDays(3).ToString("ddMMyyyy", CultureInfo.CurrentCulture))); + } + } } \ No newline at end of file diff --git a/Ocaramba.UnitTests/Tests/DriversCustomSettingsUnitTests.cs b/Ocaramba.UnitTests/Tests/DriversCustomSettingsUnitTests.cs index 3713f67b7..ac31f8bf7 100644 --- a/Ocaramba.UnitTests/Tests/DriversCustomSettingsUnitTests.cs +++ b/Ocaramba.UnitTests/Tests/DriversCustomSettingsUnitTests.cs @@ -1,55 +1,55 @@ -// -// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. -// -// -// The MIT License (MIT) -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// - -using System.IO; -using NUnit.Framework; -using Ocaramba.Extensions; - -namespace Ocaramba.UnitTests.Tests -{ - [TestFixture, Parallelizable(ParallelScope.Fixtures)] - public class DriversCustomSettingsUnitTests - { - [Test] - public void CheckSynchronizationWithAngularFuctionality() - { -#if net8_0 - string folder = Directory.GetCurrentDirectory(); -#endif - -#if net47 - string folder = TestContext.CurrentContext.TestDirectory; -#endif - var driverContext = new Ocaramba.DriverContext {CurrentDirectory = folder }; - driverContext.Start(); - var Default_false = DriversCustomSettings.IsDriverSynchronizationWithAngular(driverContext.Driver); - driverContext.Driver.SynchronizeWithAngular(true); - var TurnOn_true = DriversCustomSettings.IsDriverSynchronizationWithAngular(driverContext.Driver); - driverContext.Driver.SynchronizeWithAngular(false); - var TurnOn_false = DriversCustomSettings.IsDriverSynchronizationWithAngular(driverContext.Driver); - driverContext.Stop(); - Assert.That("Default setting is not false", Is.EqualTo(Default_false)); - Assert.That("Setting is not true", Is.EqualTo(TurnOn_true)); - Assert.That("Setting is not false", Is.EqualTo(TurnOn_false)); - } - } -} +// +// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. +// +// +// The MIT License (MIT) +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// + +using System.IO; +using NUnit.Framework; +using Ocaramba.Extensions; + +namespace Ocaramba.UnitTests.Tests +{ + [TestFixture, Parallelizable(ParallelScope.Fixtures)] + public class DriversCustomSettingsUnitTests + { + [Test] + public void CheckSynchronizationWithAngularFuctionality() + { +#if net8_0 + string folder = Directory.GetCurrentDirectory(); +#endif + +#if net47 + string folder = TestContext.CurrentContext.TestDirectory; +#endif + var driverContext = new Ocaramba.DriverContext {CurrentDirectory = folder }; + driverContext.Start(); + var Default_false = DriversCustomSettings.IsDriverSynchronizationWithAngular(driverContext.Driver); + driverContext.Driver.SynchronizeWithAngular(true); + var TurnOn_true = DriversCustomSettings.IsDriverSynchronizationWithAngular(driverContext.Driver); + driverContext.Driver.SynchronizeWithAngular(false); + var TurnOn_false = DriversCustomSettings.IsDriverSynchronizationWithAngular(driverContext.Driver); + driverContext.Stop(); + Assert.That("Default setting is not false", Is.EqualTo(Default_false)); + Assert.That("Setting is not true", Is.EqualTo(TurnOn_true)); + Assert.That("Setting is not false", Is.EqualTo(TurnOn_false)); + } + } +} diff --git a/Ocaramba.UnitTests/Tests/FilesHelperTests.cs b/Ocaramba.UnitTests/Tests/FilesHelperTests.cs index 448e8a225..55108c58c 100644 --- a/Ocaramba.UnitTests/Tests/FilesHelperTests.cs +++ b/Ocaramba.UnitTests/Tests/FilesHelperTests.cs @@ -1,85 +1,85 @@ -using System; -using System.IO; -using NUnit.Framework; -using Ocaramba.Exceptions; -using Ocaramba.Helpers; - -namespace Ocaramba.UnitTests.Tests -{ - [TestFixture()] - [TestFixture, Parallelizable(ParallelScope.Self)] - public class FilesHelperTests - { -#if net8_0 - string folder = Directory.GetCurrentDirectory(); -#endif - -#if net47 - string folder = TestContext.CurrentContext.TestDirectory; -#endif - [Test()] - public void GetFilesOfGivenTypeFromAllSubFolderTest() - { - var files = FilesHelper.GetFilesOfGivenTypeFromAllSubFolders(folder, - FileType.Xlsx); - Assert.That(files.Count, Is.GreaterThan(0)); - } - - [Test()] - public void GetFilesOfGivenTypeFromAllSubFoldersTest() - { - var files = FilesHelper.GetFilesOfGivenTypeFromAllSubFolders(folder, - FileType.Xml, "Driven"); - Assert.That(files.Count, Is.GreaterThan(0)); - } - - [Test()] - public void GetAllFilesFromAllSubFoldersTest() - { - var files = FilesHelper.GetAllFilesFromAllSubFolders(folder); - Assert.That(files.Count, Is.GreaterThan(0)); - } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] - [Test()] - public void GetAllFilesFromAllSubFoldersPrefixTest() - { - var files = FilesHelper.GetAllFilesFromAllSubFolders(folder, - "*.dll"); - Assert.That(files.Count, Is.GreaterThan(0)); - File.Create(folder + FilesHelper.Separator + "testfile.txt"); - - } - - [Test()] - public void RenameDeleteFileTest() - { - string path = Path.Combine(folder, "testfile1.txt"); - File.Create(path).Close(); - path = Path.Combine(folder, "testfile2.txt"); - File.Create(path).Close(); - FilesHelper.RenameFile(BaseConfiguration.ShortTimeout, "testfile1.txt", "testfile2.txt", - folder); - } - - [Test()] - public void CopyDeleteFileTest() - { - string path = Path.Combine(folder, "testfile3.txt"); - File.Create(path).Close(); - path = Path.Combine(folder, "testfile4.txt"); - File.Create(path).Close(); - FilesHelper.CopyFile(BaseConfiguration.ShortTimeout, "testfile3.txt", "testfile4.txt", - folder); - } - - [Test()] - public void WaitForFileOfGivenNameExceptionTest() - { - var start = DateTime.Now; - Assert.Throws(() => FilesHelper.WaitForFileOfGivenName("nofile.txt", folder)); - var stop = DateTime.Now; - Assert.That(stop - start, Is.LessThanOrEqualTo(TimeSpan.FromSeconds(BaseConfiguration.LongTimeout + 2))); - } - } +using System; +using System.IO; +using NUnit.Framework; +using Ocaramba.Exceptions; +using Ocaramba.Helpers; + +namespace Ocaramba.UnitTests.Tests +{ + [TestFixture()] + [TestFixture, Parallelizable(ParallelScope.Self)] + public class FilesHelperTests + { +#if net8_0 + string folder = Directory.GetCurrentDirectory(); +#endif + +#if net47 + string folder = TestContext.CurrentContext.TestDirectory; +#endif + [Test()] + public void GetFilesOfGivenTypeFromAllSubFolderTest() + { + var files = FilesHelper.GetFilesOfGivenTypeFromAllSubFolders(folder, + FileType.Xlsx); + Assert.That(files.Count, Is.GreaterThan(0)); + } + + [Test()] + public void GetFilesOfGivenTypeFromAllSubFoldersTest() + { + var files = FilesHelper.GetFilesOfGivenTypeFromAllSubFolders(folder, + FileType.Xml, "Driven"); + Assert.That(files.Count, Is.GreaterThan(0)); + } + + [Test()] + public void GetAllFilesFromAllSubFoldersTest() + { + var files = FilesHelper.GetAllFilesFromAllSubFolders(folder); + Assert.That(files.Count, Is.GreaterThan(0)); + } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] + [Test()] + public void GetAllFilesFromAllSubFoldersPrefixTest() + { + var files = FilesHelper.GetAllFilesFromAllSubFolders(folder, + "*.dll"); + Assert.That(files.Count, Is.GreaterThan(0)); + File.Create(folder + FilesHelper.Separator + "testfile.txt"); + + } + + [Test()] + public void RenameDeleteFileTest() + { + string path = Path.Combine(folder, "testfile1.txt"); + File.Create(path).Close(); + path = Path.Combine(folder, "testfile2.txt"); + File.Create(path).Close(); + FilesHelper.RenameFile(BaseConfiguration.ShortTimeout, "testfile1.txt", "testfile2.txt", + folder); + } + + [Test()] + public void CopyDeleteFileTest() + { + string path = Path.Combine(folder, "testfile3.txt"); + File.Create(path).Close(); + path = Path.Combine(folder, "testfile4.txt"); + File.Create(path).Close(); + FilesHelper.CopyFile(BaseConfiguration.ShortTimeout, "testfile3.txt", "testfile4.txt", + folder); + } + + [Test()] + public void WaitForFileOfGivenNameExceptionTest() + { + var start = DateTime.Now; + Assert.Throws(() => FilesHelper.WaitForFileOfGivenName("nofile.txt", folder)); + var stop = DateTime.Now; + Assert.That(stop - start, Is.LessThanOrEqualTo(TimeSpan.FromSeconds(BaseConfiguration.LongTimeout + 2))); + } + } } \ No newline at end of file diff --git a/Ocaramba.UnitTests/Tests/LocatorExtensionsTests.cs b/Ocaramba.UnitTests/Tests/LocatorExtensionsTests.cs index 6b8bbaa02..a260ffa46 100644 --- a/Ocaramba.UnitTests/Tests/LocatorExtensionsTests.cs +++ b/Ocaramba.UnitTests/Tests/LocatorExtensionsTests.cs @@ -1,125 +1,125 @@ -using NUnit.Framework; -using Ocaramba.Tests.PageObjects.PageObjects.TheInternet; - -namespace Ocaramba.UnitTests.Tests -{ - [TestFixture] - [Parallelizable(ParallelScope.Fixtures)] - - public class LocatorExtensionsTests : ProjectTestBase - { - [Test] - public void IdLocatorTest() - { - var columnAText = new InternetPage(DriverContext) - .OpenHomePage() - .GoToDragAndDropPage() - .GetByIdLocator; - - Assert.That(columnAText, Is.EqualTo("A")); - } - - [Test] - public void ClassNameLocatorTest() - { - var titleByClassName = new InternetPage(DriverContext) - .OpenHomePage() - .GoToDragAndDropPage().GetByClassName; -#if net8_0 - if (BaseConfiguration.Env == "Linux") - { - Assert.That(titleByClassName, Is.EqualTo("Drag and Drop\nA\nB")); - } - else - { - Assert.That(titleByClassName, Is.EqualTo("Drag and Drop\r\nA\r\nB")); - } -#endif -#if net47 - Assert.That(titleByClassName, Is.EqualTo("Drag and Drop\r\nA\r\nB")); -#endif - } - - [Test] - public void CssSelectorLocatorTest() - { - var titleByCssSelector = new InternetPage(DriverContext) - .OpenHomePage() - .GoToDragAndDropPage().GetByCssSelectorLocator; -#if net8_0 - if (BaseConfiguration.Env == "Linux") - { - Assert.That(titleByCssSelector, Is.EqualTo("Drag and Drop\nA\nB")); - } - else - { - Assert.That(titleByCssSelector, Is.EqualTo("Drag and Drop\r\nA\r\nB")); - } -#endif -#if net47 - Assert.That(titleByCssSelector, Is.EqualTo("Drag and Drop\r\nA\r\nB")); -#endif - } - - [Test] - public void LinkTextLocatorTest() - { - var selectedOption = new InternetPage(DriverContext) - .OpenHomePage() - .GoToDropdownPageByLinkText().SelectedText; - - Assert.That(selectedOption, Is.EqualTo("Please select an option")); - } - - [Test] - public void NameLocatorTest() - { - var columnA = new InternetPage(DriverContext) - .OpenHomePage() - .GoToFormAuthenticationPage() - .GetUsernameByNameLocator; -#if net8_0 - if (BaseConfiguration.Env == "Linux") - { - Assert.That(columnA, Is.EqualTo("Username\nPassword\nLogin")); - } - else - { - Assert.That(columnA, Is.EqualTo("Username\r\nPassword\r\nLogin")); - } -#endif -#if net47 - Assert.That(columnA, Is.EqualTo("Username\r\nPassword\r\nLogin")); -#endif - } - - - [Test] - public void PartialLinkTextLocatorTest() - { - var titleBypartialLinkText = new InternetPage(DriverContext) - .OpenHomePage().GetDragAndDropLinkByPartialLinkText; - Assert.That(titleBypartialLinkText, Is.EqualTo("Drag and Drop")); - } - - [Test] - public void TagNameLocatorTest() - { - var titleByTagName = new InternetPage(DriverContext) - .OpenHomePage() - .GoToTablesPage().GetByTagNameLocator; - - Assert.That(titleByTagName, Is.EqualTo("Last Name")); - } - - [Test] - public void XPathLocatorTest() - { - var linkByXPath = new InternetPage(DriverContext) - .OpenHomePage() - .GoToTablesPage().GetByXpathLocator; - - Assert.That(linkByXPath, Is.EqualTo("Last Name")); - } - } +using NUnit.Framework; +using Ocaramba.Tests.PageObjects.PageObjects.TheInternet; + +namespace Ocaramba.UnitTests.Tests +{ + [TestFixture] + [Parallelizable(ParallelScope.Fixtures)] + + public class LocatorExtensionsTests : ProjectTestBase + { + [Test] + public void IdLocatorTest() + { + var columnAText = new InternetPage(DriverContext) + .OpenHomePage() + .GoToDragAndDropPage() + .GetByIdLocator; + + Assert.That(columnAText, Is.EqualTo("A")); + } + + [Test] + public void ClassNameLocatorTest() + { + var titleByClassName = new InternetPage(DriverContext) + .OpenHomePage() + .GoToDragAndDropPage().GetByClassName; +#if net8_0 + if (BaseConfiguration.Env == "Linux") + { + Assert.That(titleByClassName, Is.EqualTo("Drag and Drop\nA\nB")); + } + else + { + Assert.That(titleByClassName, Is.EqualTo("Drag and Drop\r\nA\r\nB")); + } +#endif +#if net47 + Assert.That(titleByClassName, Is.EqualTo("Drag and Drop\r\nA\r\nB")); +#endif + } + + [Test] + public void CssSelectorLocatorTest() + { + var titleByCssSelector = new InternetPage(DriverContext) + .OpenHomePage() + .GoToDragAndDropPage().GetByCssSelectorLocator; +#if net8_0 + if (BaseConfiguration.Env == "Linux") + { + Assert.That(titleByCssSelector, Is.EqualTo("Drag and Drop\nA\nB")); + } + else + { + Assert.That(titleByCssSelector, Is.EqualTo("Drag and Drop\r\nA\r\nB")); + } +#endif +#if net47 + Assert.That(titleByCssSelector, Is.EqualTo("Drag and Drop\r\nA\r\nB")); +#endif + } + + [Test] + public void LinkTextLocatorTest() + { + var selectedOption = new InternetPage(DriverContext) + .OpenHomePage() + .GoToDropdownPageByLinkText().SelectedText; + + Assert.That(selectedOption, Is.EqualTo("Please select an option")); + } + + [Test] + public void NameLocatorTest() + { + var columnA = new InternetPage(DriverContext) + .OpenHomePage() + .GoToFormAuthenticationPage() + .GetUsernameByNameLocator; +#if net8_0 + if (BaseConfiguration.Env == "Linux") + { + Assert.That(columnA, Is.EqualTo("Username\nPassword\nLogin")); + } + else + { + Assert.That(columnA, Is.EqualTo("Username\r\nPassword\r\nLogin")); + } +#endif +#if net47 + Assert.That(columnA, Is.EqualTo("Username\r\nPassword\r\nLogin")); +#endif + } + + + [Test] + public void PartialLinkTextLocatorTest() + { + var titleBypartialLinkText = new InternetPage(DriverContext) + .OpenHomePage().GetDragAndDropLinkByPartialLinkText; + Assert.That(titleBypartialLinkText, Is.EqualTo("Drag and Drop")); + } + + [Test] + public void TagNameLocatorTest() + { + var titleByTagName = new InternetPage(DriverContext) + .OpenHomePage() + .GoToTablesPage().GetByTagNameLocator; + + Assert.That(titleByTagName, Is.EqualTo("Last Name")); + } + + [Test] + public void XPathLocatorTest() + { + var linkByXPath = new InternetPage(DriverContext) + .OpenHomePage() + .GoToTablesPage().GetByXpathLocator; + + Assert.That(linkByXPath, Is.EqualTo("Last Name")); + } + } } \ No newline at end of file diff --git a/Ocaramba.UnitTests/Tests/NameHelperTests.cs b/Ocaramba.UnitTests/Tests/NameHelperTests.cs index 5ca3f231d..db44e3fb3 100644 --- a/Ocaramba.UnitTests/Tests/NameHelperTests.cs +++ b/Ocaramba.UnitTests/Tests/NameHelperTests.cs @@ -1,45 +1,45 @@ -using System.IO; -using NLog; -using NUnit.Framework; -using Ocaramba.Helpers; - -namespace Ocaramba.UnitTests.Tests -{ - [TestFixture()] - [TestFixture, Parallelizable(ParallelScope.Self)] - public class NameHelperTests - { -#if net8_0 - string folder = Directory.GetCurrentDirectory(); -#endif - -#if net47 - string folder = TestContext.CurrentContext.TestDirectory; -#endif -#if net47 - private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); -#endif -#if net8_0 - private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); -#endif - [Test()] - public void ShortenFileNameTest() - { - var name = "verylongfilename3 4 5 6 7 8 9 0 1 2 3 4 1 2 31 2 3 4 5 6 7 8 9 0 1 2 3 4 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0.txt"; - Logger.Debug("name:{0}",name); - Assert.That((folder + name).Length, Is.GreaterThan(255)); - var text = NameHelper.ShortenFileName(folder, name, " ", 255); - Logger.Debug("text:{0}", text); - Assert.That((folder + text).Length, Is.EqualTo(255)); - } - - [Test()] - public void RemoveSpecialCharactersTest() - { - var name = "name$%//4324 name ^//"; - name = NameHelper.RemoveSpecialCharacters(name); - Assert.That(name, Is.EqualTo("name4324name")); - } - - } +using System.IO; +using NLog; +using NUnit.Framework; +using Ocaramba.Helpers; + +namespace Ocaramba.UnitTests.Tests +{ + [TestFixture()] + [TestFixture, Parallelizable(ParallelScope.Self)] + public class NameHelperTests + { +#if net8_0 + string folder = Directory.GetCurrentDirectory(); +#endif + +#if net47 + string folder = TestContext.CurrentContext.TestDirectory; +#endif +#if net47 + private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); +#endif +#if net8_0 + private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); +#endif + [Test()] + public void ShortenFileNameTest() + { + var name = "verylongfilename3 4 5 6 7 8 9 0 1 2 3 4 1 2 31 2 3 4 5 6 7 8 9 0 1 2 3 4 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0.txt"; + Logger.Debug("name:{0}",name); + Assert.That((folder + name).Length, Is.GreaterThan(255)); + var text = NameHelper.ShortenFileName(folder, name, " ", 255); + Logger.Debug("text:{0}", text); + Assert.That((folder + text).Length, Is.EqualTo(255)); + } + + [Test()] + public void RemoveSpecialCharactersTest() + { + var name = "name$%//4324 name ^//"; + name = NameHelper.RemoveSpecialCharacters(name); + Assert.That(name, Is.EqualTo("name4324name")); + } + + } } \ No newline at end of file diff --git a/Ocaramba.UnitTests/Tests/TakingScreehShotsOfElementsTests.cs b/Ocaramba.UnitTests/Tests/TakingScreehShotsOfElementsTests.cs index 79e368305..be1599a4c 100644 --- a/Ocaramba.UnitTests/Tests/TakingScreehShotsOfElementsTests.cs +++ b/Ocaramba.UnitTests/Tests/TakingScreehShotsOfElementsTests.cs @@ -1,84 +1,84 @@ -// -// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. -// -// -// The MIT License (MIT) -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// - -using System.IO; -using ImageMagick; -using NUnit.Framework; -using Ocaramba.Helpers; -using Ocaramba.Tests.PageObjects.PageObjects.TheInternet; - -namespace Ocaramba.UnitTests.Tests -{ - [TestFixture] - [Parallelizable(ParallelScope.Fixtures)] - [Category("TakingScreehShots")] - [Category("NotImplementedInCoreOrUploadDownload")] - public class TakingScreehShotsOfElementsTests : ProjectTestBase - { -#if net8_0 - string folder = Directory.GetCurrentDirectory(); -#endif - -#if net47 - string folder = TestContext.CurrentContext.TestDirectory; -#endif - - [Test] - public void TakingScreehShotsOfElementInIFrameTest() - { - var internetPage = new InternetPage(this.DriverContext).OpenHomePage(); - internetPage.GoToIFramePage(); - IFramePage page = new IFramePage(this.DriverContext); - var path = page.TakeScreenShotsOfTextInIFrame(folder + FilesHelper.Separator + BaseConfiguration.ScreenShotFolder, "TextWithinIFrame" + BaseConfiguration.TestBrowser); - var path2 = folder + FilesHelper.Separator + BaseConfiguration.ScreenShotFolder + FilesHelper.Separator + "TextWithinIFrameChromeError.png"; - bool flag = true; - using (var img1 = new MagickImage(path)) - { - using (var img2 = new MagickImage(path2)) - { - using (var imgDiff = new MagickImage()) - { - img1.Compose = CompositeOperator.Src; - img1.Compare(img2, ErrorMetric.MeanAbsolute, Channels.RGB); - flag = img1.Equals(img2); - imgDiff.Write(folder + FilesHelper.Separator + BaseConfiguration.ScreenShotFolder + FilesHelper.Separator + BaseConfiguration.TestBrowser + "TextWithinIFrameDIFF.png"); - } - } - } - - - - - Assert.That(flag, Is.False); - } - - [Test] - public void TakingScreenShotsOfElementTest() - { - var internetPage = new InternetPage(this.DriverContext).OpenHomePage(); - internetPage.GoToIFramePage(); - - IFramePage page = new IFramePage(this.DriverContext); - page.TakeScreenShotsOfMenu(folder + FilesHelper.Separator + BaseConfiguration.ScreenShotFolder, "MenuOutSideTheIFrame" + BaseConfiguration.TestBrowser); - } - } -} +// +// Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved. +// +// +// The MIT License (MIT) +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// + +using System.IO; +using ImageMagick; +using NUnit.Framework; +using Ocaramba.Helpers; +using Ocaramba.Tests.PageObjects.PageObjects.TheInternet; + +namespace Ocaramba.UnitTests.Tests +{ + [TestFixture] + [Parallelizable(ParallelScope.Fixtures)] + [Category("TakingScreehShots")] + [Category("NotImplementedInCoreOrUploadDownload")] + public class TakingScreehShotsOfElementsTests : ProjectTestBase + { +#if net8_0 + string folder = Directory.GetCurrentDirectory(); +#endif + +#if net47 + string folder = TestContext.CurrentContext.TestDirectory; +#endif + + [Test] + public void TakingScreehShotsOfElementInIFrameTest() + { + var internetPage = new InternetPage(this.DriverContext).OpenHomePage(); + internetPage.GoToIFramePage(); + IFramePage page = new IFramePage(this.DriverContext); + var path = page.TakeScreenShotsOfTextInIFrame(folder + FilesHelper.Separator + BaseConfiguration.ScreenShotFolder, "TextWithinIFrame" + BaseConfiguration.TestBrowser); + var path2 = folder + FilesHelper.Separator + BaseConfiguration.ScreenShotFolder + FilesHelper.Separator + "TextWithinIFrameChromeError.png"; + bool flag = true; + using (var img1 = new MagickImage(path)) + { + using (var img2 = new MagickImage(path2)) + { + using (var imgDiff = new MagickImage()) + { + img1.Compose = CompositeOperator.Src; + img1.Compare(img2, ErrorMetric.MeanAbsolute, Channels.RGB); + flag = img1.Equals(img2); + imgDiff.Write(folder + FilesHelper.Separator + BaseConfiguration.ScreenShotFolder + FilesHelper.Separator + BaseConfiguration.TestBrowser + "TextWithinIFrameDIFF.png"); + } + } + } + + + + + Assert.That(flag, Is.False); + } + + [Test] + public void TakingScreenShotsOfElementTest() + { + var internetPage = new InternetPage(this.DriverContext).OpenHomePage(); + internetPage.GoToIFramePage(); + + IFramePage page = new IFramePage(this.DriverContext); + page.TakeScreenShotsOfMenu(folder + FilesHelper.Separator + BaseConfiguration.ScreenShotFolder, "MenuOutSideTheIFrame" + BaseConfiguration.TestBrowser); + } + } +} diff --git a/Ocaramba.UnitTests/Tests/WaitHelperTests.cs b/Ocaramba.UnitTests/Tests/WaitHelperTests.cs index 76089ddbf..fe899499f 100644 --- a/Ocaramba.UnitTests/Tests/WaitHelperTests.cs +++ b/Ocaramba.UnitTests/Tests/WaitHelperTests.cs @@ -1,42 +1,42 @@ -using System; -using NUnit.Framework; -using Ocaramba.Exceptions; -using Ocaramba.Helpers; - -namespace Ocaramba.UnitTests.Tests -{ - [TestFixture()] - [TestFixture, Parallelizable(ParallelScope.Self)] - public class WaitHelperTests - { - [Test()] - public void WaitTimeoutExceptionTest() - { - var start = DateTime.Now; - int wait = 3; - Assert.Throws(() => WaitHelper.Wait(() => SumNumber(1,1) > 3, TimeSpan.FromSeconds(wait), TimeSpan.FromSeconds(1), "Timeout")); - var stop = DateTime.Now; - Assert.That(stop - start, Is.GreaterThanOrEqualTo(TimeSpan.FromSeconds(wait))); - Assert.That(stop - start, Is.Not.LessThan(TimeSpan.FromSeconds(wait))); - } - - [Test()] - public void WaitReturnFalseTest() - { - bool result = WaitHelper.Wait(() => SumNumber(1, 1) > 3, TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(1)); - Assert.That(result, Is.False); - } - - [Test()] - public void WaitReturnTrueTest() - { - bool result = WaitHelper.Wait(() => SumNumber(1, 1) > 1, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(1)); - Assert.That(result, Is.True); - } - - int SumNumber(int a, int b) - { - return a + b; - } - } +using System; +using NUnit.Framework; +using Ocaramba.Exceptions; +using Ocaramba.Helpers; + +namespace Ocaramba.UnitTests.Tests +{ + [TestFixture()] + [TestFixture, Parallelizable(ParallelScope.Self)] + public class WaitHelperTests + { + [Test()] + public void WaitTimeoutExceptionTest() + { + var start = DateTime.Now; + int wait = 3; + Assert.Throws(() => WaitHelper.Wait(() => SumNumber(1,1) > 3, TimeSpan.FromSeconds(wait), TimeSpan.FromSeconds(1), "Timeout")); + var stop = DateTime.Now; + Assert.That(stop - start, Is.GreaterThanOrEqualTo(TimeSpan.FromSeconds(wait))); + Assert.That(stop - start, Is.Not.LessThan(TimeSpan.FromSeconds(wait))); + } + + [Test()] + public void WaitReturnFalseTest() + { + bool result = WaitHelper.Wait(() => SumNumber(1, 1) > 3, TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(1)); + Assert.That(result, Is.False); + } + + [Test()] + public void WaitReturnTrueTest() + { + bool result = WaitHelper.Wait(() => SumNumber(1, 1) > 1, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(1)); + Assert.That(result, Is.True); + } + + int SumNumber(int a, int b) + { + return a + b; + } + } } \ No newline at end of file diff --git a/Ocaramba/Ocaramba.csproj b/Ocaramba/Ocaramba.csproj index 6437d7847..ef64ce77c 100644 --- a/Ocaramba/Ocaramba.csproj +++ b/Ocaramba/Ocaramba.csproj @@ -1,100 +1,100 @@ - - - - net8.0 - net472;net8.0 - Framework to automate tests using Selenium WebDriver - Copyright © 2015 - Objectivity Bespoke Software Specialists - https://github.com/ObjectivityLtd/Ocaramba - icon.png - https://github.com/ObjectivityLtd/Ocaramba - MIT - You can find info about this release here: https://github.com/ObjectivityLtd/Ocaramba/releases - 1.0.0 - true - Objectivity Bespoke Software Specialists - selenium webdriver testautomation tests Ocaramba - fxcop-sonarqube.tests.ruleset - true - true - true - snupkg - README.md - - - - - - Never - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - 9.0.0 - - - 9.0.0 - - - 7.4.6 - - - 7.4.6 - - - 7.4.6 - - - 5.3.15 - - - 4.3.0 - - - 4.9.0 - - - - - - - - net8_0 - - - - net47 - - - - true - disable - - - - 6 - - - - 6 - - - true - - + + + + net8.0 + net472;net8.0 + Framework to automate tests using Selenium WebDriver + Copyright © 2015 + Objectivity Bespoke Software Specialists + https://github.com/ObjectivityLtd/Ocaramba + icon.png + https://github.com/ObjectivityLtd/Ocaramba + MIT + You can find info about this release here: https://github.com/ObjectivityLtd/Ocaramba/releases + 1.0.0 + true + Objectivity Bespoke Software Specialists + selenium webdriver testautomation tests Ocaramba + fxcop-sonarqube.tests.ruleset + true + true + true + snupkg + README.md + + + + + + Never + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + 9.0.0 + + + 9.0.0 + + + 7.4.6 + + + 7.4.6 + + + 7.4.6 + + + 5.3.15 + + + 4.3.0 + + + 4.9.0 + + + + + + + + net8_0 + + + + net47 + + + + true + disable + + + + 6 + + + + 6 + + + true + + diff --git a/OcarambaLite/OcarambaLite.csproj b/OcarambaLite/OcarambaLite.csproj index db3f2aae7..c2a2066b7 100644 --- a/OcarambaLite/OcarambaLite.csproj +++ b/OcarambaLite/OcarambaLite.csproj @@ -1,84 +1,84 @@ - - - - net472;net8.0 - net472;net8.0 - Framework to automate tests using Selenium WebDriver (lighten version without selenium drivers) - Copyright © 2015 - Objectivity Bespoke Software Specialists - https://github.com/ObjectivityLtd/Ocaramba - icon.png - https://github.com/ObjectivityLtd/Ocaramba - MIT - You can find info about this release here: https://github.com/ObjectivityLtd/Ocaramba/releases - 1.0.0 - true - Objectivity Bespoke Software Specialists - selenium webdriver testautomation tests Ocaramba - true - true - fxcop-sonarqube.tests.ruleset - true - snupkg - README.md - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - 9.0.0 - - - 9.0.0 - - - 7.4.6 - - - 7.4.6 - - - 7.4.6 - - - 5.3.15 - - - - - - Always - - - - - net8_0 - - - - net47 - - - - true - - - true - - + + + + net472;net8.0 + net472;net8.0 + Framework to automate tests using Selenium WebDriver (lighten version without selenium drivers) + Copyright © 2015 + Objectivity Bespoke Software Specialists + https://github.com/ObjectivityLtd/Ocaramba + icon.png + https://github.com/ObjectivityLtd/Ocaramba + MIT + You can find info about this release here: https://github.com/ObjectivityLtd/Ocaramba/releases + 1.0.0 + true + Objectivity Bespoke Software Specialists + selenium webdriver testautomation tests Ocaramba + true + true + fxcop-sonarqube.tests.ruleset + true + snupkg + README.md + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + 9.0.0 + + + 9.0.0 + + + 7.4.6 + + + 7.4.6 + + + 7.4.6 + + + 5.3.15 + + + + + + Always + + + + + net8_0 + + + + net47 + + + + true + + + true + + diff --git a/README.md b/README.md index 7350e89f2..a6750cd06 100644 --- a/README.md +++ b/README.md @@ -1,135 +1,135 @@ -## Ocaramba - - -**Cross-Platform C# Framework to automate tests using Selenium WebDriver** - -[![Ocaramba Templates](https://img.shields.io/badge/get-Ocaramba_Templates-green.svg?color=4BC21F)](https://marketplace.visualstudio.com/items?itemName=Ocaramba.Ocaramba1) -![Build status](https://github.com/Accenture/Ocaramba/actions/workflows/github-actions.yml/badge.svg) -[![BrowserStack Status](https://automate.browserstack.com/badge.svg?badge_key=ZUJWZGNEczFZVFNVWUJvUHJ6Y0pYUTlnSG4rYnhKVXFUeSsrYzlTUEZIZz0tLWxZUStLVnNqWml6bXNpcm1FSUxMQ3c9PQ==--20fde38e51169fe9739fc60ce188f00ecdf0f1fe)](https://automate.browserstack.com/public-build/ZUJWZGNEczFZVFNVWUJvUHJ6Y0pYUTlnSG4rYnhKVXFUeSsrYzlTUEZIZz0tLWxZUStLVnNqWml6bXNpcm1FSUxMQ3c9PQ==--20fde38e51169fe9739fc60ce188f00ecdf0f1fe) -[![Sauce Test Status](https://app.saucelabs.com/buildstatus/jraczek)](https://app.saucelabs.com/u/JRACZEK) - -Test Framework was designed in Objectivity to propose a common way how people should create Selenium WebDriver tests. - - -Project API documentation can be found here: http://Accenture.github.io/Ocaramba

- - - -**It provides the following features:** -- .NET Frameworks 4.7.2 and .NET 8.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/Accenture/Ocaramba/wiki/Selenium%20Parallel%20tests%20execution) -- Possibility to use MSTest, NUnit or xUNIT framework -- Specflow ready -- Written entirely in C# -- Contains example projects how to use it -- Allows using Chrome, Firefox, Edge Chromium, Safari or Internet Explorer -- Overrides browser profile preferences, pass arguments to browsers, installs browser extensions, loading default firefox profile, Headless mode, more details [here](https://github.com/Accenture/Ocaramba/wiki/Override-browser-profile-preferences,-install-browser-extensions,-Headless-mode) -- Extends Webdriver by additional methods like JavaScriptClick, WaitForAjax, WaitForAngular, etc., more details [here](http://Accenture.github.io/Ocaramba/html/d51aa97e-08b5-c0b6-6987-c10545a64ebd.htm) -- Automatically waits when locating element for specified time and conditions, GetElement method instead of Selenium FindElement, more details [here](http://Accenture.github.io/Ocaramba/html/3c09ca99-f931-c6c9-98fc-194eff6500ff.htm) -- Page Object Pattern -- Support for [SeleniumGrid](https://github.com/SeleniumHQ/selenium/wiki/Grid2), [Cross browser parallel test execution](https://github.com/Accenture/Ocaramba/wiki/Cross-browser-parallel-test-execution-with-SeleniumGrid-or-testing-Cloud-Providers) with [SauceLab](https://saucelabs.com/), [TestingBot](https://testingbot.com) and [Browserstack](https://www.browserstack.com/) more details [here](https://github.com/Accenture/Ocaramba/wiki/Selenium-Grid-support), Advanced Browser Capabilities and Options more details [here](https://github.com/Accenture/Ocaramba/wiki/Advanced-Browser-Capabilities-and-options) -- More common locators, e.g: ```"//*[@title='{0}' and @ms.title='{1}']"```, more details [here](https://github.com/Accenture/Ocaramba/wiki/More%20common%20locators) -- Verify - asserts without stop tests, more details [here](https://github.com/Accenture/Ocaramba/wiki/Verify-asserts-without-stop-tests) -- Measures average and 90 Percentile action times, more details [here](https://github.com/Accenture/Ocaramba/wiki/Performance%20measures) -- DataDriven tests from Xml, Csv and Excel files for NUnit and Xml, Csv for MSTest with examples, more details [NUnit](https://github.com/Accenture/Ocaramba/wiki/NUnit-DataDriven-tests-from-Xml,-CSV-and-Excel-files), [MsTest](https://github.com/Accenture/Ocaramba/wiki/MsTest-DataDriven-tests-from-Xml-and-CSV-files) -- Possibility to take full desktop (only .NET Framework), save page source, more details [here](https://github.com/Accenture/Ocaramba/wiki/Screen-shots---full-desktop---selenium---PageSource-saving) -- Visual Testing - browser screenshot of the element, more details [here](https://github.com/Accenture/Ocaramba/wiki/Visual-Testing) -- Logging with NLog, EventFiringWebDriver logs, more details [here](https://github.com/Accenture/Ocaramba/wiki/Logging) -- Files downloading (Firefox, Chrome), more details [here](https://github.com/Accenture/Ocaramba/wiki/Downloading%20files) -- Possibility to send [SQL](http://Accenture.github.io/Ocaramba/html/730c92c7-831a-4449-3938-16540cf259b8.htm) or [MDX](http://Accenture.github.io/Ocaramba/html/7de319df-06eb-1c79-8c2d-9c60aaf3ab85.htm) queries (only .NET Framework) -- Possibility of debugging framework installed from nuget package with [sourcelink](https://github.com/dotnet/sourcelink), more details [here](https://github.com/Accenture/Ocaramba/wiki/Debugging-Test.Automation-framework). -- AngularJS support, more details [here](https://github.com/Accenture/Ocaramba/wiki/Angular-support). -- Possibility to check for JavaScript errors from the browser, more details [here](https://github.com/Accenture/Ocaramba/wiki/Verifying-Javascript-Errors-from-browser). -- Instruction on how to run Ocaramba tests with Docker container, more details [here](https://github.com/Accenture/Ocaramba/wiki/Run-Ocaramba-tests-with-Docker-container). -- ExtentReports support, more details [here](https://github.com/Accenture/Ocaramba/wiki/ExtentReports-Support). - -For all documentation, visit the [Ocaramba Wiki](https://github.com/Accenture/Ocaramba/wiki). - -Projects examples of using Test Framework : -- Ocaramba.Tests.Angular for AngularJS -- Ocaramba.Tests.Features for Specflow -- Ocaramba.Tests.MsTest for MsTest -- Ocaramba.Tests.NUnit for NUnit -- Ocaramba.Tests.NUnitExtentReports for NUnit featuring test execution HTML report based on ExtentReports framework -- Ocaramba.Tests.xUnit for xUnit -- Ocaramba.Tests.PageObjects for Page Object Pattern -- Ocaramba.Documentation.shfbproj for building API documentation -- Ocaramba.Tests.CloudProviderCrossBrowser for cross browser parallel test execution with BrowserStack\SauceLabs\TestingBot\SeleniumGrid -- Ocaramba.UnitTests for unit test of framework - -NUnit Example Test: - -```csharp -namespace Ocaramba.Tests.NUnit.Tests -{ - using global::NUnit.Framework; - - using Ocaramba.Tests.PageObjects.PageObjects.TheInternet; - - [Parallelizable(ParallelScope.Fixtures)] - public class JavaScriptAlertsTestsNUnit : ProjectTestBase - { - [Test] - public void ClickJsAlertTest() - { - var internetPage = new InternetPage(this.DriverContext).OpenHomePage(); - var jsAlertsPage = internetPage.GoToJavaScriptAlerts(); - jsAlertsPage.OpenJsAlert(); - jsAlertsPage.AcceptAlert(); - Assert.AreEqual("You successfuly clicked an alert", jsAlertsPage.ResultText); - } - } -} - -``` - -NUnit Example Page Object: - -```csharp -namespace Ocaramba.Tests.PageObjects.PageObjects.TheInternet -{ - using System; - using System.Globalization; - - using NLog; - - using Ocaramba; - using Ocaramba.Extensions; - using Ocaramba.Types; - using Ocaramba.Tests.PageObjects; - - public class InternetPage : ProjectPageBase - { - private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); - - /// - /// Locators for elements - /// - private readonly ElementLocator - linkLocator = new ElementLocator(Locator.CssSelector, "a[href='/{0}']"); - - public InternetPage(DriverContext driverContext) : base(driverContext) - { - } - - public JavaScriptAlertsPage GoToJavaScriptAlerts() - { - this.Driver.GetElement(this.linkLocator.Format("javascript_alerts")).Click(); - return new JavaScriptAlertsPage(this.DriverContext); - } - } -} -``` - -#### Where to start? -------------- -- See [Getting started](https://github.com/Accenture/Ocaramba/wiki/Getting%20started). - -Checkout the code or get it from [nuget.org](https://www.nuget.org/packages?q=Ocaramba) -- Ocaramba ![NuGet Downloads](https://img.shields.io/nuget/dt/Ocaramba) ![NuGet Version](https://img.shields.io/nuget/v/Ocaramba) -- OcarambaLite ![NuGet Downloads](https://img.shields.io/nuget/dt/OcarambaLite) ![NuGet Version](https://img.shields.io/nuget/v/OcarambaLite) - lighten version without selenium drivers - -or download Ocaramba Visual Studio templates [![Ocaramba Templates](https://img.shields.io/badge/get-Ocaramba_Templates-green.svg?color=4BC21F)](https://marketplace.visualstudio.com/items?itemName=Ocaramba.Ocaramba1) - +## Ocaramba + + +**Cross-Platform C# Framework to automate tests using Selenium WebDriver** + +[![Ocaramba Templates](https://img.shields.io/badge/get-Ocaramba_Templates-green.svg?color=4BC21F)](https://marketplace.visualstudio.com/items?itemName=Ocaramba.Ocaramba1) +![Build status](https://github.com/Accenture/Ocaramba/actions/workflows/github-actions.yml/badge.svg) +[![BrowserStack Status](https://automate.browserstack.com/badge.svg?badge_key=ZUJWZGNEczFZVFNVWUJvUHJ6Y0pYUTlnSG4rYnhKVXFUeSsrYzlTUEZIZz0tLWxZUStLVnNqWml6bXNpcm1FSUxMQ3c9PQ==--20fde38e51169fe9739fc60ce188f00ecdf0f1fe)](https://automate.browserstack.com/public-build/ZUJWZGNEczFZVFNVWUJvUHJ6Y0pYUTlnSG4rYnhKVXFUeSsrYzlTUEZIZz0tLWxZUStLVnNqWml6bXNpcm1FSUxMQ3c9PQ==--20fde38e51169fe9739fc60ce188f00ecdf0f1fe) +[![Sauce Test Status](https://app.saucelabs.com/buildstatus/jraczek)](https://app.saucelabs.com/u/JRACZEK) + +Test Framework was designed in Objectivity to propose a common way how people should create Selenium WebDriver tests. + + +Project API documentation can be found here: http://Accenture.github.io/Ocaramba

+ + + +**It provides the following features:** +- .NET Frameworks 4.7.2 and .NET 8.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/Accenture/Ocaramba/wiki/Selenium%20Parallel%20tests%20execution) +- Possibility to use MSTest, NUnit or xUNIT framework +- Specflow ready +- Written entirely in C# +- Contains example projects how to use it +- Allows using Chrome, Firefox, Edge Chromium, Safari or Internet Explorer +- Overrides browser profile preferences, pass arguments to browsers, installs browser extensions, loading default firefox profile, Headless mode, more details [here](https://github.com/Accenture/Ocaramba/wiki/Override-browser-profile-preferences,-install-browser-extensions,-Headless-mode) +- Extends Webdriver by additional methods like JavaScriptClick, WaitForAjax, WaitForAngular, etc., more details [here](http://Accenture.github.io/Ocaramba/html/d51aa97e-08b5-c0b6-6987-c10545a64ebd.htm) +- Automatically waits when locating element for specified time and conditions, GetElement method instead of Selenium FindElement, more details [here](http://Accenture.github.io/Ocaramba/html/3c09ca99-f931-c6c9-98fc-194eff6500ff.htm) +- Page Object Pattern +- Support for [SeleniumGrid](https://github.com/SeleniumHQ/selenium/wiki/Grid2), [Cross browser parallel test execution](https://github.com/Accenture/Ocaramba/wiki/Cross-browser-parallel-test-execution-with-SeleniumGrid-or-testing-Cloud-Providers) with [SauceLab](https://saucelabs.com/), [TestingBot](https://testingbot.com) and [Browserstack](https://www.browserstack.com/) more details [here](https://github.com/Accenture/Ocaramba/wiki/Selenium-Grid-support), Advanced Browser Capabilities and Options more details [here](https://github.com/Accenture/Ocaramba/wiki/Advanced-Browser-Capabilities-and-options) +- More common locators, e.g: ```"//*[@title='{0}' and @ms.title='{1}']"```, more details [here](https://github.com/Accenture/Ocaramba/wiki/More%20common%20locators) +- Verify - asserts without stop tests, more details [here](https://github.com/Accenture/Ocaramba/wiki/Verify-asserts-without-stop-tests) +- Measures average and 90 Percentile action times, more details [here](https://github.com/Accenture/Ocaramba/wiki/Performance%20measures) +- DataDriven tests from Xml, Csv and Excel files for NUnit and Xml, Csv for MSTest with examples, more details [NUnit](https://github.com/Accenture/Ocaramba/wiki/NUnit-DataDriven-tests-from-Xml,-CSV-and-Excel-files), [MsTest](https://github.com/Accenture/Ocaramba/wiki/MsTest-DataDriven-tests-from-Xml-and-CSV-files) +- Possibility to take full desktop (only .NET Framework), save page source, more details [here](https://github.com/Accenture/Ocaramba/wiki/Screen-shots---full-desktop---selenium---PageSource-saving) +- Visual Testing - browser screenshot of the element, more details [here](https://github.com/Accenture/Ocaramba/wiki/Visual-Testing) +- Logging with NLog, EventFiringWebDriver logs, more details [here](https://github.com/Accenture/Ocaramba/wiki/Logging) +- Files downloading (Firefox, Chrome), more details [here](https://github.com/Accenture/Ocaramba/wiki/Downloading%20files) +- Possibility to send [SQL](http://Accenture.github.io/Ocaramba/html/730c92c7-831a-4449-3938-16540cf259b8.htm) or [MDX](http://Accenture.github.io/Ocaramba/html/7de319df-06eb-1c79-8c2d-9c60aaf3ab85.htm) queries (only .NET Framework) +- Possibility of debugging framework installed from nuget package with [sourcelink](https://github.com/dotnet/sourcelink), more details [here](https://github.com/Accenture/Ocaramba/wiki/Debugging-Test.Automation-framework). +- AngularJS support, more details [here](https://github.com/Accenture/Ocaramba/wiki/Angular-support). +- Possibility to check for JavaScript errors from the browser, more details [here](https://github.com/Accenture/Ocaramba/wiki/Verifying-Javascript-Errors-from-browser). +- Instruction on how to run Ocaramba tests with Docker container, more details [here](https://github.com/Accenture/Ocaramba/wiki/Run-Ocaramba-tests-with-Docker-container). +- ExtentReports support, more details [here](https://github.com/Accenture/Ocaramba/wiki/ExtentReports-Support). + +For all documentation, visit the [Ocaramba Wiki](https://github.com/Accenture/Ocaramba/wiki). + +Projects examples of using Test Framework : +- Ocaramba.Tests.Angular for AngularJS +- Ocaramba.Tests.Features for Specflow +- Ocaramba.Tests.MsTest for MsTest +- Ocaramba.Tests.NUnit for NUnit +- Ocaramba.Tests.NUnitExtentReports for NUnit featuring test execution HTML report based on ExtentReports framework +- Ocaramba.Tests.xUnit for xUnit +- Ocaramba.Tests.PageObjects for Page Object Pattern +- Ocaramba.Documentation.shfbproj for building API documentation +- Ocaramba.Tests.CloudProviderCrossBrowser for cross browser parallel test execution with BrowserStack\SauceLabs\TestingBot\SeleniumGrid +- Ocaramba.UnitTests for unit test of framework + +NUnit Example Test: + +```csharp +namespace Ocaramba.Tests.NUnit.Tests +{ + using global::NUnit.Framework; + + using Ocaramba.Tests.PageObjects.PageObjects.TheInternet; + + [Parallelizable(ParallelScope.Fixtures)] + public class JavaScriptAlertsTestsNUnit : ProjectTestBase + { + [Test] + public void ClickJsAlertTest() + { + var internetPage = new InternetPage(this.DriverContext).OpenHomePage(); + var jsAlertsPage = internetPage.GoToJavaScriptAlerts(); + jsAlertsPage.OpenJsAlert(); + jsAlertsPage.AcceptAlert(); + Assert.AreEqual("You successfuly clicked an alert", jsAlertsPage.ResultText); + } + } +} + +``` + +NUnit Example Page Object: + +```csharp +namespace Ocaramba.Tests.PageObjects.PageObjects.TheInternet +{ + using System; + using System.Globalization; + + using NLog; + + using Ocaramba; + using Ocaramba.Extensions; + using Ocaramba.Types; + using Ocaramba.Tests.PageObjects; + + public class InternetPage : ProjectPageBase + { + private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); + + /// + /// Locators for elements + /// + private readonly ElementLocator + linkLocator = new ElementLocator(Locator.CssSelector, "a[href='/{0}']"); + + public InternetPage(DriverContext driverContext) : base(driverContext) + { + } + + public JavaScriptAlertsPage GoToJavaScriptAlerts() + { + this.Driver.GetElement(this.linkLocator.Format("javascript_alerts")).Click(); + return new JavaScriptAlertsPage(this.DriverContext); + } + } +} +``` + +#### Where to start? +------------- +- See [Getting started](https://github.com/Accenture/Ocaramba/wiki/Getting%20started). + +Checkout the code or get it from [nuget.org](https://www.nuget.org/packages?q=Ocaramba) +- Ocaramba ![NuGet Downloads](https://img.shields.io/nuget/dt/Ocaramba) ![NuGet Version](https://img.shields.io/nuget/v/Ocaramba) +- OcarambaLite ![NuGet Downloads](https://img.shields.io/nuget/dt/OcarambaLite) ![NuGet Version](https://img.shields.io/nuget/v/OcarambaLite) - lighten version without selenium drivers + +or download Ocaramba Visual Studio templates [![Ocaramba Templates](https://img.shields.io/badge/get-Ocaramba_Templates-green.svg?color=4BC21F)](https://marketplace.visualstudio.com/items?itemName=Ocaramba.Ocaramba1) + diff --git a/ExecutingTestsOnDocker.ps1 b/scripts/ExecutingTestsOnDocker.ps1 similarity index 100% rename from ExecutingTestsOnDocker.ps1 rename to scripts/ExecutingTestsOnDocker.ps1 diff --git a/ExecutingTestsOnDockerAzure.ps1 b/scripts/ExecutingTestsOnDockerAzure.ps1 similarity index 98% rename from ExecutingTestsOnDockerAzure.ps1 rename to scripts/ExecutingTestsOnDockerAzure.ps1 index bfbb39c15..5c075703e 100644 --- a/ExecutingTestsOnDockerAzure.ps1 +++ b/scripts/ExecutingTestsOnDockerAzure.ps1 @@ -1,15 +1,15 @@ -docker info - -docker ps -a -docker exec ocaramba_selenium bash -c 'pwsh ./scripts/set_AppConfig_for_tests.ps1 \"./Ocaramba.Tests.NUnit/bin/Debug/net8.0\" \"appsettings.Linux.json\" \"appSettings\" \"browser|PathToChromeDriverDirectory\" \"Chrome|/usr/local/bin" -logValues -json' -docker exec ocaramba_selenium bash -c 'dotnet vstest ./Ocaramba.Tests.NUnit/bin/Debug/net8.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 . - -docker rm ocaramba_selenium --force - -if($lastexitcode -ne 0) - { - echo 'lastexitcode' $lastexitcode - } - -exit 0 +docker info + +docker ps -a +docker exec ocaramba_selenium bash -c 'pwsh ./scripts/set_AppConfig_for_tests.ps1 \"./Ocaramba.Tests.NUnit/bin/Debug/net8.0\" \"appsettings.Linux.json\" \"appSettings\" \"browser|PathToChromeDriverDirectory\" \"Chrome|/usr/local/bin" -logValues -json' +docker exec ocaramba_selenium bash -c 'dotnet vstest ./Ocaramba.Tests.NUnit/bin/Debug/net8.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 . + +docker rm ocaramba_selenium --force + +if($lastexitcode -ne 0) + { + echo 'lastexitcode' $lastexitcode + } + +exit 0 diff --git a/ExecutingTestsOnDockerGithubActions.ps1 b/scripts/ExecutingTestsOnDockerGithubActions.ps1 similarity index 98% rename from ExecutingTestsOnDockerGithubActions.ps1 rename to scripts/ExecutingTestsOnDockerGithubActions.ps1 index c6d1c0bbe..2100240cc 100644 --- a/ExecutingTestsOnDockerGithubActions.ps1 +++ b/scripts/ExecutingTestsOnDockerGithubActions.ps1 @@ -1,16 +1,16 @@ -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/net8.0" "appsettings.Linux.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|/usr/local/bin/" -logValues -json' -docker exec ocaramba_selenium bash -c 'dotnet vstest ./Ocaramba.Tests.NUnit/bin/Debug/net8.0/Ocaramba.Tests.NUnit.dll /TestCaseFilter:"(TestCategory!=NotImplementedInCoreOrUploadDownload)" /Parallel --logger:trx;LogFileName=Ocaramba.Tests.Docker.trx' -docker exec ocaramba_selenium bash -c "ls /Ocaramba/TestResults/ ; cp /Ocaramba/TestResults/*.trx /tmp/Ocaramba.Tests.Docker.trx" -docker cp ocaramba_selenium:/tmp/Ocaramba.Tests.Docker.trx . -docker rm ocaramba_selenium --force - -if($lastexitcode -ne 0) - { - echo 'lastexitcode' $lastexitcode - } - -exit 0 +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/net8.0" "appsettings.Linux.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|/usr/local/bin/" -logValues -json' +docker exec ocaramba_selenium bash -c 'dotnet vstest ./Ocaramba.Tests.NUnit/bin/Debug/net8.0/Ocaramba.Tests.NUnit.dll /TestCaseFilter:"(TestCategory!=NotImplementedInCoreOrUploadDownload)" /Parallel --logger:trx;LogFileName=Ocaramba.Tests.Docker.trx' +docker exec ocaramba_selenium bash -c "ls /Ocaramba/TestResults/ ; cp /Ocaramba/TestResults/*.trx /tmp/Ocaramba.Tests.Docker.trx" +docker cp ocaramba_selenium:/tmp/Ocaramba.Tests.Docker.trx . +docker rm ocaramba_selenium --force + +if($lastexitcode -ne 0) + { + echo 'lastexitcode' $lastexitcode + } + +exit 0 diff --git a/ExecutingTestsOnLinux.ps1 b/scripts/ExecutingTestsOnLinux.ps1 similarity index 100% rename from ExecutingTestsOnLinux.ps1 rename to scripts/ExecutingTestsOnLinux.ps1 diff --git a/ExecutingTestsOnLinuxAzure.ps1 b/scripts/ExecutingTestsOnLinuxAzure.ps1 similarity index 97% rename from ExecutingTestsOnLinuxAzure.ps1 rename to scripts/ExecutingTestsOnLinuxAzure.ps1 index a9fb47271..8e898ef79 100644 --- a/ExecutingTestsOnLinuxAzure.ps1 +++ b/scripts/ExecutingTestsOnLinuxAzure.ps1 @@ -1,17 +1,17 @@ -echo '********************************************Executing tests********************************************' - -echo '********************************************net8.0 tests********************************************' - -$Env:ASPNETCORE_ENVIRONMENT="Linux" - -echo $Env:ASPNETCORE_ENVIRONMENT -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.NUnit\bin\Release\net8.0" "appsettings.Linux.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|/usr/local/bin" -logValues -json - -dotnet vstest ./Ocaramba.Tests.NUnit/bin/Release/net8.0/Ocaramba.Tests.NUnit.dll /TestCaseFilter:"(TestCategory!=NotImplementedInCoreOrUploadDownload)" /Parallel --logger:"trx;LogFileName=Ocaramba.Tests.netcoreapp.xml" - -if($lastexitcode -ne 0) - { - echo 'lastexitcode' $lastexitcode - } - -exit 0 +echo '********************************************Executing tests********************************************' + +echo '********************************************net8.0 tests********************************************' + +$Env:ASPNETCORE_ENVIRONMENT="Linux" + +echo $Env:ASPNETCORE_ENVIRONMENT +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.NUnit\bin\Release\net8.0" "appsettings.Linux.json" "appSettings" "browser|PathToChromeDriverDirectory" "Chrome|/usr/local/bin" -logValues -json + +dotnet vstest ./Ocaramba.Tests.NUnit/bin/Release/net8.0/Ocaramba.Tests.NUnit.dll /TestCaseFilter:"(TestCategory!=NotImplementedInCoreOrUploadDownload)" /Parallel --logger:"trx;LogFileName=Ocaramba.Tests.netcoreapp.xml" + +if($lastexitcode -ne 0) + { + echo 'lastexitcode' $lastexitcode + } + +exit 0 diff --git a/ExecutingTestsOnLinuxBrowserStackAzure.ps1 b/scripts/ExecutingTestsOnLinuxBrowserStackAzure.ps1 similarity index 100% rename from ExecutingTestsOnLinuxBrowserStackAzure.ps1 rename to scripts/ExecutingTestsOnLinuxBrowserStackAzure.ps1 diff --git a/ExecutingTestsOnLinuxBrowserStackGithubActions.ps1 b/scripts/ExecutingTestsOnLinuxBrowserStackGithubActions.ps1 similarity index 98% rename from ExecutingTestsOnLinuxBrowserStackGithubActions.ps1 rename to scripts/ExecutingTestsOnLinuxBrowserStackGithubActions.ps1 index 9cde70627..0422404c4 100644 --- a/ExecutingTestsOnLinuxBrowserStackGithubActions.ps1 +++ b/scripts/ExecutingTestsOnLinuxBrowserStackGithubActions.ps1 @@ -1,20 +1,20 @@ -echo '********************************************CloudProviderCrossBrowser tests********************************************' - -echo '********************************************BrowserStack tests********************************************' -$Env:ASPNETCORE_ENVIRONMENT="Linux" - -echo $Env:ASPNETCORE_ENVIRONMENT - -.\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 - -.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.CloudProviderCrossBrowser\bin\Release\net8.0" "appsettings.Linux.json" "DriverCapabilities" "buildName" "Ocaramba.Tests.BrowserStackCrossBrowser$($env:BuildVersion)" -logValues -json - -dotnet vstest ./Ocaramba.Tests.CloudProviderCrossBrowser/bin/Release/net8.0/Ocaramba.Tests.CloudProviderCrossBrowser.dll /Logger:"trx;LogFileName=Ocaramba.Tests.BrowserStacknetcoreapp.xml" - -if($lastexitcode -ne 0) - { - echo 'lastexitcode' $lastexitcode - } -exit 0 +echo '********************************************CloudProviderCrossBrowser tests********************************************' + +echo '********************************************BrowserStack tests********************************************' +$Env:ASPNETCORE_ENVIRONMENT="Linux" + +echo $Env:ASPNETCORE_ENVIRONMENT + +.\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 + +.\scripts\set_AppConfig_for_tests.ps1 ".\Ocaramba.Tests.CloudProviderCrossBrowser\bin\Release\net8.0" "appsettings.Linux.json" "DriverCapabilities" "buildName" "Ocaramba.Tests.BrowserStackCrossBrowser$($env:BuildVersion)" -logValues -json + +dotnet vstest ./Ocaramba.Tests.CloudProviderCrossBrowser/bin/Release/net8.0/Ocaramba.Tests.CloudProviderCrossBrowser.dll /Logger:"trx;LogFileName=Ocaramba.Tests.BrowserStacknetcoreapp.xml" + +if($lastexitcode -ne 0) + { + echo 'lastexitcode' $lastexitcode + } +exit 0 diff --git a/ExecutingTestsOnWindows.ps1 b/scripts/ExecutingTestsOnWindows.ps1 similarity index 100% rename from ExecutingTestsOnWindows.ps1 rename to scripts/ExecutingTestsOnWindows.ps1 diff --git a/ExecutingTestsOnWindowsAzure1.ps1 b/scripts/ExecutingTestsOnWindowsAzure1.ps1 similarity index 100% rename from ExecutingTestsOnWindowsAzure1.ps1 rename to scripts/ExecutingTestsOnWindowsAzure1.ps1 diff --git a/ExecutingTestsOnWindowsAzure2.ps1 b/scripts/ExecutingTestsOnWindowsAzure2.ps1 similarity index 100% rename from ExecutingTestsOnWindowsAzure2.ps1 rename to scripts/ExecutingTestsOnWindowsAzure2.ps1 diff --git a/ExecutingTestsOnWindowsAzure3.ps1 b/scripts/ExecutingTestsOnWindowsAzure3.ps1 similarity index 100% rename from ExecutingTestsOnWindowsAzure3.ps1 rename to scripts/ExecutingTestsOnWindowsAzure3.ps1 diff --git a/ExecutingTestsOnWindowsAzure4.ps1 b/scripts/ExecutingTestsOnWindowsAzure4.ps1 similarity index 100% rename from ExecutingTestsOnWindowsAzure4.ps1 rename to scripts/ExecutingTestsOnWindowsAzure4.ps1 diff --git a/ExecutingTestsOnWindowsAzure5.ps1 b/scripts/ExecutingTestsOnWindowsAzure5.ps1 similarity index 100% rename from ExecutingTestsOnWindowsAzure5.ps1 rename to scripts/ExecutingTestsOnWindowsAzure5.ps1 diff --git a/ExecutingTestsOnWindowsAzure6.ps1 b/scripts/ExecutingTestsOnWindowsAzure6.ps1 similarity index 100% rename from ExecutingTestsOnWindowsAzure6.ps1 rename to scripts/ExecutingTestsOnWindowsAzure6.ps1 diff --git a/ExecutingTestsOnWindowsGithubActions1.ps1 b/scripts/ExecutingTestsOnWindowsGithubActions1.ps1 similarity index 100% rename from ExecutingTestsOnWindowsGithubActions1.ps1 rename to scripts/ExecutingTestsOnWindowsGithubActions1.ps1 diff --git a/ExecutingTestsOnWindowsGithubActions2.ps1 b/scripts/ExecutingTestsOnWindowsGithubActions2.ps1 similarity index 100% rename from ExecutingTestsOnWindowsGithubActions2.ps1 rename to scripts/ExecutingTestsOnWindowsGithubActions2.ps1 diff --git a/ExecutingTestsOnWindowsGithubActions3.ps1 b/scripts/ExecutingTestsOnWindowsGithubActions3.ps1 similarity index 100% rename from ExecutingTestsOnWindowsGithubActions3.ps1 rename to scripts/ExecutingTestsOnWindowsGithubActions3.ps1 diff --git a/ExecutingTestsOnWindowsGithubActions4.ps1 b/scripts/ExecutingTestsOnWindowsGithubActions4.ps1 similarity index 100% rename from ExecutingTestsOnWindowsGithubActions4.ps1 rename to scripts/ExecutingTestsOnWindowsGithubActions4.ps1 diff --git a/ExecutingTestsOnWindowsGithubActions5.ps1 b/scripts/ExecutingTestsOnWindowsGithubActions5.ps1 similarity index 100% rename from ExecutingTestsOnWindowsGithubActions5.ps1 rename to scripts/ExecutingTestsOnWindowsGithubActions5.ps1 diff --git a/ExecutingTestsOnWindowsGithubActions6.ps1 b/scripts/ExecutingTestsOnWindowsGithubActions6.ps1 similarity index 100% rename from ExecutingTestsOnWindowsGithubActions6.ps1 rename to scripts/ExecutingTestsOnWindowsGithubActions6.ps1 diff --git a/PublishingApiDocumentationOn_gh-pages.ps1 b/scripts/PublishingApiDocumentationOn_gh-pages.ps1 similarity index 100% rename from PublishingApiDocumentationOn_gh-pages.ps1 rename to scripts/PublishingApiDocumentationOn_gh-pages.ps1 diff --git a/removeSubprojectFromSolution.ps1 b/scripts/removeSubprojectFromSolution.ps1 similarity index 100% rename from removeSubprojectFromSolution.ps1 rename to scripts/removeSubprojectFromSolution.ps1