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

Commit 433c9d7

Browse files
committed
1.3.0 release
1 parent a09b21c commit 433c9d7

29 files changed

+265
-245
lines changed

Unickq.SpecFlow.Selenium.Allure.Example/App.config

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
<configSections>
66
<section name="autofac" type="Autofac.Configuration.SectionHandler, Autofac.Configuration" />
7-
8-
<section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" /></configSections>
7+
<section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" />
8+
</configSections>
99

1010
<specFlow>
1111
<unitTestProvider name="Unickq.SpecFlow.Selenium.Allure" />
@@ -14,7 +14,7 @@
1414
<add name="Unickq.SpecFlow.Selenium.Allure" path=".\bin\Debug" />
1515
<add name="Unickq.SpecFlow.Selenium" path=".\bin\Debug" />
1616
</plugins>
17-
<!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config --></specFlow>
17+
</specFlow>
1818

1919
<appSettings>
2020
<add key="testingbot.key" value="YOUR_DATA_HERE" />
@@ -27,7 +27,9 @@
2727

2828
<autofac>
2929
<components>
30-
<component name="ChromeDebug" type="Unickq.SpecFlow.Selenium.Local.ChromeDriver, Unickq.SpecFlow.Selenium.SpecFlowPlugin" service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
30+
<component name="ChromeDebug"
31+
type="Unickq.SpecFlow.Selenium.Local.ChromeDriver, Unickq.SpecFlow.Selenium.SpecFlowPlugin"
32+
service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
3133
<parameters>
3234
<parameter name="capabilities">
3335
<dictionary>
@@ -40,7 +42,9 @@
4042
</parameters>
4143
</component>
4244

43-
<component name="FirefoxDebug" type="Unickq.SpecFlow.Selenium.Local.FirefoxDriver, Unickq.SpecFlow.Selenium.SpecFlowPlugin" service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
45+
<component name="FirefoxDebug"
46+
type="Unickq.SpecFlow.Selenium.Local.FirefoxDriver, Unickq.SpecFlow.Selenium.SpecFlowPlugin"
47+
service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
4448
<parameters>
4549
<parameter name="capabilities">
4650
<dictionary>
@@ -51,7 +55,9 @@
5155
</parameters>
5256
</component>
5357

54-
<component name="RemoteChrome" type="Unickq.SpecFlow.Selenium.WebDriverGrid.RemoteWebDriver, Unickq.SpecFlow.Selenium.SpecFlowPlugin" service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
58+
<component name="RemoteChrome"
59+
type="Unickq.SpecFlow.Selenium.WebDriverGrid.RemoteWebDriver, Unickq.SpecFlow.Selenium.SpecFlowPlugin"
60+
service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
5561
<parameters>
5662
<parameter name="url" value="http://localhost:4444/wd/hub" />
5763
<parameter name="browser" value="Chrome" />
@@ -63,7 +69,9 @@
6369
</parameters>
6470
</component>
6571

66-
<component name="CrossbrowserTesting" type="Unickq.SpecFlow.Selenium.WebDriverGrid.CrossBrowserTestingWebDriver, Unickq.SpecFlow.Selenium.SpecFlowPlugin" service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
72+
<component name="CrossbrowserTesting"
73+
type="Unickq.SpecFlow.Selenium.WebDriverGrid.CrossBrowserTestingWebDriver, Unickq.SpecFlow.Selenium.SpecFlowPlugin"
74+
service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
6775
<parameters>
6876
<parameter name="browser" value="Chrome" />
6977
<parameter name="capabilities">
@@ -74,7 +82,9 @@
7482
</parameters>
7583
</component>
7684

77-
<component name="BrowserStack_Win10_Chrome" type="Unickq.SpecFlow.Selenium.WebDriverGrid.BrowserStackWebDriver, Unickq.SpecFlow.Selenium.SpecFlowPlugin" service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
85+
<component name="BrowserStack_Win10_Chrome"
86+
type="Unickq.SpecFlow.Selenium.WebDriverGrid.BrowserStackWebDriver, Unickq.SpecFlow.Selenium.SpecFlowPlugin"
87+
service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
7888
<parameters>
7989
<parameter name="browser" value="Chrome" />
8090
<parameter name="capabilities">
@@ -86,7 +96,9 @@
8696
</parameters>
8797
</component>
8898

