├── .dockerignore
├── .github
├── dependabot.yml
└── workflows
│ └── github-actions.yml
├── .gitignore
├── Dockerfile
├── DockerfileBuild
├── LICENSE
├── Ocaramba.Documentation
├── Content
│ └── Welcome.aml
├── ContentLayout.content
├── Ocaramba.Documentation.shfbproj
├── Selenium.shfbproj
└── icons
│ ├── 676_Framework_Ocaramba-logo-64x64.svg
│ ├── Help.png
│ └── Ocaramba-logo-64x64.png
├── Ocaramba.Tests.Angular
├── App.config
├── Ocaramba.Tests.Angular.csproj
├── PageObjects
│ ├── ProtractorApiPage.cs
│ ├── ProtractorHomePage.cs
│ ├── TableOfContentsPage.cs
│ └── TutorialPage.cs
├── ProjectTestBase.cs
├── Tests
│ └── AngularTestNunit.cs
├── appsettings.Linux.json
├── appsettings.json
├── nlog.config
└── packages.lock.json
├── Ocaramba.Tests.CloudProviderCrossBrowser
├── .config
│ └── dotnet-tools.json
├── App.config
├── Ocaramba.Tests.CloudProviderCrossBrowser.csproj
├── ProjectTestBase.cs
├── Tests
│ └── HerokuappTestsNUnit.cs
├── appsettings.Linux.json
├── appsettings.json
├── browserstack.yml
├── nlog.config
└── packages.lock.json
├── Ocaramba.Tests.Features
├── App.config
├── Ocaramba.Tests.Features.csproj
├── ProjectTestBase.cs
├── StepDefinition
│ └── CommonSteps.cs
├── TestFeatures
│ ├── SmokeTests.feature
│ └── SmokeTests.feature.cs
├── appsettings.Linux.json
├── appsettings.json
├── nlog.config
└── packages.lock.json
├── Ocaramba.Tests.MsTest
├── App.config
├── DDT.csv
├── DDT.xml
├── HerokuappTestsMsTest.cs
├── Ocaramba.Tests.MsTest.csproj
├── ProjectTestBase.cs
├── Runsettings.runsettings
├── appsettings.Linux.json
├── appsettings.json
├── nlog.config
└── packages.lock.json
├── Ocaramba.Tests.NUnit
├── App.config
├── DataDriven
│ ├── CompareFiles.cs
│ ├── DataDriven.xlsx
│ ├── DataDriven.xml
│ ├── DataDrivenHelper.cs
│ ├── TestData.cs
│ └── TestDataCsv.csv
├── Ocaramba.Tests.NUnit.csproj
├── ProjectBaseConfiguration.cs
├── ProjectTestBase.cs
├── Properties
│ └── launchSettings.json
├── TestOutput
│ ├── filetocompare_branch.csv
│ ├── filetocompare_branch.txt
│ ├── filetocompare_live.csv
│ └── filetocompare_live.txt
├── Tests
│ ├── CompareFilesDataDrivenTests.cs
│ ├── HerokuappTestsDataDrivenNUnit.cs
│ ├── HerokuappTestsNUnit.cs
│ ├── JavaScriptAlertsTestsNUnit.cs
│ ├── PerformanceTests1NUnit.cs
│ ├── PerformanceTestsNUnit.cs
│ ├── SaveScreenShotsPageSourceTestsNUnit.cs
│ ├── SelectWebElementTests.cs
│ └── UploadDownloadFilesTestsNUnit.cs
├── appsettings.Linux.json
├── appsettings.json
├── nlog.config
└── packages.lock.json
├── Ocaramba.Tests.NUnitExtentReports
├── App.config
├── ExtentLogger
│ └── ExtentTestLogger.cs
├── Ocaramba.Tests.NUnitExtentReports.csproj
├── PageObject
│ ├── BasicAuthPage.cs
│ ├── BrokenImagesPage.cs
│ ├── DragAndDropPage.cs
│ ├── DropdownPage.cs
│ ├── InternetPage.cs
│ ├── MultipleWindowsPage.cs
│ ├── NestedFramesPage.cs
│ ├── NewWindowPage.cs
│ └── TablesPage.cs
├── ProjectBaseConfiguration.cs
├── ProjectTestBase.cs
├── Properties
│ └── launchSettings.json
├── TestExecutionManager.cs
├── TestOutput
│ ├── filetocompare_branch.csv
│ ├── filetocompare_branch.txt
│ ├── filetocompare_live.csv
│ └── filetocompare_live.txt
├── Tests
│ ├── HerokuappTestsNUnit.cs
│ └── SelectWebElementTests.cs
├── appsettings.Linux.json
├── appsettings.json
├── nlog.config
└── packages.lock.json
├── Ocaramba.Tests.PageObjects
├── CustomGrid.cs
├── Ocaramba.Tests.PageObjects.csproj
├── PageObjects
│ └── TheInternet
│ │ ├── AbTestingPage.cs
│ │ ├── BasicAuthPage.cs
│ │ ├── BrokenImagesPage.cs
│ │ ├── CheckboxesPage.cs
│ │ ├── ContextMenuPage.cs
│ │ ├── DisappearingElementsPage.cs
│ │ ├── DownloadPage.cs
│ │ ├── DragAndDropPage.cs
│ │ ├── DropdownPage.cs
│ │ ├── DynamicControlsPage.cs
│ │ ├── DynamicLoadingPage.cs
│ │ ├── FloatingMenuPage.cs
│ │ ├── ForgotPasswordPage.cs
│ │ ├── FormAuthenticationPage.cs
│ │ ├── HoversPage.cs
│ │ ├── HttpCode200Page.cs
│ │ ├── IFramePage.cs
│ │ ├── InternetPage.cs
│ │ ├── JavaScriptAlertsPage.cs
│ │ ├── JavaScriptOnLoadPage.cs
│ │ ├── KeyPressesPage.cs
│ │ ├── MultipleWindowsPage.cs
│ │ ├── NestedFramesPage.cs
│ │ ├── NewWindowPage.cs
│ │ ├── SecureFileDownloadPage.cs
│ │ ├── ShiftingContentPage.cs
│ │ ├── SlowResourcesPage.cs
│ │ ├── StatusCodesPage.cs
│ │ ├── TablesPage.cs
│ │ └── UploadPage.cs
├── ProjectPageBase.cs
└── packages.lock.json
├── Ocaramba.Tests.Xunit
├── App.config
├── Ocaramba.Tests.Xunit.csproj
├── ProjectTestBase.cs
├── TestFixture.cs
├── Tests
│ ├── ExampleTest1.cs
│ └── ExampleTest2.cs
├── appsettings.Linux.json
├── appsettings.json
├── nlog.config
└── packages.lock.json
├── Ocaramba.UnitTests
├── App.config
├── Ocaramba.UnitTests.csproj
├── ProjectTestBase.cs
├── TestOutput
│ └── TextWithinIFrameChromeError.png
├── Tests
│ ├── DateHelperTests.cs
│ ├── DriversCustomSettingsUnitTests.cs
│ ├── FilesHelperTests.cs
│ ├── JavaScriptAlertsTestsNUnit.cs
│ ├── LocatorExtensionsTests.cs
│ ├── NameHelperTests.cs
│ ├── TakingScreehShotsOfElementsTests.cs
│ └── WaitHelperTests.cs
├── appsettings.Linux.json
├── appsettings.json
├── nlog.config
└── packages.lock.json
├── Ocaramba.sln
├── Ocaramba
├── Helpers
│ ├── MdxHelper.cs
│ └── SqlHelper.cs
├── Ocaramba.csproj
├── fxcop-sonarqube.tests.ruleset
└── packages.lock.json
├── OcarambaLite
├── App.config
├── BaseConfiguration.cs
├── BrowserType.cs
├── CustomCodeAnalysisRules.xml
├── DriverContext.cs
├── DriverContextHelper.cs
├── DriverOptionsSetEventArgs.cs
├── DriversCustomSettings.cs
├── Exceptions
│ ├── DataDrivenReadException.cs
│ └── WaitTimeoutException.cs
├── Extensions
│ ├── LocatorExtensions.cs
│ ├── SearchContextExtensions.cs
│ ├── WebDriverExtensions.cs
│ └── WebElementExtensions.cs
├── Helpers
│ ├── DateHelper.cs
│ ├── FileType.cs
│ ├── FilesHelper.cs
│ ├── NameHelper.cs
│ ├── PerformanceHelper.cs
│ ├── PrintPerformanceResultsHelper.cs
│ ├── TakeScreenShot.cs
│ └── WaitHelper.cs
├── Locator.cs
├── Logger
│ ├── MyEventFiringWebDriver.cs
│ └── TestLogger.cs
├── OcarambaLite.csproj
├── TestBase.cs
├── Types
│ ├── AverageGroupedTimes.cs
│ ├── ElementLocator.cs
│ ├── ErrorDetail.cs
│ └── SavedTimes.cs
├── Verify.cs
├── WebElements
│ ├── Checkbox.cs
│ ├── JavaScriptAlert.cs
│ ├── Select.cs
│ └── Table.cs
├── fxcop-sonarqube.tests.ruleset
├── nlog.config
└── packages.lock.json
├── README.md
├── azure-pipelines.yml
├── chromedriver.sh
├── docker-compose.yml
├── icon.png
└── scripts
├── ExecutingTestsOnDockerGithubActions.ps1
├── ExecutingTestsOnLinuxAzure.ps1
├── ExecutingTestsOnLinuxBrowserStackGithubActions.ps1
├── ExecutingTestsOnWindowsGithubActions1.ps1
├── ExecutingTestsOnWindowsGithubActions2.ps1
├── ExecutingTestsOnWindowsGithubActions3.ps1
├── ExecutingTestsOnWindowsGithubActions4.ps1
├── ExecutingTestsOnWindowsGithubActions5.ps1
├── ExecutingTestsOnWindowsGithubActions6.ps1
├── PublishingApiDocumentationOn_gh-pages.ps1
├── removeSubprojectFromSolution.ps1
└── set_AppConfig_for_tests.ps1
/.dockerignore:
--------------------------------------------------------------------------------
1 | .git
2 | .vs
3 | */bin/*/*
4 | */obj/*/*
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # To get started with Dependabot version updates, you'll need to specify which
2 | # package ecosystems to update and where the package manifests are located.
3 | # Please see the documentation for all configuration options:
4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5 | version: 2
6 | updates:
7 | - package-ecosystem: "nuget" # See documentation for possible values
8 | directory: "/" # Location of package manifests
9 | schedule:
10 | interval: "daily"
11 |
12 | - package-ecosystem: "docker"
13 | directory: "/"
14 | # Check for updates once a week
15 | schedule:
16 | interval: "weekly"
17 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /.vs/Ocaramba/v15
2 | /*.user
3 | /**/*.nupkg
4 | /**/bin/**/*.*
5 | /**/obj/**/*.*
6 | /packages/**/*.*
7 | /.vs/config/applicationhost.config
8 | /Ocaramba.Documentation/Help
9 | /Ocaramba/Ocaramba.xml
10 | /.vs
11 | /Ocaramba.Tests.Angular/TestResults/*.trx
12 | /Ocaramba.Tests.Docker.xml
13 | /nuget.exe
14 | /TestResults
15 | /.sonarqube/
16 | /UpgradeLog.htm
17 | selenium-manager
18 | *.log
19 |
--------------------------------------------------------------------------------
/DockerfileBuild:
--------------------------------------------------------------------------------
1 | FROM ocaramba/selenium
2 | COPY ./ /Ocaramba
3 | WORKDIR /Ocaramba
4 | RUN ls
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Objectivity Bespoke Software Specialists
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/Ocaramba.Documentation/Content/Welcome.aml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Test Framework was designed in Objectivity to propose common way how people should create Selenium WebDriver tests.
6 |
7 |
8 |
9 | Getting Started
10 |
11 |
12 | To get started visit https://github.com/ObjectivityLtd/Ocaramba/wiki/Getting-started.
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Ocaramba.Documentation/ContentLayout.content:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Ocaramba.Documentation/icons/676_Framework_Ocaramba-logo-64x64.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Ocaramba.Documentation/icons/Help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accenture/Ocaramba/9899dd10368b16479399880efc5fee96aea25856/Ocaramba.Documentation/icons/Help.png
--------------------------------------------------------------------------------
/Ocaramba.Documentation/icons/Ocaramba-logo-64x64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accenture/Ocaramba/9899dd10368b16479399880efc5fee96aea25856/Ocaramba.Documentation/icons/Ocaramba-logo-64x64.png
--------------------------------------------------------------------------------
/Ocaramba.Tests.Angular/PageObjects/ProtractorApiPage.cs:
--------------------------------------------------------------------------------
1 | using Ocaramba.Extensions;
2 | using Ocaramba.Types;
3 | using Ocaramba.Tests.PageObjects;
4 | using NLog;
5 |
6 | namespace Ocaramba.Tests.Angular.PageObjects
7 | {
8 | public class ProtractorApiPage : ProjectPageBase
9 | {
10 | #if net47
11 | private readonly NLog.Logger logger = LogManager.GetCurrentClassLogger();
12 | #endif
13 | #if net8_0
14 | private readonly NLog.Logger logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger();
15 | #endif
16 |
17 | ///
18 | /// Locators for elements
19 | ///
20 | private readonly ElementLocator
21 | ElementToBeSelected = new ElementLocator(Locator.CssSelector, "a[href*='elementToBeSelected']"),
22 | ElementToBeSelectedHeader = new ElementLocator(Locator.XPath, "//h3[@class='api-title ng-binding'][contains(text(),'ExpectedConditions.elementToBeSelected')]");
23 |
24 | public ProtractorApiPage(DriverContext driverContext) : base(driverContext)
25 | {
26 | }
27 |
28 | public ProtractorApiPage ClickElementToBeSelected()
29 | {
30 | this.Driver.GetElement(this.ElementToBeSelected).Click();
31 | return new ProtractorApiPage(this.DriverContext);
32 | }
33 |
34 | public bool IsElementToBeSelectedHeaderDisplayed()
35 | {
36 | return this.Driver.GetElement(this.ElementToBeSelectedHeader).Displayed;
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Ocaramba.Tests.Angular/PageObjects/ProtractorHomePage.cs:
--------------------------------------------------------------------------------
1 | using Ocaramba;
2 | using Ocaramba.Extensions;
3 | using Ocaramba.Types;
4 | using Ocaramba.Tests.PageObjects;
5 |
6 | namespace Ocaramba.Tests.Angular.PageObjects
7 | {
8 | using System.Globalization;
9 | using NLog;
10 | using System;
11 |
12 | public class ProtractorHomePage : ProjectPageBase
13 | {
14 | #if net47
15 | private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger();
16 | #endif
17 | #if net8_0
18 | private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger();
19 | #endif
20 |
21 | ///
22 | /// Locators for elements
23 | ///
24 | private readonly ElementLocator
25 | QuickStart = new ElementLocator(Locator.Id, "drop1"),
26 | Tutorial = new ElementLocator(Locator.CssSelector, "li[class*='open']>ul>li>a[href*='tutorial']");
27 |
28 | public ProtractorHomePage OpenProtractorHomePage()
29 | {
30 | var url = BaseConfiguration.GetUrlValue;
31 | this.Driver.SynchronizeWithAngular(true);
32 | this.Driver.NavigateTo(new Uri(url));
33 | Logger.Info(CultureInfo.CurrentCulture, "Opening page {0}", url);
34 | return this;
35 | }
36 |
37 | public ProtractorHomePage(DriverContext driverContext) : base(driverContext)
38 | {
39 | }
40 |
41 | public ProtractorHomePage ClickQuickStart()
42 | {
43 | this.Driver.GetElement(this.QuickStart).JavaScriptClick();
44 | return this;
45 | }
46 |
47 | public TutorialPage ClickTutorial()
48 | {
49 | this.Driver.GetElement(this.Tutorial).Click();
50 | return new TutorialPage(this.DriverContext);
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/Ocaramba.Tests.Angular/PageObjects/TableOfContentsPage.cs:
--------------------------------------------------------------------------------
1 | using Ocaramba.Tests.PageObjects;
2 |
3 | namespace Ocaramba.Tests.Angular.PageObjects
4 | {
5 | using NLog;
6 | using Ocaramba.Types;
7 | using Ocaramba;
8 | using Ocaramba.Extensions;
9 |
10 | public class TableOfContentsPage : ProjectPageBase
11 | {
12 | #if net47
13 | private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger();
14 | #endif
15 | #if net8_0
16 | private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger();
17 | #endif
18 |
19 | ///
20 | /// Locators for elements
21 | ///
22 | private readonly ElementLocator
23 | ProtractorApi = new ElementLocator(Locator.CssSelector, "ul[class='ng-scope']>li>a[href='#/api']");
24 |
25 | public TableOfContentsPage(DriverContext driverContext) : base(driverContext)
26 | {
27 | }
28 |
29 | public ProtractorApiPage ClickProtractorApi()
30 | {
31 | this.Driver.GetElement(this.ProtractorApi).Click();
32 | return new ProtractorApiPage(this.DriverContext);
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Ocaramba.Tests.Angular/PageObjects/TutorialPage.cs:
--------------------------------------------------------------------------------
1 | using Ocaramba.Tests.PageObjects;
2 |
3 | namespace Ocaramba.Tests.Angular.PageObjects
4 | {
5 | using NLog;
6 | using Ocaramba.Types;
7 | using Ocaramba;
8 | using Ocaramba.Extensions;
9 |
10 | public class TutorialPage : ProjectPageBase
11 | {
12 | #if net47
13 | private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger();
14 | #endif
15 | #if net8_0
16 | private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger();
17 | #endif
18 |
19 | ///
20 | /// Locators for elements
21 | ///
22 | private readonly ElementLocator
23 | TableOfContents = new ElementLocator(Locator.CssSelector, "a[href*='toc']");
24 |
25 | public TutorialPage(DriverContext driverContext) : base(driverContext)
26 | {
27 | }
28 |
29 | public TableOfContentsPage ClickTableOfContents()
30 | {
31 | this.Driver.GetElement(this.TableOfContents).Click();
32 | return new TableOfContentsPage(this.DriverContext);
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Ocaramba.Tests.Angular/Tests/AngularTestNunit.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved.
3 | //
4 | //
5 | // The MIT License (MIT)
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | // The above copyright notice and this permission notice shall be included in all
13 | // copies or substantial portions of the Software.
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | // SOFTWARE.
21 | //
22 |
23 | using NUnit.Framework;
24 |
25 | namespace Ocaramba.Tests.Angular.Tests
26 | {
27 | using Ocaramba.Tests.Angular.PageObjects;
28 |
29 | [TestFixture]
30 | [Parallelizable(ParallelScope.Fixtures)]
31 | public class AngularTestNunit : ProjectTestBase
32 | {
33 | [Test]
34 | public void AngularPageNavigationTest()
35 | {
36 | var protractorApiPage = new ProtractorHomePage(this.DriverContext)
37 | .OpenProtractorHomePage()
38 | .ClickQuickStart()
39 | .ClickTutorial()
40 | .ClickTableOfContents()
41 | .ClickProtractorApi()
42 | .ClickElementToBeSelected();
43 |
44 | Assert.That(protractorApiPage.IsElementToBeSelectedHeaderDisplayed(), Is.True, "Header is not displayed.");
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/Ocaramba.Tests.Angular/appsettings.Linux.json:
--------------------------------------------------------------------------------
1 | {
2 | "appSettings": {
3 | "protocol": "http",
4 | "host": "www.protractortest.org",
5 | "browser": "Chrome",
6 | "url": "",
7 | "PathToChromeDriverDirectory": "",
8 | "PathToFirefoxDriverDirectory": "",
9 | "PathToInternetExplorerDriverDirectory": "",
10 | "ChromeBrowserExecutableLocation": "",
11 | "FireFoxBrowserExecutableLocation": "",
12 | "FirefoxUseLegacyImplementation": "false",
13 | "PathToFirefoxProfile": "",
14 | "RemoteWebDriverHub": "http://localhost:4444/wd/hub",
15 | "DriverCapabilities": "Chrome",
16 | "longTimeout": "30",
17 | "mediumTimeout": "10",
18 | "shortTimeout": "3",
19 | "ImplicitlyWaitMilliseconds": "200",
20 | "username": "admin",
21 | "password": "admin",
22 | "UseCurrentDirectory": "false",
23 | "DownloadFolder": "TestOutput",
24 | "ScreenShotFolder": "TestOutput",
25 | "PageSourceFolder": "TestOutput",
26 | "FullDesktopScreenShotEnabled": "false",
27 | "SeleniumScreenShotEnabled": "false",
28 | "GetPageSourceEnabled": "false",
29 | "JavaScriptErrorLogging": "false",
30 | "JavaScriptErrorTypes": "SyntaxError,EvalError,ReferenceError,RangeError,TypeError,URIError,Refused to display,Internal Server Error,Cannot read property",
31 | "EnableEventFiringWebDriver": "false",
32 | "DataDrivenFile": "DataDriven/DataDriven.xml",
33 | "DataDrivenFileXlsx": "DataDriven/DataDriven.xlsx"
34 | },
35 |
36 | "FirefoxPreferences": {
37 | },
38 | "FirefoxExtensions": {
39 | },
40 | "FirefoxArguments": {
41 | "-headless": ""
42 | },
43 | "ChromePreferences": {
44 | },
45 | "ChromeExtensions": {
46 | },
47 | "DriverCapabilities": {
48 | },
49 | "ChromeArguments": {
50 | "headless": "",
51 | "no-sandbox": ""
52 | },
53 | "InternetExplorerPreferences": {
54 | }
55 | }
--------------------------------------------------------------------------------
/Ocaramba.Tests.Angular/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "appSettings": {
3 | "protocol": "http",
4 | "host": "www.protractortest.org",
5 | "browser": "Chrome",
6 | "url": "",
7 | "PathToChromeDriverDirectory": "",
8 | "PathToFirefoxDriverDirectory": "",
9 | "PathToInternetExplorerDriverDirectory": "",
10 | "ChromeBrowserExecutableLocation": "",
11 | "FireFoxBrowserExecutableLocation": "",
12 | "FirefoxUseLegacyImplementation": "false",
13 | "PathToFirefoxProfile": "",
14 | "RemoteWebDriverHub": "http://localhost:4444/wd/hub",
15 | "DriverCapabilities": "Chrome",
16 | "longTimeout": "30",
17 | "mediumTimeout": "10",
18 | "shortTimeout": "3",
19 | "ImplicitlyWaitMilliseconds": "200",
20 | "username": "admin",
21 | "password": "admin",
22 | "UseCurrentDirectory": "true",
23 | "DownloadFolder": "TestOutput",
24 | "ScreenShotFolder": "TestOutput",
25 | "PageSourceFolder": "TestOutput",
26 | "FullDesktopScreenShotEnabled": "true",
27 | "SeleniumScreenShotEnabled": "true",
28 | "GetPageSourceEnabled": "true",
29 | "JavaScriptErrorLogging": "false",
30 | "JavaScriptErrorTypes": "SyntaxError,EvalError,ReferenceError,RangeError,TypeError,URIError,Refused to display,Internal Server Error,Cannot read property",
31 | "EnableEventFiringWebDriver": "false"
32 | },
33 | "FirefoxPreferences": {
34 | },
35 | "FirefoxExtensions": {
36 | },
37 | "FirefoxArguments": {
38 | },
39 | "ChromePreferences": {
40 | },
41 | "ChromeExtensions": {
42 | },
43 | "DriverCapabilities": {
44 | },
45 | "ChromeArguments": {
46 | },
47 | "InternetExplorerPreferences": {
48 | "EnsureCleanSession": "false",
49 | "EnablePersistentHover": "false",
50 | "IntroduceInstabilityByIgnoringProtectedModeSettings": "true"
51 | }
52 | }
--------------------------------------------------------------------------------
/Ocaramba.Tests.Angular/nlog.config:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
18 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Ocaramba.Tests.CloudProviderCrossBrowser/.config/dotnet-tools.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | "isRoot": true,
4 | "tools": {
5 | "browserstack-sdk": {
6 | "version": "1.16.16",
7 | "commands": [
8 | "browserstack-sdk"
9 | ],
10 | "rollForward": false
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/Ocaramba.Tests.CloudProviderCrossBrowser/Ocaramba.Tests.CloudProviderCrossBrowser.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | net8.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | all
17 | runtime; build; native; contentfiles; analyzers; buildtransitive
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | Always
42 |
43 |
44 | Always
45 |
46 |
47 | PreserveNewest
48 |
49 |
50 | Always
51 |
52 |
53 |
54 |
55 | net8_0
56 |
57 |
58 |
59 |
60 | ..\Ocaramba\fxcop-sonarqube.tests.ruleset
61 |
62 |
63 |
64 | true
65 |
66 |
67 |
--------------------------------------------------------------------------------
/Ocaramba.Tests.CloudProviderCrossBrowser/Tests/HerokuappTestsNUnit.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved.
3 | //
4 | //
5 | // The MIT License (MIT)
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | // The above copyright notice and this permission notice shall be included in all
13 | // copies or substantial portions of the Software.
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | // SOFTWARE.
21 | //
22 |
23 | using System;
24 |
25 | namespace Ocaramba.Tests.CloudProviderCrossBrowser.Tests
26 | {
27 | using global::NUnit.Framework;
28 | using Ocaramba;
29 | using Ocaramba.Tests.PageObjects.PageObjects.TheInternet;
30 |
31 | [TestFixture("ChromeWindows")]
32 | [TestFixture("Android")]
33 | [TestFixture("Iphone")]
34 | [TestFixture("FirefoxWindows")]
35 | [TestFixture("SafariMac")]
36 | [TestFixture("EdgeChromiumWindows")]
37 | [TestFixture("IEWindows")]
38 | [Parallelizable(ParallelScope.Fixtures)]
39 | public class HerokuappTestsNUnit : ProjectTestBase
40 | {
41 | public HerokuappTestsNUnit(string environment)
42 | : base(environment)
43 | {
44 | }
45 |
46 | [Test]
47 | public void TablesTest()
48 | {
49 | var tableElements = new InternetPage(this.DriverContext)
50 | .OpenHomePage()
51 | .GoToTablesPage();
52 | var table = tableElements.GetTableElements();
53 |
54 | Assert.That(table[0][0], Is.EqualTo("Smith"));
55 | Assert.That(table[3][5].Trim().Replace("\r", String.Empty).Replace(" ", String.Empty).Replace("\n", String.Empty), Is.EqualTo("edit delete"));
56 | }
57 |
58 | [Test]
59 | public void DynamicallyLoadedPageElementsTest()
60 | {
61 | var page = new InternetPage(this.DriverContext)
62 | .OpenHomePage()
63 | .GoToDynamicLoading()
64 | .ClickOnExample2();
65 |
66 | page.ClickStart();
67 | Assert.That(page.Text, Is.EqualTo("Hello World!"));
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/Ocaramba.Tests.CloudProviderCrossBrowser/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "appSettings": {
3 | "protocol": "http",
4 | "host": "the-internet.herokuapp.com",
5 | "browser": "RemoteWebDriver",
6 | "url": "",
7 | "PathToChromeDriverDirectory": "",
8 | "PathToFirefoxDriverDirectory": "",
9 | "PathToInternetExplorerDriverDirectory": "",
10 | "ChromeBrowserExecutableLocation": "",
11 | "FireFoxBrowserExecutableLocation": "",
12 | "FirefoxUseLegacyImplementation": "false",
13 | "PathToFirefoxProfile": "",
14 | "RemoteWebDriverHub": "http://localhost:4444/wd/hub",
15 | "DriverCapabilities": "CloudProvider",
16 | "longTimeout": "30",
17 | "mediumTimeout": "10",
18 | "shortTimeout": "3",
19 | "ImplicitlyWaitMilliseconds": "200",
20 | "username": "admin",
21 | "password": "admin",
22 | "UseCurrentDirectory": "true",
23 | "DownloadFolder": "TestOutput",
24 | "ScreenShotFolder": "TestOutput",
25 | "PageSourceFolder": "TestOutput",
26 | "FullDesktopScreenShotEnabled": "true",
27 | "SeleniumScreenShotEnabled": "true",
28 | "GetPageSourceEnabled": "true",
29 | "JavaScriptErrorLogging": "false",
30 | "JavaScriptErrorTypes": "SyntaxError,EvalError,ReferenceError,RangeError,TypeError,URIError,Refused to display,Internal Server Error,Cannot read property",
31 | "EnableEventFiringWebDriver": "false",
32 | "DataDrivenFile": "DataDriven\\DataDriven.xml",
33 | "DataDrivenFileXlsx": "DataDriven\\DataDriven.xlsx"
34 | },
35 | "FirefoxPreferences": {
36 | },
37 | "FirefoxExtensions": {
38 | },
39 | "FirefoxArguments": {
40 | },
41 | "ChromePreferences": {
42 | },
43 | "ChromeExtensions": {
44 | },
45 | "DriverCapabilities": {
46 | "projectName": "Ocaramba",
47 | "debug": "true",
48 | "buildName": "Ocaramba.Tests.CloudProviderCrossBrowser",
49 | "networkLogs": "true",
50 | "local": "false"
51 | },
52 | "ChromeArguments": {
53 | },
54 | "InternetExplorerPreferences": {
55 | },
56 | "environments": {
57 | "ChromeWindows": {
58 | "browser": "Chrome",
59 | "os": "Windows",
60 | "osVersion": "11",
61 | "sessionName": "parallel_test"
62 | },
63 | "SafariMac": {
64 | "os": "OS X",
65 | "osVersion": "Sequoia",
66 | "resolution": "3840x2160",
67 | "sessionName": "parallel_test"
68 | },
69 | "EdgeChromiumWindows": {
70 | "browser": "Edge",
71 | "os": "Windows",
72 | "osVersion": "11",
73 | "sessionName": "parallel_test"
74 | },
75 | "IEWindows": {
76 | "browser": "IE",
77 | "os": "Windows",
78 | "osVersion": "10",
79 | "sessionName": "parallel_test"
80 | },
81 | "Android": {
82 | "browser": "samsung",
83 | "deviceName": "Samsung Galaxy S23 Ultra",
84 | "realMobile": "true",
85 | "sessionName": "parallel_test"
86 | },
87 | "Iphone": {
88 | "deviceName": "iPhone 15",
89 | "realMobile": "true",
90 | "sessionName": "parallel_test",
91 | "osVersion": 17,
92 | "deviceOrientation": "portrait"
93 | },
94 | "FirefoxWindows": {
95 | "browser": "firefox",
96 | "os": "Windows",
97 | "osVersion": "10",
98 | "sessionName": "parallel_test"
99 | }
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/Ocaramba.Tests.CloudProviderCrossBrowser/nlog.config:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
18 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Ocaramba.Tests.Features/appsettings.Linux.json:
--------------------------------------------------------------------------------
1 | {
2 | "appSettings": {
3 | "protocol": "http",
4 | "host": "the-internet.herokuapp.com",
5 | "browser": "Chrome",
6 | "url": "",
7 | "PathToChromeDriverDirectory": "",
8 | "PathToFirefoxDriverDirectory": "/home/appveyor/.nuget/packages/selenium.webdriver.geckodriver/0.25.0/driver/linux64",
9 | "PathToInternetExplorerDriverDirectory": "",
10 | "ChromeBrowserExecutableLocation": "",
11 | "FireFoxBrowserExecutableLocation": "",
12 | "FirefoxUseLegacyImplementation": "false",
13 | "PathToFirefoxProfile": "",
14 | "RemoteWebDriverHub": "http://localhost:4444/wd/hub",
15 | "DriverCapabilities": "Chrome",
16 | "longTimeout": "30",
17 | "mediumTimeout": "10",
18 | "shortTimeout": "3",
19 | "ImplicitlyWaitMilliseconds": "200",
20 | "username": "admin",
21 | "password": "admin",
22 | "UseCurrentDirectory": "true",
23 | "DownloadFolder": "TestOutput",
24 | "ScreenShotFolder": "TestOutput",
25 | "PageSourceFolder": "TestOutput",
26 | "FullDesktopScreenShotEnabled": "false",
27 | "SeleniumScreenShotEnabled": "true",
28 | "GetPageSourceEnabled": "false",
29 | "JavaScriptErrorLogging": "false",
30 | "JavaScriptErrorTypes": "SyntaxError,EvalError,ReferenceError,RangeError,TypeError,URIError,Refused to display,Internal Server Error,Cannot read property",
31 | "EnableEventFiringWebDriver": "false"
32 | },
33 |
34 | "FirefoxPreferences": {
35 | },
36 | "FirefoxExtensions": {
37 | },
38 | "FirefoxArguments": {
39 | "-headless": ""
40 | },
41 | "ChromePreferences": {
42 | },
43 | "ChromeExtensions": {
44 | },
45 | "DriverCapabilities": {
46 | },
47 | "ChromeArguments": {
48 | "headless": "",
49 | "no-sandbox": ""
50 | },
51 | "InternetExplorerPreferences": {
52 | }
53 | }
--------------------------------------------------------------------------------
/Ocaramba.Tests.Features/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "appSettings": {
3 | "protocol": "http",
4 | "host": "the-internet.herokuapp.com",
5 | "browser": "Chrome",
6 | "url": "",
7 | "PathToChromeDriverDirectory": "",
8 | "PathToFirefoxDriverDirectory": "",
9 | "PathToInternetExplorerDriverDirectory": "",
10 | "ChromeBrowserExecutableLocation": "",
11 | "FireFoxBrowserExecutableLocation": "",
12 | "FirefoxUseLegacyImplementation": "false",
13 | "PathToFirefoxProfile": "",
14 | "RemoteWebDriverHub": "http://localhost:4444/wd/hub",
15 | "DriverCapabilities": "Chrome",
16 | "longTimeout": "30",
17 | "mediumTimeout": "10",
18 | "shortTimeout": "3",
19 | "ImplicitlyWaitMilliseconds": "200",
20 | "username": "admin",
21 | "password": "admin",
22 | "UseCurrentDirectory": "true",
23 | "DownloadFolder": "TestOutput",
24 | "ScreenShotFolder": "TestOutput",
25 | "PageSourceFolder": "TestOutput",
26 | "FullDesktopScreenShotEnabled": "true",
27 | "SeleniumScreenShotEnabled": "true",
28 | "GetPageSourceEnabled": "true",
29 | "JavaScriptErrorLogging": "false",
30 | "JavaScriptErrorTypes": "SyntaxError,EvalError,ReferenceError,RangeError,TypeError,URIError,Refused to display,Internal Server Error,Cannot read property",
31 | "EnableEventFiringWebDriver": "false"
32 | },
33 | "FirefoxPreferences": {
34 | },
35 | "FirefoxExtensions": {
36 | },
37 | "FirefoxArguments": {
38 | },
39 | "ChromePreferences": {
40 | },
41 | "ChromeExtensions": {
42 | },
43 | "DriverCapabilities": {
44 | },
45 | "ChromeArguments": {
46 | },
47 | "InternetExplorerPreferences": {
48 | }
49 | }
--------------------------------------------------------------------------------
/Ocaramba.Tests.Features/nlog.config:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
18 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Ocaramba.Tests.MsTest/DDT.csv:
--------------------------------------------------------------------------------
1 | user, password, message
2 | tomsmith,SuperSecretPassword!,You logged into a secure area!
3 | wronguser,wrongpassword,Your username is invalid!
--------------------------------------------------------------------------------
/Ocaramba.Tests.MsTest/DDT.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 5
5 |
6 |
7 | tomsmith
8 | SuperSecretPassword!
9 | You logged into a secure area!
10 |
11 |
12 | wronguser
13 | wrongpassword
14 | Your username is invalid!
15 |
16 |
--------------------------------------------------------------------------------
/Ocaramba.Tests.MsTest/Runsettings.runsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | .\
6 |
7 |
8 |
9 | false
10 | False
11 | False
12 |
14 |
15 |
--------------------------------------------------------------------------------
/Ocaramba.Tests.MsTest/appsettings.Linux.json:
--------------------------------------------------------------------------------
1 | {
2 | "appSettings": {
3 | "protocol": "http",
4 | "host": "the-internet.herokuapp.com",
5 | "browser": "Chrome",
6 | "url": "",
7 | "PathToChromeDriverDirectory": "",
8 | "PathToFirefoxDriverDirectory": "",
9 | "PathToInternetExplorerDriverDirectory": "",
10 | "ChromeBrowserExecutableLocation": "",
11 | "FireFoxBrowserExecutableLocation": "",
12 | "FirefoxUseLegacyImplementation": "false",
13 | "PathToFirefoxProfile": "",
14 | "RemoteWebDriverHub": "http://localhost:4444/wd/hub",
15 | "DriverCapabilities": "Chrome",
16 | "longTimeout": "30",
17 | "mediumTimeout": "10",
18 | "shortTimeout": "3",
19 | "ImplicitlyWaitMilliseconds": "200",
20 | "username": "admin",
21 | "password": "admin",
22 | "UseCurrentDirectory": "true",
23 | "DownloadFolder": "TestOutput",
24 | "ScreenShotFolder": "TestOutput",
25 | "PageSourceFolder": "TestOutput",
26 | "FullDesktopScreenShotEnabled": "false",
27 | "SeleniumScreenShotEnabled": "true",
28 | "GetPageSourceEnabled": "false",
29 | "JavaScriptErrorLogging": "false",
30 | "JavaScriptErrorTypes": "SyntaxError,EvalError,ReferenceError,RangeError,TypeError,URIError,Refused to display,Internal Server Error,Cannot read property",
31 | "EnableEventFiringWebDriver": "false"
32 | },
33 |
34 | "FirefoxPreferences": {
35 | },
36 | "FirefoxExtensions": {
37 | },
38 | "FirefoxArguments": {
39 | "-headless": ""
40 | },
41 | "ChromePreferences": {
42 | },
43 | "ChromeExtensions": {
44 | },
45 | "DriverCapabilities": {
46 | },
47 | "ChromeArguments": {
48 | "headless": "",
49 | "no-sandbox": ""
50 | },
51 | "InternetExplorerPreferences": {
52 | }
53 | }
--------------------------------------------------------------------------------
/Ocaramba.Tests.MsTest/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "appSettings": {
3 | "protocol": "http",
4 | "host": "the-internet.herokuapp.com",
5 | "browser": "Chrome",
6 | "url": "",
7 | "PathToChromeDriverDirectory": "",
8 | "PathToFirefoxDriverDirectory": "",
9 | "PathToInternetExplorerDriverDirectory": "",
10 | "ChromeBrowserExecutableLocation": "",
11 | "FireFoxBrowserExecutableLocation": "",
12 | "FirefoxUseLegacyImplementation": "false",
13 | "PathToFirefoxProfile": "",
14 | "RemoteWebDriverHub": "http://localhost:4444/wd/hub",
15 | "DriverCapabilities": "Chrome",
16 | "longTimeout": "30",
17 | "mediumTimeout": "10",
18 | "shortTimeout": "3",
19 | "ImplicitlyWaitMilliseconds": "200",
20 | "username": "admin",
21 | "password": "admin",
22 | "UseCurrentDirectory": "true",
23 | "DownloadFolder": "TestOutput",
24 | "ScreenShotFolder": "TestOutput",
25 | "PageSourceFolder": "TestOutput",
26 | "FullDesktopScreenShotEnabled": "true",
27 | "SeleniumScreenShotEnabled": "true",
28 | "GetPageSourceEnabled": "true",
29 | "JavaScriptErrorLogging": "false",
30 | "JavaScriptErrorTypes": "SyntaxError,EvalError,ReferenceError,RangeError,TypeError,URIError,Refused to display,Internal Server Error,Cannot read property",
31 | "EnableEventFiringWebDriver": "false"
32 | },
33 | "FirefoxPreferences": {
34 | },
35 | "FirefoxExtensions": {
36 | },
37 | "FirefoxArguments": {
38 | },
39 | "ChromePreferences": {
40 | },
41 | "ChromeExtensions": {
42 | },
43 | "DriverCapabilities": {
44 | },
45 | "ChromeArguments": {
46 | },
47 | "InternetExplorerPreferences": {
48 | }
49 | }
--------------------------------------------------------------------------------
/Ocaramba.Tests.MsTest/nlog.config:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
18 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Ocaramba.Tests.NUnit/DataDriven/DataDriven.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Accenture/Ocaramba/9899dd10368b16479399880efc5fee96aea25856/Ocaramba.Tests.NUnit/DataDriven/DataDriven.xlsx
--------------------------------------------------------------------------------
/Ocaramba.Tests.NUnit/DataDriven/DataDriven.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Ocaramba.Tests.NUnit/DataDriven/TestData.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved.
3 | //
4 | //
5 | // The MIT License (MIT)
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | // The above copyright notice and this permission notice shall be included in all
13 | // copies or substantial portions of the Software.
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | // SOFTWARE.
21 | //
22 |
23 | using System.IO;
24 |
25 | namespace Ocaramba.Tests.NUnit.DataDriven
26 | {
27 | using System.Collections;
28 | using System.Globalization;
29 | using global::NUnit.Framework;
30 | using Ocaramba.Tests.NUnit.DataDriven;
31 |
32 | ///
33 | /// DataDriven methods for NUnit test framework
34 | ///
35 | public static class TestData
36 | {
37 | public static IEnumerable Credentials
38 | {
39 | get { return DataDrivenHelper.ReadDataDriveFile(ProjectBaseConfiguration.DataDrivenFile, "credential", new[] { "user", "password" }, "credential"); }
40 | }
41 |
42 | public static IEnumerable CredentialsExcel
43 | {
44 | get { return DataDrivenHelper.ReadXlsxDataDriveFile(ProjectBaseConfiguration.DataDrivenFileXlsx, "credential", new[] { "user", "password" }, "credentialExcel"); }
45 | }
46 |
47 | public static IEnumerable LinksSetTestName
48 | {
49 | get { return DataDrivenHelper.ReadDataDriveFile(ProjectBaseConfiguration.DataDrivenFile, "links", new[] { "number" }, "Count_links"); }
50 | }
51 |
52 | public static IEnumerable Links
53 | {
54 | get { return DataDrivenHelper.ReadDataDriveFile(ProjectBaseConfiguration.DataDrivenFile, "links"); }
55 | }
56 |
57 | public static IEnumerable LinksExcel()
58 | {
59 | return DataDrivenHelper.ReadXlsxDataDriveFile(ProjectBaseConfiguration.DataDrivenFileXlsx, "links");
60 | }
61 |
62 | public static IEnumerable CredentialsCSV()
63 | {
64 | return DataDrivenHelper.ReadDataDriveFileCsv(ProjectBaseConfiguration.DataDrivenFileCSV, new[] { "user", "password" }, "credentialCsv");
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/Ocaramba.Tests.NUnit/DataDriven/TestDataCsv.csv:
--------------------------------------------------------------------------------
1 | user;password;message
2 | test111;test222;Your username is invalid!
3 | tomsmith;SuperSecretPassword!;You logged into a secure area!
--------------------------------------------------------------------------------
/Ocaramba.Tests.NUnit/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "Ocaramba.Tests.NUnit": {
4 | "commandName": "Project",
5 | "environmentVariables": {
6 | "ASPNETCORE_ENVIRONMENT": "Linux"
7 | }
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/Ocaramba.Tests.NUnit/Tests/PerformanceTests1NUnit.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved.
3 | //
4 | //
5 | // The MIT License (MIT)
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | // The above copyright notice and this permission notice shall be included in all
13 | // copies or substantial portions of the Software.
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | // SOFTWARE.
21 | //
22 |
23 | namespace Ocaramba.Tests.NUnit.Tests
24 | {
25 | using global::NUnit.Framework;
26 | using Ocaramba.Tests.PageObjects.PageObjects.TheInternet;
27 |
28 | ///
29 | /// Tests to test framework
30 | ///
31 | [TestFixture]
32 | [Parallelizable(ParallelScope.Fixtures)]
33 | public class PerformanceTests1NUnit : ProjectTestBase
34 | {
35 | [Test]
36 | [Repeat(3)]
37 | public void HerokuappPerfTests1()
38 | {
39 | this.DriverContext.PerformanceMeasures.StartMeasure();
40 | InternetPage internet = new InternetPage(this.DriverContext);
41 | internet.OpenHomePage();
42 | this.DriverContext.PerformanceMeasures.StopMeasure(TestContext.CurrentContext.Test.Name + "LoadingMainPage");
43 | this.DriverContext.PerformanceMeasures.StartMeasure();
44 | internet.GoToCheckboxesPage();
45 | this.DriverContext.PerformanceMeasures.StopMeasure(TestContext.CurrentContext.Test.Name + "LoadingCheckboxesPage");
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/Ocaramba.Tests.NUnit/Tests/PerformanceTestsNUnit.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved.
3 | //
4 | //
5 | // The MIT License (MIT)
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | // The above copyright notice and this permission notice shall be included in all
13 | // copies or substantial portions of the Software.
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | // SOFTWARE.
21 | //
22 |
23 | namespace Ocaramba.Tests.NUnit.Tests
24 | {
25 | using global::NUnit.Framework;
26 | using Ocaramba.Tests.PageObjects.PageObjects.TheInternet;
27 |
28 | ///
29 | /// Tests to test framework
30 | ///
31 | [TestFixture]
32 | [Parallelizable(ParallelScope.Fixtures)]
33 | public class PerformanceTestsNUnit : ProjectTestBase
34 | {
35 | [Test]
36 | [Repeat(3)]
37 | public void HerokuappPerfTests()
38 | {
39 | this.DriverContext.PerformanceMeasures.StartMeasure();
40 | InternetPage internet = new InternetPage(this.DriverContext);
41 | internet.OpenHomePage();
42 | this.DriverContext.PerformanceMeasures.StopMeasure(TestContext.CurrentContext.Test.Name + "LoadingMainPage");
43 | this.DriverContext.PerformanceMeasures.StartMeasure();
44 | internet.GoToCheckboxesPage();
45 | this.DriverContext.PerformanceMeasures.StopMeasure(TestContext.CurrentContext.Test.Name + "LoadingCheckboxesPage");
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/Ocaramba.Tests.NUnit/Tests/SelectWebElementTests.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved.
3 | //
4 |
5 | namespace Ocaramba.Tests.NUnit.Tests
6 | {
7 | using global::NUnit.Framework;
8 | using Ocaramba.Tests.PageObjects.PageObjects.TheInternet;
9 |
10 | [TestFixture]
11 | [Parallelizable(ParallelScope.Fixtures)]
12 | public class SelectWebElementTests : ProjectTestBase
13 | {
14 | [Test]
15 | public void SelectByIndexTest()
16 | {
17 | var dropdownPage = new InternetPage(this.DriverContext)
18 | .OpenHomePage()
19 | .GoToDropdownPage();
20 |
21 | dropdownPage.SelectByIndex(1);
22 |
23 | Assert.That(dropdownPage.SelectedOption(), Is.EqualTo("Option 1"));
24 | }
25 |
26 | [Test]
27 | public void NoSuchElementExceptionByTextTest()
28 | {
29 | var dropdownPage = new InternetPage(this.DriverContext)
30 | .OpenHomePage()
31 | .GoToDropdownPage();
32 |
33 | Assert.That(() => dropdownPage.SelectByText("Qwerty.", 10), Throws.Nothing);
34 | }
35 |
36 | [Test]
37 | public void NoSuchElementExceptionByIndexTest()
38 | {
39 | var dropdownPage = new InternetPage(this.DriverContext)
40 | .OpenHomePage()
41 | .GoToDropdownPage();
42 |
43 | Assert.That(() => dropdownPage.SelectByIndex(7), Throws.Nothing);
44 | }
45 |
46 | [Test]
47 | public void NoSuchElementExceptionByValueTest()
48 | {
49 | var dropdownPage = new InternetPage(this.DriverContext)
50 | .OpenHomePage()
51 | .GoToDropdownPage();
52 |
53 | Assert.That(() => dropdownPage.SelectByValue("qwerty"), Throws.Nothing);
54 | }
55 | }
56 | }
--------------------------------------------------------------------------------
/Ocaramba.Tests.NUnit/appsettings.Linux.json:
--------------------------------------------------------------------------------
1 | {
2 | "appSettings": {
3 | "protocol": "http",
4 | "host": "the-internet.herokuapp.com",
5 | "browser": "Chrome",
6 | "url": "",
7 | "PathToChromeDriverDirectory": "",
8 | "PathToFirefoxDriverDirectory": "",
9 | "PathToInternetExplorerDriverDirectory": "",
10 | "PathToEdgeChromiumDriverDirectory": "",
11 | "ChromeBrowserExecutableLocation": "",
12 | "FireFoxBrowserExecutableLocation": "",
13 | "EnableVerboseLoggingChrome": "false",
14 | "PathToChromeDriverLog": "C:\\Temp\\chromedriver.log",
15 | "FirefoxUseLegacyImplementation": "false",
16 | "PathToFirefoxProfile": "",
17 | "RemoteWebDriverHub": "http://localhost:4444/wd/hub",
18 | "DriverCapabilities": "Chrome",
19 | "longTimeout": "30",
20 | "mediumTimeout": "10",
21 | "shortTimeout": "3",
22 | "ImplicitlyWaitMilliseconds": "200",
23 | "username": "admin",
24 | "password": "admin",
25 | "UseCurrentDirectory": "true",
26 | "DownloadFolder": "TestOutput",
27 | "ScreenShotFolder": "TestOutput",
28 | "PageSourceFolder": "TestOutput",
29 | "FullDesktopScreenShotEnabled": "false",
30 | "SeleniumScreenShotEnabled": "true",
31 | "GetPageSourceEnabled": "false",
32 | "JavaScriptErrorLogging": "false",
33 | "JavaScriptErrorTypes": "SyntaxError,EvalError,ReferenceError,RangeError,TypeError,URIError,Refused to display,Internal Server Error,Cannot read property",
34 | "EnableEventFiringWebDriver": "false",
35 | "DataDrivenFile": "DataDriven/DataDriven.xml",
36 | "DataDrivenFileCSV": "DataDriven/TestDataCsv.csv",
37 | "DataDrivenFileXlsx": "DataDriven/DataDriven.xlsx"
38 | },
39 |
40 | "FirefoxPreferences": {
41 | },
42 | "FirefoxExtensions": {
43 | },
44 | "FirefoxArguments": {
45 | "-headless": ""
46 | },
47 | "ChromePreferences": {
48 | },
49 | "ChromeExtensions": {
50 | },
51 | "DriverCapabilities": {
52 | },
53 | "ChromeArguments": {
54 | "headless": "",
55 | "no-sandbox": "",
56 | "disable-dev-shm-usage": ""
57 | },
58 | "InternetExplorerPreferences": {
59 | },
60 | "EdgeChromiumPreferences": {
61 | },
62 | "EdgeChromiumExtensions": {
63 | },
64 | "EdgeChromiumArguments": {
65 | "headless": "",
66 | "disable-gpu": ""
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/Ocaramba.Tests.NUnit/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "appSettings": {
3 | "protocol": "http",
4 | "host": "the-internet.herokuapp.com",
5 | "browser": "Chrome",
6 | "url": "",
7 | "PathToChromeDriverDirectory": "",
8 | "PathToFirefoxDriverDirectory": "",
9 | "PathToInternetExplorerDriverDirectory": "",
10 | "PathToEdgeChromiumDriverDirectory": "",
11 | "ChromeBrowserExecutableLocation": "",
12 | "FireFoxBrowserExecutableLocation": "",
13 | "EdgeChromiumBrowserExecutableLocation": "",
14 | "EnableVerboseLoggingChrome": "false",
15 | "PathToChromeDriverLog": "C:\\Temp\\chromedriver.log",
16 | "FirefoxUseLegacyImplementation": "false",
17 | "PathToFirefoxProfile": "",
18 | "RemoteWebDriverHub": "http://localhost:4444/wd/hub",
19 | "remoteTimeout": "300",
20 | "DriverCapabilities": "Chrome",
21 | "longTimeout": "30",
22 | "mediumTimeout": "10",
23 | "shortTimeout": "3",
24 | "ImplicitlyWaitMilliseconds": "200",
25 | "username": "admin",
26 | "password": "admin",
27 | "UseCurrentDirectory": "true",
28 | "DownloadFolder": "TestOutput",
29 | "ScreenShotFolder": "TestOutput",
30 | "PageSourceFolder": "TestOutput",
31 | "FullDesktopScreenShotEnabled": "true",
32 | "SeleniumScreenShotEnabled": "true",
33 | "GetPageSourceEnabled": "true",
34 | "JavaScriptErrorLogging": "false",
35 | "JavaScriptErrorTypes": "SyntaxError,EvalError,ReferenceError,RangeError,TypeError,URIError,Refused to display,Internal Server Error,Cannot read property",
36 | "EnableEventFiringWebDriver": "false",
37 | "DataDrivenFile": "DataDriven\\DataDriven.xml",
38 | "DataDrivenFileCSV": "DataDriven\\TestDataCsv.csv",
39 | "DataDrivenFileXlsx": "DataDriven\\DataDriven.xlsx"
40 | },
41 |
42 | "FirefoxPreferences": {
43 | },
44 | "FirefoxExtensions": {
45 | },
46 | "FirefoxArguments": {
47 | },
48 | "ChromePreferences": {
49 | },
50 | "ChromeExtensions": {
51 | },
52 | "DriverCapabilities": {
53 | },
54 | "ChromeArguments": {
55 | },
56 | "InternetExplorerPreferences": {
57 | },
58 | "EdgeChromiumPreferences": {
59 | },
60 | "EdgeChromiumExtensions": {
61 | },
62 | "EdgeChromiumArguments": {
63 | }
64 | }
--------------------------------------------------------------------------------
/Ocaramba.Tests.NUnit/nlog.config:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
18 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Ocaramba.Tests.NUnitExtentReports/ExtentLogger/ExtentTestLogger.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework.Interfaces;
2 | using AventStack.ExtentReports; // Add this using directive
3 |
4 | namespace Ocaramba.Tests.NUnitExtentReports.ExtentLogger
5 | {
6 | ///
7 | /// Class containing methods enabling writing messages to Extent Report HTML file
8 | ///
9 | class ExtentTestLogger : ProjectTestBase
10 | {
11 | ///
12 | /// Log Info entry in HTML file
13 | ///
14 | /// The message
15 | public static void Info(string message)
16 | {
17 | test.Info(message);
18 | }
19 |
20 | ///
21 | /// Log Warning entry in HTML file
22 | ///
23 | /// The message
24 | public static void Warning(string message)
25 | {
26 | test.Warning(message);
27 | }
28 |
29 | ///
30 | /// Log Test Pass status in HTML file
31 | ///
32 | /// The message
33 | public static void Pass(string message)
34 | {
35 | test.Pass(message);
36 | }
37 |
38 | ///
39 | /// Log Test Failed status in HTML file
40 | ///
41 | /// Test status
42 | /// Error message
43 | public static void Fail(TestStatus status, string errorMessage)
44 | {
45 | test.Fail(status + ": " + errorMessage);
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/Ocaramba.Tests.NUnitExtentReports/PageObject/BasicAuthPage.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved.
3 | //
4 | //
5 | // The MIT License (MIT)
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | // The above copyright notice and this permission notice shall be included in all
13 | // copies or substantial portions of the Software.
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | // SOFTWARE.
21 | //
22 |
23 | namespace Ocaramba.Tests.NUnitExtentReports.PageObjects
24 | {
25 | using System.Globalization;
26 | using NLog;
27 | using Ocaramba;
28 | using Ocaramba.Extensions;
29 | using Ocaramba.Tests.PageObjects;
30 | using Ocaramba.Types;
31 |
32 | public class BasicAuthPage : ProjectPageBase
33 | {
34 | private static readonly NLog.Logger Logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger();
35 |
36 | ///
37 | /// Locators for elements
38 | ///
39 | private readonly ElementLocator pageHeader = new ElementLocator(Locator.XPath, "//h3[.='Basic Auth']"),
40 | congratulationsInfo = new ElementLocator(Locator.CssSelector, ".example>p");
41 |
42 | public BasicAuthPage(DriverContext driverContext)
43 | : base(driverContext)
44 | {
45 | Logger.Info("Waiting for page to open");
46 | this.Driver.IsElementPresent(this.pageHeader, BaseConfiguration.ShortTimeout);
47 | }
48 |
49 | public string GetCongratulationsInfo
50 | {
51 | get
52 | {
53 | var text = this.Driver.GetElement(this.congratulationsInfo, "Trying to get congratulations Info").Text;
54 | Logger.Info(CultureInfo.CurrentCulture, "Text from page '{0}'", text);
55 | return text;
56 | }
57 | }
58 |
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Ocaramba.Tests.NUnitExtentReports/PageObject/BrokenImagesPage.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved.
3 | //
4 | //
5 | // The MIT License (MIT)
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | // The above copyright notice and this permission notice shall be included in all
13 | // copies or substantial portions of the Software.
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | // SOFTWARE.
21 | //
22 |
23 | namespace Ocaramba.Tests.NUnitExtentReports.PageObjects
24 | {
25 | using Ocaramba;
26 | using Ocaramba.Extensions;
27 | using Ocaramba.Types;
28 |
29 | public class BrokenImagesPage : InternetPage
30 | {
31 | private readonly ElementLocator
32 | pageHeaderElement = new ElementLocator(Locator.CssSelector, "h3");
33 |
34 | public BrokenImagesPage(DriverContext driverContext)
35 | : base(driverContext)
36 | {
37 | }
38 |
39 | public bool IsPageHeaderElementEqualsToExpected(string text)
40 | {
41 | return this.Driver.GetElement(this.pageHeaderElement).IsElementTextEqualsToExpected(text);
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/Ocaramba.Tests.NUnitExtentReports/PageObject/DragAndDropPage.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved.
3 | //
4 | //
5 | // The MIT License (MIT)
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | // The above copyright notice and this permission notice shall be included in all
13 | // copies or substantial portions of the Software.
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | // SOFTWARE.
21 | //
22 |
23 | namespace Ocaramba.Tests.NUnitExtentReports.PageObjects
24 | {
25 | using Ocaramba;
26 | using Ocaramba.Extensions;
27 | using Ocaramba.Tests.NUnitExtentReports.ExtentLogger;
28 | using Ocaramba.Tests.PageObjects;
29 | using Ocaramba.Types;
30 |
31 | public class DragAndDropPage : ProjectPageBase
32 | {
33 | private readonly ElementLocator boxA = new ElementLocator(Locator.Id, "column-a");
34 | private readonly ElementLocator boxB = new ElementLocator(Locator.Id, "column-b");
35 | private readonly ElementLocator boxBtext = new ElementLocator(Locator.XPath, "//div[@id='column-b']/header");
36 | private readonly ElementLocator classNameLocator = new ElementLocator(Locator.ClassName, "example");
37 |
38 | private readonly ElementLocator cssSelectorLocator = new ElementLocator(Locator.CssSelector, "[class='example']");
39 |
40 | public DragAndDropPage(DriverContext driverContext)
41 | : base(driverContext)
42 | {
43 | }
44 |
45 | public DragAndDropPage MoveElementAtoElementB()
46 | {
47 | ExtentTestLogger.Info("DragAndDropPage: Moving Box A element to Box B");
48 | this.Driver.DragAndDropJs(this.Driver.GetElement(this.boxA), this.Driver.GetElement(this.boxB));
49 | return this;
50 | }
51 |
52 | public bool IsElementAMovedToB()
53 | {
54 | return this.Driver.GetElement(this.boxBtext).Text.Equals("A");
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/Ocaramba.Tests.NUnitExtentReports/PageObject/DropdownPage.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Objectivity Bespoke Software Specialists. All rights reserved.
3 | //
4 | //
5 | // The MIT License (MIT)
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | // The above copyright notice and this permission notice shall be included in all
13 | // copies or substantial portions of the Software.
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | // SOFTWARE.
21 | //
22 |
23 | namespace Ocaramba.Tests.NUnitExtentReports.PageObjects
24 | {
25 | using Ocaramba;
26 | using Ocaramba.Extensions;
27 | using Ocaramba.Tests.NUnitExtentReports.ExtentLogger;
28 | using Ocaramba.Tests.PageObjects;
29 | using Ocaramba.Types;
30 | using Ocaramba.WebElements;
31 |
32 | public class DropdownPage : ProjectPageBase
33 | {
34 | private readonly ElementLocator dropDownLocator = new ElementLocator(
35 | Locator.Id, "dropdown");
36 |
37 | public DropdownPage(DriverContext driverContext)
38 | : base(driverContext)
39 | {
40 | }
41 |
42 | public void SelectByIndex(int index)
43 | {
44 | ExtentTestLogger.Info("DropdownPage: Selecting element on dropdown by index: " + index);
45 | Select select = this.Driver.GetElement