Skip to content
This repository was archived by the owner on Dec 8, 2022. It is now read-only.

Commit 46a3275

Browse files
committed
1.2.0 - Local drivers support
1 parent b64e306 commit 46a3275

File tree

4 files changed

+74
-11
lines changed

4 files changed

+74
-11
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<configuration>
3+
<configSections>
4+
<section name="autofac" type="Autofac.Configuration.SectionHandler, Autofac.Configuration" />
5+
<section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" />
6+
</configSections>
7+
<appSettings>
8+
<add key="BaseUrl" value="https://google.com" />
9+
</appSettings>
10+
<specFlow>
11+
<unitTestProvider name="Unickq.SpecFlow.Selenium" />
12+
<generator allowDebugGeneratedFiles="true" markFeaturesParallelizable="true" />
13+
<plugins>
14+
<add name="Unickq.SpecFlow.Selenium" />
15+
</plugins>
16+
</specFlow>
17+
<autofac>
18+
<components>
19+
<component name="Debug" type="Unickq.SpecFlow.Selenium.Local.ChromeDriver, Unickq.SpecFlow.Selenium.SpecFlowPlugin" service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
20+
<parameters>
21+
<parameter name="capabilities">
22+
<dictionary>
23+
<item key="arguments" value="--window-size=1900,1050" />
24+
</dictionary>
25+
</parameter>
26+
</parameters>
27+
</component>
28+
<component name="DebugIphone" type="Unickq.SpecFlow.Selenium.Local.ChromeDriver, Unickq.SpecFlow.Selenium.SpecFlowPlugin" service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
29+
<parameters>
30+
<parameter name="capabilities">
31+
<dictionary>
32+
<item key="arguments" value="--window-size=395,687" />
33+
<item key="mobileEmulation" value="iPhone 6" />
34+
</dictionary>
35+
</parameter>
36+
</parameters>
37+
</component>
38+
<component name="DebugIpad" type="Unickq.SpecFlow.Selenium.Local.ChromeDriver, Unickq.SpecFlow.Selenium.SpecFlowPlugin" service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
39+
<parameters>
40+
<parameter name="capabilities">
41+
<dictionary>
42+
<item key="arguments" value="--window-size=788,1044" />
43+
<item key="mobileEmulation" value="iPad" />
44+
</dictionary>
45+
</parameter>
46+
</parameters>
47+
</component>
48+
</components>
49+
</autofac>
50+
</configuration>

Unickq.SpecFlow.Selenium.Plugin/Extensions.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@ public static string GetBrowserName(this IWebDriver driver)
3333
{
3434
if (driver == null) throw new ArgumentNullException(nameof(driver));
3535
var browserName = driver.GetType().Name;
36-
if (!(driver is PaidWebDriver dr)) return browserName;
37-
var caps = dr.Capabilities;
38-
browserName = $"Remote {caps.BrowserName.ToUpperInvariant()} {caps.Version}";
36+
var webDriver = driver as PaidWebDriver;
37+
if (webDriver != null)
38+
{
39+
var caps = webDriver.Capabilities;
40+
browserName = $"Remote {caps.BrowserName.ToUpperInvariant()} {caps.Version}";
41+
}
3942
return browserName;
4043
}
4144
}

Unickq.SpecFlow.Selenium.Plugin/Unickq.SpecFlow.Selenium.SpecFlowPlugin.csproj

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net45</TargetFrameworks>
4+
<TargetFramework>net45</TargetFramework>
55
<PackageId>Unickq.SpecFlow.Selenium</PackageId>
6-
<Version>1.1.1-beta5</Version>
6+
<Version>1.2.0</Version>
77
<Authors>Nick Chursin</Authors>
88
<Description>Test class generator to drive automated web ui tests with Selenium and SpecFlow 2.2.0. Works with BrowserStack, SauceLabs, TestingBot, CrossbrowserTesting and any WebDriver grid. Based on Baseclass.Contrib.SpecFlow.Selenium.NUnit.</Description>
99
<PackageProjectUrl></PackageProjectUrl>
1010
<PackageIconUrl></PackageIconUrl>
11-
<RepositoryUrl>https://github.com/unickq/allure-csharp-fork</RepositoryUrl>
11+
<RepositoryUrl>https://github.com/unickq/SpecFlow.Selenium.Plugin</RepositoryUrl>
1212
<PackageTags>specflow selenium nunit</PackageTags>
1313
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1414
<AssemblyName>Unickq.SpecFlow.Selenium.SpecFlowPlugin</AssemblyName>
1515
<RootNamespace>Unickq.SpecFlow.Selenium</RootNamespace>
16-
<AssemblyVersion>1.1.1.4</AssemblyVersion>
17-
<FileVersion>1.1.1.4</FileVersion>
16+
<AssemblyVersion>1.2.0.0</AssemblyVersion>
17+
<FileVersion>1.2.0.0</FileVersion>
1818
</PropertyGroup>
1919

20-
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net45|AnyCPU'">
20+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
21+
<LangVersion>6</LangVersion>
22+
</PropertyGroup>
23+
24+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
2125
<LangVersion>6</LangVersion>
2226
</PropertyGroup>
2327

@@ -45,4 +49,10 @@
4549
<Reference Include="Microsoft.CSharp" />
4650
<Reference Include="System.Configuration" />
4751
</ItemGroup>
52+
53+
<ItemGroup>
54+
<None Update="App.config.transform" Pack="true">
55+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
56+
</None>
57+
</ItemGroup>
4858
</Project>

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
version: 1.1.1.{build}
1+
version: 1.2.0.{build}
22

33
environment:
4-
packageVersion: 1.1.1
4+
packageVersion: 1.2.0
55

66
init:
77
- ps: $env:buildVersion = "$env:packageVersion.$env:appveyor_build_number"

0 commit comments

Comments
 (0)