89-
<component name="TestingBot_ElCapitan_Safari" type="Unickq.SpecFlow.Selenium.WebDriverGrid.TestingBotWebDriver, Unickq.SpecFlow.Selenium.SpecFlowPlugin" service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
99+
<component name="TestingBot_ElCapitan_Safari"
100+
type="Unickq.SpecFlow.Selenium.WebDriverGrid.TestingBotWebDriver, Unickq.SpecFlow.Selenium.SpecFlowPlugin"
101+
service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
90102
<parameters>
91103
<parameter name="browser" value="Safari" />
92104
<parameter name="capabilities">
@@ -98,7 +110,9 @@
98110
</parameters>
99111
</component>
100112

101-
<component name="SauceLabs_Win7_Firefox" type="Unickq.SpecFlow.Selenium.WebDriverGrid.SauceLabsWebDriver, Unickq.Specflow.Selenium.SpecFlowPlugin" service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
113+
<component name="SauceLabs_Win7_Firefox"
114+
type="Unickq.SpecFlow.Selenium.WebDriverGrid.SauceLabsWebDriver, Unickq.Specflow.Selenium.SpecFlowPlugin"
115+
service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
102116
<parameters>
103117
<parameter name="browser" value="Firefox" />
104118
<parameter name="capabilities">

Unickq.SpecFlow.Selenium.Allure.Example/Unickq.SpecFlow.Selenium.Allure.Example.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@
100100
<Compile Include="Properties\AssemblyInfo.cs" />
101101
</ItemGroup>
102102
<ItemGroup>
103-
<None Include="allureConfig.json" />
103+
<None Include="allureConfig.json">
104+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
105+
</None>
104106
<None Include="App.config">
105107
<SubType>Designer</SubType>
106108
</None>

Unickq.SpecFlow.Selenium.Allure.SpecFlowPlugin/Allure/AllureTestTracerWrapper.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private void StartStep(StepInstance stepInstance)
8585
".txt");
8686

8787
var table = stepInstance.TableArgument;
88-
bool isTableProcessed = (table == null);
88+
var isTableProcessed = table == null;
8989

9090
// parse table as step params
9191
if (table != null)
@@ -103,21 +103,17 @@ private void StartStep(StepInstance stepInstance)
103103
Regex.IsMatch(header[1], PluginConfiguration.stepArguments.paramValueRegex);
104104
if (paramNameMatch && paramValueMatch)
105105
{
106-
for (int i = 0; i < table.RowCount; i++)
107-
{
106+
for (var i = 0; i < table.RowCount; i++)
108107
parameters.Add(new Parameter {name = table.Rows[i][0], value = table.Rows[i][1]});
109-
}
110108

111109
isTableProcessed = true;
112110
}
113111
}
114112
// add step params for 1 row table
115113
else if (table.RowCount == 1)
116114
{
117-
for (int i = 0; i < table.Header.Count; i++)
118-
{
115+
for (var i = 0; i < table.Header.Count; i++)
119116
parameters.Add(new Parameter {name = header[i], value = table.Rows[0][i]});
120-
}
121117

122118
isTableProcessed = true;
123119
}

Unickq.SpecFlow.Selenium.Allure.SpecFlowPlugin/Allure/PluginConfiguration.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,4 @@ public class Links
5454
public string issue { get; set; }
5555
public string tms { get; set; }
5656
}
57-
58-
}
57+
}

Unickq.SpecFlow.Selenium.Allure.SpecFlowPlugin/Allure/PluginHelper.cs

Lines changed: 54 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
using Allure.Commons;
77
using Newtonsoft.Json.Linq;
88
using TechTalk.SpecFlow;
9-
using TechTalk.SpecFlow.Bindings;
109

