-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding BaseLine code
- Loading branch information
Showing
153 changed files
with
8,631 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.30330.147 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestCodeChallenge", "TestCodeChallenge\TestCodeChallenge.csproj", "{30320792-AEDC-4D4E-A4B3-BEF2273D936A}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{30320792-AEDC-4D4E-A4B3-BEF2273D936A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{30320792-AEDC-4D4E-A4B3-BEF2273D936A}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{30320792-AEDC-4D4E-A4B3-BEF2273D936A}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{30320792-AEDC-4D4E-A4B3-BEF2273D936A}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {3D968A08-79E2-4191-A779-C64F89BE59F2} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
|
||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="DotNetSeleniumExtras.PageObjects.Core" Version="3.12.0" /> | ||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> | ||
<PackageReference Include="nunit" Version="3.12.0" /> | ||
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" /> | ||
<PackageReference Include="Selenium.Support" Version="3.141.0" /> | ||
<PackageReference Include="Selenium.WebDriver" Version="3.141.0" /> | ||
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="84.0.4147.3001" /> | ||
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="config\config.json"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
using NUnit.Framework; | ||
using OpenQA.Selenium; | ||
using SeleniumExtras.PageObjects; | ||
using TestCodeChallange.pom; | ||
|
||
namespace TestCodeChallange | ||
{ | ||
[TestFixture] | ||
public class TestFocus | ||
{ | ||
protected IWebDriver web_driver; | ||
HomePage p_home; | ||
WindowsPage p_windows; | ||
SearchPage p_search; | ||
DetailsPage p_details; | ||
CartPage p_cart; | ||
|
||
[OneTimeSetUp] | ||
public void OneTimeSetUp() | ||
{ | ||
p_home = new HomePage(web_driver); | ||
web_driver = p_home.DriverConn(); | ||
|
||
p_windows = new WindowsPage(web_driver); | ||
p_search = new SearchPage(web_driver); | ||
p_details = new DetailsPage(web_driver); | ||
p_cart = new CartPage(web_driver); | ||
} | ||
|
||
[Test, Order(1)] | ||
public void TestHomePageMenu() | ||
{ | ||
p_home.LoadHomePage(); | ||
Assert.IsTrue(p_home.ValidateMenu(), "Menu is not valid, Missing Items", null); | ||
} | ||
|
||
[Test, Order(2)] | ||
public void TestWindowsPageDD() | ||
{ | ||
p_windows.LoadWindowsPage(); | ||
p_windows.ClickWindow(); | ||
Assert.IsTrue(p_windows.ValidateHasDDValues(), "DD is not valid, has no DD values to print", null); | ||
} | ||
|
||
[Test, Order(3)] | ||
public void TestDetailsPrice() | ||
{ | ||
p_search.LoadSearchPage(); | ||
p_search.SendSearchInput(); | ||
p_search.LoadSoftwareListItems(); | ||
p_details.LoadDetailsPage(); | ||
Assert.IsTrue(p_details.ValidateDetailsPrice(p_search.ItemPriceSearch), "Prices on Search Page and Detail Page for First Item are not the same Price Value", null); | ||
} | ||
|
||
[Test, Order(4)] | ||
public void TestCartPrice() | ||
{ | ||
p_cart.LoadCartPage(); | ||
Assert.IsTrue(p_cart.ValidateCartPrice(p_search.ItemPriceSearch), "Prices on Cart are not a match, 3 prices on screen are not the same", null); | ||
} | ||
|
||
[Test, Order(5)] | ||
public void TestCart20ItemsPrice() | ||
{ | ||
p_cart.LoadCar20Items(); | ||
Assert.IsTrue(p_cart.ValidateCart20ItemsPrice(), "Total Price of 20 Items base on Unit Price is not correct, the price don't match", null); | ||
} | ||
|
||
[OneTimeTearDown] | ||
public void OneTimeTearDown() | ||
{ | ||
p_home.DriverDown(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using OpenQA.Selenium; | ||
using SeleniumExtras.PageObjects; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Text; | ||
|
||
namespace TestCodeChallange.pom | ||
{ | ||
public abstract class APage : IPage | ||
{ | ||
public APage() { } | ||
|
||
public abstract IWebDriver DriverConn(); | ||
|
||
public abstract void DriverDown(); | ||
|
||
public abstract IWebElement FindElement(By locator); | ||
|
||
public abstract List<IWebElement> FindElements(By locator); | ||
|
||
public abstract string GetText(IWebElement element); | ||
|
||
public abstract string GetTextBy(By locator); | ||
|
||
public abstract void ClickByLocator(By locator); | ||
|
||
public abstract void TypeText(string inputText, By locator); | ||
|
||
public abstract bool IsDisplayed(By locator); | ||
|
||
public abstract void Visit(string node); | ||
|
||
public abstract void ExecJavaScript(string javaCode); | ||
|
||
public abstract void ClickByElement(IWebElement element); | ||
|
||
public abstract void MoveToByElement(IWebElement element); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using OpenQA.Selenium; | ||
|
||
namespace TestCodeChallange.pom | ||
{ | ||
interface IPage | ||
{ | ||
public IWebDriver DriverConn(); | ||
|
||
public void DriverDown(); | ||
|
||
public IWebElement FindElement(By locator); | ||
|
||
public List<IWebElement> FindElements(By locator); | ||
|
||
public string GetText(IWebElement element); | ||
|
||
public string GetTextBy(By locator); | ||
|
||
public void ClickByLocator(By locator); | ||
|
||
public void TypeText(string inputText, By locator); | ||
|
||
public bool IsDisplayed(By locator); | ||
|
||
public void Visit(string node); | ||
|
||
public void ExecJavaScript(string javaCode); | ||
|
||
public void ClickByElement(IWebElement element); | ||
|
||
public void MoveToByElement(IWebElement element); | ||
} | ||
} |
Binary file added
BIN
+23.1 KB
TestCodeChallenge/bin/Debug/netcoreapp3.1/Microsoft.DotNet.InternalAbstractions.dll
Binary file not shown.
Binary file added
BIN
+95.5 KB
TestCodeChallenge/bin/Debug/netcoreapp3.1/Microsoft.TestPlatform.CommunicationUtilities.dll
Binary file not shown.
Binary file added
BIN
+51 KB
TestCodeChallenge/bin/Debug/netcoreapp3.1/Microsoft.TestPlatform.CoreUtilities.dll
Binary file not shown.
Binary file added
BIN
+161 KB
TestCodeChallenge/bin/Debug/netcoreapp3.1/Microsoft.TestPlatform.CrossPlatEngine.dll
Binary file not shown.
Binary file added
BIN
+38.3 KB
TestCodeChallenge/bin/Debug/netcoreapp3.1/Microsoft.TestPlatform.PlatformAbstractions.dll
Binary file not shown.
Binary file added
BIN
+49.5 KB
TestCodeChallenge/bin/Debug/netcoreapp3.1/Microsoft.TestPlatform.Utilities.dll
Binary file not shown.
Binary file added
BIN
+23.3 KB
TestCodeChallenge/bin/Debug/netcoreapp3.1/Microsoft.VisualStudio.CodeCoverage.Shim.dll
Binary file not shown.
Binary file added
BIN
+153 KB
TestCodeChallenge/bin/Debug/netcoreapp3.1/Microsoft.VisualStudio.TestPlatform.Common.dll
Binary file not shown.
Binary file added
BIN
+156 KB
...CodeChallenge/bin/Debug/netcoreapp3.1/Microsoft.VisualStudio.TestPlatform.ObjectModel.dll
Binary file not shown.
Binary file added
BIN
+22.6 KB
TestCodeChallenge/bin/Debug/netcoreapp3.1/Microsoft.Win32.SystemEvents.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+18 KB
TestCodeChallenge/bin/Debug/netcoreapp3.1/SeleniumExtras.PageObjects.dll
Binary file not shown.
Binary file added
BIN
+367 KB
TestCodeChallenge/bin/Debug/netcoreapp3.1/System.Configuration.ConfigurationManager.dll
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+17.4 KB
TestCodeChallenge/bin/Debug/netcoreapp3.1/System.Security.Cryptography.ProtectedData.dll
Binary file not shown.
Binary file added
BIN
+90.4 KB
TestCodeChallenge/bin/Debug/netcoreapp3.1/System.Security.Permissions.dll
Binary file not shown.
Binary file added
BIN
+25.4 KB
TestCodeChallenge/bin/Debug/netcoreapp3.1/System.Windows.Extensions.dll
Binary file not shown.
Binary file added
BIN
+116 KB
TestCodeChallenge/bin/Debug/netcoreapp3.1/System.Xml.XPath.XmlDocument.dll
Binary file not shown.
Oops, something went wrong.