-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from tnypxl/move-to-single-project
Move to single project
- Loading branch information
Showing
23 changed files
with
1,078 additions
and
14 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,11 @@ | ||
{ | ||
"SiteConfig": { | ||
"Name": "DuckDuckGo", | ||
"Url": "https://duckduckgo.com" | ||
}, | ||
|
||
"DriverConfig": { | ||
"Browser": "Chrome", | ||
"Timeout": 20 | ||
} | ||
} |
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
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,73 @@ | ||
// <auto-generated /> | ||
|
||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using Basin.Config.Interfaces; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
|
||
namespace Basin | ||
{ | ||
public partial class Basin | ||
{ | ||
[JsonProperty("Site")] public SiteConfig Site { get; set; } | ||
|
||
[JsonProperty("Driver")] public DriverConfig Driver { get; set; } | ||
|
||
[JsonProperty("Logins")] public List<LoginConfig> Logins { get; set; } | ||
} | ||
|
||
public class DriverConfig : IDriverConfig | ||
{ | ||
[JsonProperty("Timeout")] public int Timeout { get; set; } | ||
|
||
[JsonProperty("Browser")] public string Browser { get; set; } | ||
} | ||
|
||
public class LoginConfig : ILoginConfig | ||
{ | ||
[JsonProperty("Role")] public string Role { get; set; } | ||
|
||
[JsonProperty("Username")] public string Username { get; set; } | ||
|
||
[JsonProperty("Password")] public string Password { get; set; } | ||
|
||
[JsonProperty("Token")] public string Token { get; set; } | ||
} | ||
|
||
public class SiteConfig : ISiteConfig | ||
{ | ||
[JsonProperty("Name")] public string Name { get; set; } | ||
|
||
[JsonProperty("Url")] public string Url { get; set; } | ||
} | ||
|
||
public partial class Basin | ||
{ | ||
public static Basin FromJson(string json) | ||
{ | ||
return JsonConvert.DeserializeObject<Basin>(json, Converter.Settings); | ||
} | ||
} | ||
|
||
public static class Serialize | ||
{ | ||
public static string ToJson(this Basin self) | ||
{ | ||
return JsonConvert.SerializeObject(self, Converter.Settings); | ||
} | ||
} | ||
|
||
internal static class Converter | ||
{ | ||
public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings | ||
{ | ||
MetadataPropertyHandling = MetadataPropertyHandling.Ignore, | ||
DateParseHandling = DateParseHandling.None, | ||
Converters = | ||
{ | ||
new IsoDateTimeConverter {DateTimeStyles = DateTimeStyles.AssumeUniversal} | ||
} | ||
}; | ||
} | ||
} |
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 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<PackageId>BasinFramework</PackageId> | ||
<PackageVersion>0.0.1</PackageVersion> | ||
<Title>Arik Jones</Title> | ||
<Authors>BasinFramework</Authors> | ||
<TargetFrameworks>net472;netcoreapp2.1</TargetFrameworks> | ||
<LangVersion>8</LangVersion> | ||
<Copyright>Arik Jones</Copyright> | ||
<PackageProjectUrl>https://github.com/tnypxl/BasinFrameworkDotNetCore</PackageProjectUrl> | ||
<PackageLicenseUrl>https://raw.githubusercontent.com/tnypxl/BasinFrameworkDotNetCore/master/LICENSE</PackageLicenseUrl> | ||
<RepositoryUrl>https://github.com/tnypxl/BasinFrameworkDotNetCore</RepositoryUrl> | ||
<RepositoryType>GitHub</RepositoryType> | ||
<PackageTags>selenium, browser, automation, framework</PackageTags> | ||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> | ||
<PackageReference Include="Selenium.WebDriver" Version="3.141.0" /> | ||
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="80.0.3987.10600" /> | ||
<PackageReference Include="Selenium.WebDriver.GeckoDriver" Version="0.26.0" /> | ||
<PackageReference Include="Selenium.WebDriver.IEDriver" Version="3.150.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Folder Include="Config" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Reference Include="Microsoft.CSharp" Condition="'$(TargetFramework)' == 'net472'" /> | ||
<Reference Include="Mono.CSharp" Condition="'$(TargetFramework)' == 'net472'" /> | ||
</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,12 @@ | ||
using System; | ||
|
||
namespace Basin.Config.Interfaces | ||
{ | ||
public interface IDatabaseConfig | ||
{ | ||
Uri Host { get; set; } | ||
string Port { get; set; } | ||
string Username { get; set; } | ||
string Password { get; set; } | ||
} | ||
} |
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,8 @@ | ||
namespace Basin.Config.Interfaces | ||
{ | ||
public interface IDriverConfig | ||
{ | ||
int Timeout { get; set; } | ||
string Browser { get; set; } | ||
} | ||
} |
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,10 @@ | ||
namespace Basin.Config.Interfaces | ||
{ | ||
public interface ILoginConfig | ||
{ | ||
string Role { get; set; } | ||
string Username { get; set; } | ||
string Password { get; set; } | ||
string Token { get; set; } | ||
} | ||
} |
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,8 @@ | ||
namespace Basin.Config.Interfaces | ||
{ | ||
public interface ISiteConfig | ||
{ | ||
string Name { get; set; } | ||
string Url { get; set; } | ||
} | ||
} |
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 Basin.Selenium; | ||
|
||
namespace Basin.Screens.Interfaces | ||
{ | ||
/// <summary> | ||
/// Interface for defining page/screen object classes. | ||
/// </summary> | ||
/// <typeparam name="TScreenMap"></typeparam> | ||
public interface IScreen<out TScreenMap> | ||
{ | ||
/// <summary> | ||
/// Implements accessor for an IScreenMap class object. | ||
/// </summary> | ||
TScreenMap Map { get; } | ||
} | ||
|
||
|
||
/// <inheritdoc cref="IScreen{TScreenMap}" /> | ||
/// <typeparam name="TPageMap"></typeparam> | ||
public interface IPage<out TPageMap> : IScreen<TPageMap> | ||
{ | ||
} | ||
|
||
/// <inheritdoc cref="IScreen{TScreenMap}" /> | ||
/// <typeparam name="TScreenComponentMap"></typeparam> | ||
public interface IScreenComponent<out TScreenComponentMap> : IScreen<TScreenComponentMap> | ||
{ | ||
} | ||
|
||
/// <inheritdoc cref="IScreen{TScreenMap}" /> | ||
/// <typeparam name="TPageComponentMap"></typeparam> | ||
public interface IPageComponent<out TPageComponentMap> : IScreen<TPageComponentMap> | ||
{ | ||
} | ||
|
||
// | ||
public interface IPageBase | ||
{ | ||
/// <summary> | ||
/// Interface for implementing methods from Basin.Selenium.Driver. | ||
/// </summary> | ||
Wait Wait { get; } | ||
} | ||
} |
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,38 @@ | ||
using Basin.Selenium; | ||
using OpenQA.Selenium; | ||
|
||
namespace Basin.Screens.Interfaces | ||
{ | ||
/// <summary> | ||
/// Interface for implementing methods from Basin.Selenium.Driver. | ||
/// </summary> | ||
public interface IScreenMapBase | ||
{ | ||
Element Locate(By by); | ||
|
||
Element Locate(string css); | ||
|
||
Elements LocateAll(By by); | ||
} | ||
|
||
/// <summary> | ||
/// Interface for page/screen map classes. | ||
/// </summary> | ||
public interface IScreenMap | ||
{ | ||
/// <summary> | ||
/// Adds a common method for defining the root/containing element in a map class. | ||
/// </summary> | ||
Element Container { get; } | ||
} | ||
|
||
/// <inheritdoc cref="IScreenMap" /> | ||
public interface IPageMap : IScreenMap | ||
{ | ||
} | ||
|
||
/// <inheritdoc cref="IScreenMapBase" /> | ||
public interface IPageMapBase : IScreenMapBase | ||
{ | ||
} | ||
} |
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,20 @@ | ||
using OpenQA.Selenium; | ||
using OpenQA.Selenium.Chrome; | ||
|
||
namespace Basin.Selenium.Browsers | ||
{ | ||
internal class Chrome | ||
{ | ||
public readonly IWebDriver Current; | ||
|
||
public Chrome(ChromeOptions opts = null) | ||
{ | ||
var options = opts ?? new ChromeOptions(); | ||
var service = ChromeDriverService.CreateDefaultService(); | ||
|
||
service.HideCommandPromptWindow = true; | ||
|
||
Current = new ChromeDriver(service, options); | ||
} | ||
} | ||
} |
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,20 @@ | ||
using OpenQA.Selenium; | ||
using OpenQA.Selenium.Firefox; | ||
|
||
namespace Basin.Selenium.Browsers | ||
{ | ||
public class Firefox | ||
{ | ||
public readonly IWebDriver Current; | ||
|
||
public Firefox(FirefoxOptions opts = null) | ||
{ | ||
var options = opts ?? new FirefoxOptions(); | ||
var service = FirefoxDriverService.CreateDefaultService(); | ||
|
||
service.HideCommandPromptWindow = true; | ||
|
||
Current = new FirefoxDriver(service, options); | ||
} | ||
} | ||
} |
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,20 @@ | ||
using OpenQA.Selenium; | ||
using OpenQA.Selenium.IE; | ||
|
||
namespace Basin.Selenium.Browsers | ||
{ | ||
public class InternetExplorer | ||
{ | ||
public readonly IWebDriver Current; | ||
|
||
public InternetExplorer(InternetExplorerOptions opts = null) | ||
{ | ||
var options = opts ?? new InternetExplorerOptions(); | ||
var service = InternetExplorerDriverService.CreateDefaultService(); | ||
|
||
service.HideCommandPromptWindow = true; | ||
|
||
Current = new InternetExplorerDriver(service, options); | ||
} | ||
} | ||
} |
Oops, something went wrong.