1110
namespace Unickq.SpecFlow.Selenium.Allure
1211
{
1312
public static class PluginHelper
1413
{
1514
// static ScenarioInfo emptyScenarioInfo = new ScenarioInfo().;
1615

17-
static FeatureInfo emptyFeatureInfo = new FeatureInfo(
16+
private static FeatureInfo emptyFeatureInfo = new FeatureInfo(
1817
CultureInfo.CurrentCulture, string.Empty, string.Empty);
1918

20-
public static PluginConfiguration PluginConfiguration = GetConfiguration(AllureLifecycle.Instance.JsonConfiguration);
19+
public static PluginConfiguration PluginConfiguration =
20+
GetConfiguration(AllureLifecycle.Instance.JsonConfiguration);
2121

2222
private static PluginConfiguration GetConfiguration(string allureConfiguration)
2323
{
@@ -35,7 +35,6 @@ internal static StatusDetails GetStatusDetails(Exception ex)
3535
message = ex.GetType().Name,
3636
trace = ex.Message
3737
};
38-
3938
}
4039

4140
public static Tuple<List<Label>, List<Link>> GetTags(FeatureInfo featureInfo, ScenarioInfo scenarioInfo)
@@ -52,72 +51,100 @@ public static Tuple<List<Label>, List<Link>> GetTags(FeatureInfo featureInfo, Sc
5251
// link
5352
if (TryUpdateValueByMatch(PluginConfiguration.links.link, ref tagValue))
5453
{
55-
result.Item2.Add(new Link() { name = tagValue, url = tagValue }); continue;
54+
result.Item2.Add(new Link {name = tagValue, url = tagValue});
55+
continue;
5656
}
57+
5758
// issue
5859
if (TryUpdateValueByMatch(PluginConfiguration.links.issue, ref tagValue))
5960
{
60-
result.Item2.Add(Link.Issue(tagValue, tagValue)); continue;
61+
result.Item2.Add(Link.Issue(tagValue, tagValue));
62+
continue;
6163
}
64+
6265
// tms
6366
if (TryUpdateValueByMatch(PluginConfiguration.links.tms, ref tagValue))
6467
{
65-
result.Item2.Add(Link.Tms(tagValue, tagValue)); continue;
68+
result.Item2.Add(Link.Tms(tagValue, tagValue));
69+
continue;
6670
}
71+
6772
// parent suite
6873
if (TryUpdateValueByMatch(PluginConfiguration.grouping.suites.parentSuite, ref tagValue))
6974
{
70-
result.Item1.Add(Label.ParentSuite(tagValue)); continue;
75+
result.Item1.Add(Label.ParentSuite(tagValue));
76+
continue;
7177
}
78+
7279
// suite
7380
if (TryUpdateValueByMatch(PluginConfiguration.grouping.suites.suite, ref tagValue))
7481
{
75-
result.Item1.Add(Label.Suite(tagValue)); continue;
82+
result.Item1.Add(Label.Suite(tagValue));
83+
continue;
7684
}
85+
7786
// sub suite
7887
if (TryUpdateValueByMatch(PluginConfiguration.grouping.suites.subSuite, ref tagValue))
7988
{
80-
result.Item1.Add(Label.SubSuite(tagValue)); continue;
89+
result.Item1.Add(Label.SubSuite(tagValue));
90+
continue;
8191
}
92+
8293
// epic
8394
if (TryUpdateValueByMatch(PluginConfiguration.grouping.behaviors.epic, ref tagValue))
8495
{
85-
result.Item1.Add(Label.Epic(tagValue)); continue;
96+
result.Item1.Add(Label.Epic(tagValue));
97+
continue;
8698
}
99+
87100
// story
88101
if (TryUpdateValueByMatch(PluginConfiguration.grouping.behaviors.story, ref tagValue))
89102
{
90-
result.Item1.Add(Label.Story(tagValue)); continue;
103+
result.Item1.Add(Label.Story(tagValue));
104+
continue;
91105
}
106+
92107
// package
93108
if (TryUpdateValueByMatch(PluginConfiguration.grouping.packages.package, ref tagValue))
94109
{
95-
result.Item1.Add(Label.Package(tagValue)); continue;
110+
result.Item1.Add(Label.Package(tagValue));
111+
continue;
96112
}
113+
97114
// test class
98115
if (TryUpdateValueByMatch(PluginConfiguration.grouping.packages.testClass, ref tagValue))
99116
{
100-
result.Item1.Add(Label.TestClass(tagValue)); continue;
117+
result.Item1.Add(Label.TestClass(tagValue));
118+
continue;
101119
}
120+
102121
// test method
103122
if (TryUpdateValueByMatch(PluginConfiguration.grouping.packages.testMethod, ref tagValue))
104123
{
105-
result.Item1.Add(Label.TestMethod(tagValue)); continue;
124+
result.Item1.Add(Label.TestMethod(tagValue));
125+
continue;
106126
}
127+
107128
// owner
108129
if (TryUpdateValueByMatch(PluginConfiguration.labels.owner, ref tagValue))
109130
{
110-
result.Item1.Add(Label.Owner(tagValue)); continue;
131+
result.Item1.Add(Label.Owner(tagValue));
132+
continue;
111133
}
134+
112135
// severity
113-
if (TryUpdateValueByMatch(PluginConfiguration.labels.severity, ref tagValue) && Enum.TryParse(tagValue, out SeverityLevel level))
136+
if (TryUpdateValueByMatch(PluginConfiguration.labels.severity, ref tagValue) &&
137+
Enum.TryParse(tagValue, out SeverityLevel level))
114138
{
115-
result.Item1.Add(Label.Severity(level)); continue;
139+
result.Item1.Add(Label.Severity(level));
140+
continue;
116141
}
142+
117143
// tag
118-
if(!tagValue.Contains("Browser"))
119-
result.Item1.Add(Label.Tag(tagValue));
144+
if (!tagValue.Contains("Browser"))
145+
result.Item1.Add(Label.Tag(tagValue));
120146
}
147+
121148
return result;
122149
}
123150

@@ -129,7 +156,8 @@ private static bool TryUpdateValueByMatch(string expression, ref string value)
129156
Regex regex = null;
130157
try
131158
{
132-
regex = new Regex(expression, RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase);
159+
regex = new Regex(expression,
160+
RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase);
133161
}
134162
catch (Exception)
135163
{
@@ -149,15 +177,16 @@ private static bool TryUpdateValueByMatch(string expression, ref string value)
149177

150178
return true;
151179
}
152-
else
153-
return false;
180+
181+
return false;
154182
}
183+
155184
public static void WrapInStep(this AllureLifecycle allureInstance, Action action, string stepName = "")
156185
{
157186
var id = Guid.NewGuid().ToString();
158-
var stepResult = new StepResult { name = stepName };
187+
var stepResult = new StepResult {name = stepName};
159188
try
160-
{
189+
{
161190
allureInstance.StartStep(id, stepResult);
162191
action.Invoke();
163192
allureInstance.StopStep(step => stepResult.status = Status.passed);

Unickq.SpecFlow.Selenium.Allure.SpecFlowPlugin/Unickq.SpecFlow.Selenium.Allure.SpecFlowPlugin.csproj

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>net45</TargetFramework>
55
<PackageId>Unickq.SpecFlow.Selenium.Allure</PackageId>
6-
<Version>1.3.0-beta2</Version>
6+
<Version>1.3.0</Version>
77
<Authors>Nick Chursin</Authors>
88
<Description>Unickq.SpecFlow.Selenium with Allure support</Description>
99
<PackageProjectUrl>https://github.com/unickq/SpecFlow.Selenium.Plugin</PackageProjectUrl>
@@ -13,23 +13,20 @@
1313
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1414
<AssemblyName>Unickq.SpecFlow.Selenium.Allure.SpecFlowPlugin</AssemblyName>
1515
<RootNamespace>Unickq.SpecFlow.Selenium</RootNamespace>
16-
<FileVersion>1.3.2.0</FileVersion>
16+
<FileVersion>1.3.0</FileVersion>
1717
<PackageLicenseUrl>https://github.com/unickq/SpecFlow.Selenium.Plugin/blob/master/LICENSE</PackageLicenseUrl>
18-
<Copyright>Nick Chursin</Copyright>
19-
<Company />
20-
<PackageReleaseNotes>SpecFlow 2.4 support</PackageReleaseNotes>
2118
<LangVersion>7</LangVersion>
22-
<AssemblyVersion>1.3.2.0</AssemblyVersion>
19+
<AssemblyVersion>1.3.0</AssemblyVersion>
2320
</PropertyGroup>
2421

2522
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'" />
2623

2724
<ItemGroup>
2825
<PackageReference Include="Allure.Commons" Version="2.3.67.1" />
29-
<PackageReference Include="SpecFlow.CustomPlugin" Version="2.2.1">
26+
<PackageReference Include="SpecFlow.CustomPlugin" Version="2.4.0">
3027
<PrivateAssets>all</PrivateAssets>
3128
</PackageReference>
32-
<PackageReference Include="Unickq.SpecFlow.Selenium" Version="1.3.0-beta1" />
29+
<PackageReference Include="Unickq.SpecFlow.Selenium" Version="1.3.0" />
3330
</ItemGroup>
3431

3532
<ItemGroup>

0 commit comments

Comments
 (0)