-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
248 additions
and
238 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
File renamed without changes.
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,19 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp2.2</TargetFramework> | ||
|
||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="2.2.0" /> | ||
<PackageReference Include="nunit" Version="3.11.0" /> | ||
<PackageReference Include="NUnit3TestAdapter" Version="3.11.0" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" /> | ||
<PackageReference Include="Selenium.Support" Version="3.141.0" /> | ||
<PackageReference Include="Selenium.WebDriver" Version="3.141.0" /> | ||
<PackageReference Include="System.Diagnostics.Contracts" Version="4.3.0" /> | ||
</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,16 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Selenium", "Selenium.csproj", "{E45A9547-F4BA-4DE4-9D29-875DD8D54794}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{E45A9547-F4BA-4DE4-9D29-875DD8D54794}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{E45A9547-F4BA-4DE4-9D29-875DD8D54794}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{E45A9547-F4BA-4DE4-9D29-875DD8D54794}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{E45A9547-F4BA-4DE4-9D29-875DD8D54794}.Release|Any CPU.Build.0 = Release|Any CPU | ||
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,24 @@ | ||
{ | ||
"BaseUrl": "https://www.google.com/", | ||
"Username": "sayem", | ||
"Password": "Passw0rd!", | ||
|
||
"RemoteBrowser": "false", | ||
|
||
"Browser": "Chrome", | ||
|
||
"Platform": "Windows 7", | ||
|
||
"UseSeleniumGrid": "false", | ||
"GridHubUrl": "http://localhost:4444/wd/hub", | ||
|
||
"UseSauceLabs": "true", | ||
"SauceLabsUsername": "ssayem", | ||
"SauceLabsAccessKey": "", | ||
"SauceLabsHubUrl": "http://ondemand.saucelabs.com:80/wd/hub", | ||
|
||
"UseBrowserstack": "false", | ||
"BrowserStackUsername": "ssayem", | ||
"BrowserStackAccessKey": "", | ||
"BrowserStackHubUrl": "http://hub-cloud.browserstack.com/wd/hub/" | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion
1
src/Selenium/Selenium/core/TestBase.cs → Selenium/core/TestBase.cs
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
File renamed without changes.
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
File renamed without changes.
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
5 changes: 1 addition & 4 deletions
5
...ium/Selenium/core/browsers/BrowserType.cs → Selenium/core/browsers/BrowserType.cs
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
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,44 @@ | ||
using System; | ||
using System.IO; | ||
using Microsoft.Extensions.Configuration; | ||
|
||
namespace Selenium.core.browsers | ||
{ | ||
public class Config | ||
{ | ||
public static bool RemoteBrowser => bool.Parse(GetValue("RemoteBrowser")); | ||
|
||
public static BrowserType Browser | ||
=> (BrowserType) Enum.Parse(typeof(BrowserType), GetValue("Browser")); | ||
|
||
public static string Platform => GetValue("Platform"); | ||
public static string BaseUrl => GetValue("BaseUrl"); | ||
public static string Username => GetValue("Username"); | ||
public static string Password => GetValue("Password"); | ||
|
||
public static bool UseSeleniumGrid => bool.Parse(GetValue("UseSeleniumGrid")); | ||
public static string GridHubUri => GetValue("GridHubUrl"); | ||
|
||
public static bool UseSauceLabs => bool.Parse(GetValue("UseSauceLabs")); | ||
public static string SauceLabsHubUri => GetValue("SauceLabsHubUrl"); | ||
public static string SauceLabsUsername => GetValue("SauceLabsUsername"); | ||
public static string SauceLabsAccessKey => GetValue("SauceLabsAccessKey"); | ||
|
||
public static bool UseBrowserstack => bool.Parse(GetValue("BrowserStack")); | ||
public static string BrowserStackHubUrl => GetValue("BrowserStackHubUrl"); | ||
public static string BrowserStackUsername => GetValue("BrowserStackUsername"); | ||
public static string BrowserStackAccessKey => GetValue("BrowserStackAccessKey"); | ||
|
||
private static string GetValue(string value) | ||
{ | ||
var dirName = AppContext.BaseDirectory.Substring(0, AppContext.BaseDirectory.IndexOf("bin")); | ||
var fileInfo = new FileInfo(dirName); | ||
var parentDirName = fileInfo?.FullName; | ||
|
||
var builder = new ConfigurationBuilder() | ||
.SetBasePath(parentDirName) | ||
.AddJsonFile("appsettings.json"); | ||
return builder.Build()[value]; | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
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,43 @@ | ||
using System; | ||
using Selenium.core.browsers; | ||
|
||
namespace Selenium.pages | ||
{ | ||
public class HomePage | ||
{ | ||
private readonly IBrowser _browser; | ||
|
||
public HomePage(IBrowser browser) | ||
{ | ||
_browser = browser; | ||
} | ||
|
||
public RegisterPage Register() | ||
{ | ||
Console.WriteLine("Navigating to Register page"); | ||
_browser.Page.GoToUrl("http://www.google.com"); | ||
return new RegisterPage(_browser); | ||
} | ||
|
||
public RegisterPage OpenYahooPage() | ||
{ | ||
Console.WriteLine("Navigating to Yahoo page"); | ||
_browser.Page.GoToUrl("http://www.yahoo.com"); | ||
return new RegisterPage(_browser); | ||
} | ||
|
||
public RegisterPage OpenGooglePage() | ||
{ | ||
Console.WriteLine("Navigating to Google page"); | ||
_browser.Page.GoToUrl("http://www.google.com"); | ||
return new RegisterPage(_browser); | ||
} | ||
|
||
public RegisterPage OpenGithubPage() | ||
{ | ||
Console.WriteLine("Navigating to Github page"); | ||
_browser.Page.GoToUrl("http://www.github.com"); | ||
return new RegisterPage(_browser); | ||
} | ||
} | ||
} |
File renamed without changes.
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,18 @@ | ||
using NUnit.Framework; | ||
using Selenium.core; | ||
using Selenium.pages; | ||
|
||
namespace Selenium.tests | ||
{ | ||
[TestFixture] | ||
[Parallelizable] | ||
public class GithubTest : TestBase | ||
{ | ||
[Test] | ||
public void TestMethod() | ||
{ | ||
var page = new HomePage(Driver); | ||
page.OpenGithubPage(); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.