Skip to content

Commit

Permalink
Merge pull request #4 from RohitM-IN/dev
Browse files Browse the repository at this point in the history
release 0.0.0.3
  • Loading branch information
RohitM-IN authored Jul 16, 2023
2 parents 6982b2a + f913b27 commit d3cdadc
Show file tree
Hide file tree
Showing 10 changed files with 327 additions and 59 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,5 @@ MigrationBackup/
.ionide/

# Fody - auto-generated XML schema
FodyWeavers.xsd
FodyWeavers.xsd
/SeleniumManager.ConsoleApp/myconfig.toml
6 changes: 5 additions & 1 deletion SeleniumManager.ConsoleApp/SeleniumManager.ConsoleApp.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand All @@ -7,6 +7,10 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<None Remove="myconfig.toml" />
</ItemGroup>

<ItemGroup>
<None Update="selenium-server-4.9.1.jar">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
Expand Down
9 changes: 8 additions & 1 deletion SeleniumManager.Core/Configuration/config.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
{
"Gridhost": "http://127.0.0.1:4444",
"Secret": "",
"statistics": {
"Chrome": 2,
"MicrosoftEdge": 1,
"Firefox": 0,
"Internet Explorer": 0
},
"drivers": [
"chrome",
"firefox",
"MicrosoftEdge"
],
"Exclude": [
"internet explorer"
"InternetExplorer",
"Safari"
],
"endpoints": {
"status": "/status"
Expand Down
17 changes: 17 additions & 0 deletions SeleniumManager.Core/DataContract/Browser.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SeleniumManager.Core.DataContract
{
public class Browser
{
public string Name { get; set; }
public int TotalInstance { get; set; } = 0;
public int AvailableInstance { get; set; } = 0;
public bool IsExcluded { get; set; } = false;
}
}

2 changes: 2 additions & 0 deletions SeleniumManager.Core/DataContract/ConfigurationSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ namespace SeleniumManager.Core.DataContract
public class ConfigurationSettings
{
public string GridHost { get; set; }
public Dictionary<string,int> statistics { get; set; }
public List<string> Drivers { get; set; }
public string Secret { get; set; }
public int MaxConcurrency { get; set; }
public Endpoints Endpoints { get; set; }
public Options Options { get; set; } = new Options();
}
}
65 changes: 65 additions & 0 deletions SeleniumManager.Core/DataContract/Options.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Chromium;
using OpenQA.Selenium.Edge;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.IE;
using OpenQA.Selenium.Safari;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SeleniumManager.Core.DataContract
{
public class Options
{
public ChromeOptions chromeOptions { get; set; } = GetChromeOptions();
public FirefoxOptions firefoxOptions { get; set; } = GetFirefoxOptions();
public EdgeOptions edgeOptions { get; set; } = GetEdgeOptions();
public InternetExplorerOptions internetExplorerOptions { get; set; } = GetInternetExplorerOptions();
public SafariOptions safariOptions { get; set; } = GetSafariOptions();

public static ChromeOptions GetChromeOptions()
{
var chromeOptions = new ChromeOptions();
#if !DEBUG
chromeOptions.AddArgument("headless");
#endif
chromeOptions.AddArgument("disable-gpu");
chromeOptions.AddArgument("no-sandbox");
chromeOptions.AddArgument("--blink-settings=imagesEnabled=false");
return chromeOptions;
}

public static FirefoxOptions GetFirefoxOptions()
{
var firefoxOptions = new FirefoxOptions();
#if !DEBUG
firefoxOptions.AddArgument("headless");
#endif
firefoxOptions.AddArgument("disable-gpu");
firefoxOptions.AddArgument("no-sandbox");
firefoxOptions.AddArgument("--blink-settings=imagesEnabled=false");
return firefoxOptions;
}

public static EdgeOptions GetEdgeOptions()
{
var edgeOptions = new EdgeOptions();
#if !DEBUG
edgeOptions.AddArgument("headless");
#endif
edgeOptions.AddArgument("disable-gpu");
edgeOptions.AddArgument("no-sandbox");
edgeOptions.AddArgument("--blink-settings=imagesEnabled=false");
return edgeOptions;
}

public static InternetExplorerOptions GetInternetExplorerOptions() => new InternetExplorerOptions();

public static SafariOptions GetSafariOptions() => new SafariOptions();

}
}
4 changes: 2 additions & 2 deletions SeleniumManager.Core/SeleniumManager.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
This include managing Queues, Parallel Tests, etc.</Description>
<Copyright>MIT License</Copyright>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<AssemblyVersion>0.0.0.1</AssemblyVersion>
<Version>0.0.0.1-alpha</Version>
<AssemblyVersion>0.0.0.3</AssemblyVersion>
<Version>0.0.0.3-alpha</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
Loading

0 comments on commit d3cdadc

Please sign in to comment.