Skip to content

Commit 752246a

Browse files
committed
Add SpecFlow to the test runners
Begin SpecFlow documentation Add (defunct) attempt to use SpecFlow in the main WebForms example (asptest.webforms.specflow) SMC <auto-generated /> tag with closing slash
1 parent 5a2763e commit 752246a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+833
-92
lines changed

asp.webforms.sln

+22
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "asptest.webforms", "src\asp
2626
EndProject
2727
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "asptestrunner.webforms", "src\asptestrunner.webforms\asptestrunner.webforms.csproj", "{B1F18DB1-C667-4F2F-9998-BBA83105C0FC}"
2828
EndProject
29+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "asptest.webforms.specflow", "src\asptest.webforms.specflow\asptest.webforms.specflow.csproj", "{C7CA8F55-559A-493E-BB3A-F48D0C8AADA8}"
30+
EndProject
2931
Global
3032
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3133
Debug|Any CPU = Debug|Any CPU
@@ -215,6 +217,26 @@ Global
215217
{B1F18DB1-C667-4F2F-9998-BBA83105C0FC}.Release|x64.Build.0 = Release|Any CPU
216218
{B1F18DB1-C667-4F2F-9998-BBA83105C0FC}.Release|x86.ActiveCfg = Release|Any CPU
217219
{B1F18DB1-C667-4F2F-9998-BBA83105C0FC}.Release|x86.Build.0 = Release|Any CPU
220+
{C7CA8F55-559A-493E-BB3A-F48D0C8AADA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
221+
{C7CA8F55-559A-493E-BB3A-F48D0C8AADA8}.Debug|Any CPU.Build.0 = Debug|Any CPU
222+
{C7CA8F55-559A-493E-BB3A-F48D0C8AADA8}.Debug|ARM.ActiveCfg = Debug|Any CPU
223+
{C7CA8F55-559A-493E-BB3A-F48D0C8AADA8}.Debug|ARM.Build.0 = Debug|Any CPU
224+
{C7CA8F55-559A-493E-BB3A-F48D0C8AADA8}.Debug|ARM64.ActiveCfg = Debug|Any CPU
225+
{C7CA8F55-559A-493E-BB3A-F48D0C8AADA8}.Debug|ARM64.Build.0 = Debug|Any CPU
226+
{C7CA8F55-559A-493E-BB3A-F48D0C8AADA8}.Debug|x64.ActiveCfg = Debug|Any CPU
227+
{C7CA8F55-559A-493E-BB3A-F48D0C8AADA8}.Debug|x64.Build.0 = Debug|Any CPU
228+
{C7CA8F55-559A-493E-BB3A-F48D0C8AADA8}.Debug|x86.ActiveCfg = Debug|Any CPU
229+
{C7CA8F55-559A-493E-BB3A-F48D0C8AADA8}.Debug|x86.Build.0 = Debug|Any CPU
230+
{C7CA8F55-559A-493E-BB3A-F48D0C8AADA8}.Release|Any CPU.ActiveCfg = Release|Any CPU
231+
{C7CA8F55-559A-493E-BB3A-F48D0C8AADA8}.Release|Any CPU.Build.0 = Release|Any CPU
232+
{C7CA8F55-559A-493E-BB3A-F48D0C8AADA8}.Release|ARM.ActiveCfg = Release|Any CPU
233+
{C7CA8F55-559A-493E-BB3A-F48D0C8AADA8}.Release|ARM.Build.0 = Release|Any CPU
234+
{C7CA8F55-559A-493E-BB3A-F48D0C8AADA8}.Release|ARM64.ActiveCfg = Release|Any CPU
235+
{C7CA8F55-559A-493E-BB3A-F48D0C8AADA8}.Release|ARM64.Build.0 = Release|Any CPU
236+
{C7CA8F55-559A-493E-BB3A-F48D0C8AADA8}.Release|x64.ActiveCfg = Release|Any CPU
237+
{C7CA8F55-559A-493E-BB3A-F48D0C8AADA8}.Release|x64.Build.0 = Release|Any CPU
238+
{C7CA8F55-559A-493E-BB3A-F48D0C8AADA8}.Release|x86.ActiveCfg = Release|Any CPU
239+
{C7CA8F55-559A-493E-BB3A-F48D0C8AADA8}.Release|x86.Build.0 = Release|Any CPU
218240
EndGlobalSection
219241
GlobalSection(SolutionProperties) = preSolution
220242
HideSolutionNode = FALSE

aspnettest.sln

+26
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "nuget-info", "nuget-info",
175175
EndProject
176176
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorApp1SpecFlowTest", "src\template.blazor\src\BlazorApp1SpecFlowTest\BlazorApp1SpecFlowTest.csproj", "{81B353D4-1FCC-4400-91D3-F17787018CAE}"
177177
EndProject
178+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "asptest.webforms.specflow", "src\asptest.webforms.specflow\asptest.webforms.specflow.csproj", "{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}"
179+
EndProject
178180
Global
179181
GlobalSection(SolutionConfigurationPlatforms) = preSolution
180182
Debug|Any CPU = Debug|Any CPU
@@ -1727,6 +1729,30 @@ Global
17271729
{81B353D4-1FCC-4400-91D3-F17787018CAE}.ReleaseNoTrace|x64.Build.0 = Release|Any CPU
17281730
{81B353D4-1FCC-4400-91D3-F17787018CAE}.ReleaseNoTrace|x86.ActiveCfg = Release|Any CPU
17291731
{81B353D4-1FCC-4400-91D3-F17787018CAE}.ReleaseNoTrace|x86.Build.0 = Release|Any CPU
1732+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1733+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
1734+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.Debug|x64.ActiveCfg = Debug|Any CPU
1735+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.Debug|x64.Build.0 = Debug|Any CPU
1736+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.Debug|x86.ActiveCfg = Debug|Any CPU
1737+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.Debug|x86.Build.0 = Debug|Any CPU
1738+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.DebugNoTrace|Any CPU.ActiveCfg = Debug|Any CPU
1739+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.DebugNoTrace|Any CPU.Build.0 = Debug|Any CPU
1740+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.DebugNoTrace|x64.ActiveCfg = Debug|Any CPU
1741+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.DebugNoTrace|x64.Build.0 = Debug|Any CPU
1742+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.DebugNoTrace|x86.ActiveCfg = Debug|Any CPU
1743+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.DebugNoTrace|x86.Build.0 = Debug|Any CPU
1744+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
1745+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.Release|Any CPU.Build.0 = Release|Any CPU
1746+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.Release|x64.ActiveCfg = Release|Any CPU
1747+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.Release|x64.Build.0 = Release|Any CPU
1748+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.Release|x86.ActiveCfg = Release|Any CPU
1749+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.Release|x86.Build.0 = Release|Any CPU
1750+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.ReleaseNoTrace|Any CPU.ActiveCfg = Release|Any CPU
1751+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.ReleaseNoTrace|Any CPU.Build.0 = Release|Any CPU
1752+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.ReleaseNoTrace|x64.ActiveCfg = Release|Any CPU
1753+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.ReleaseNoTrace|x64.Build.0 = Release|Any CPU
1754+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.ReleaseNoTrace|x86.ActiveCfg = Release|Any CPU
1755+
{2B8AE5FB-9225-484A-9B11-198BF8FD4BE4}.ReleaseNoTrace|x86.Build.0 = Release|Any CPU
17301756
EndGlobalSection
17311757
GlobalSection(SolutionProperties) = preSolution
17321758
HideSolutionNode = FALSE

doc/blazor.md

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ React and Anguler), there is no need to wait and poll for changes to happen
5656
Instead, the `ITestFocus` static class in `asplib.blazor` provides an
5757
`EndRender` resp. `EndRenderAsync` extension method to synchronize the tests.
5858

59+
Read about the [SpecFlow integration](specflow.md) in its own documentation.
5960

6061
## Quickstart
6162

doc/doc.vcxproj

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
<None Include="recordings.md" />
3838
<None Include="restapi.md" />
3939
<None Include="setup.md" />
40+
<None Include="specflow.md" />
4041
<None Include="test-with-storage.dia" />
4142
<None Include="test-without-storage.dia" />
4243
<None Include="toc.md" />

doc/doc.vcxproj.filters

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
<None Include="blazor-inoutprocess.dia">
6262
<Filter>Sources</Filter>
6363
</None>
64+
<None Include="specflow.md" />
6465
</ItemGroup>
6566
<ItemGroup>
6667
<Image Include="components.png">

doc/recordings.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,14 @@ This is the test filter used to run this subset of the GUI tests:
4545
<add key="TestFilterWhere" value="class == asptest.calculator.FibonacciTest" />
4646
```
4747

48-
![FibonacciTest in action](img/FibonacciTest.gif)
48+
![FibonacciTest in action](img/FibonacciTest.gif)
49+
50+
51+
## Blazor Template running the `BlazorApp1.playlist`
52+
53+
![Blazor Template BlazorApp1.playlist](img/template.blazor-running.gif)
54+
55+
56+
## Blazor Template Firefox click error
57+
58+
![Blazor Template Firefox Click Error](img/template.blazor-running-firefox.gif)

doc/specflow.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# SpecFlow integration
2+
3+
The Blazor template and asp.blazor contaion a [SpecFlow](https://specflow.org)
4+
test suite performing some of the same tests as the direct Selenium tests suite.
5+
6+
The WebForms example (`asptest.webforms.specflow`) was originally created with
7+
VS 2019 (the VS SpecFlow 2022 package creates C# with `global using` incompatible with
8+
.NET Framework). It follows the same pattern as the Blazor example, it compiles,
9+
but it currently does not run (although the required
10+
`TechTalk.SpecFlow.NUnit.SpecFlowPlugin.dll` is present in the `bin` directory):
11+
12+
`Interface cannot be resolved: TechTalk.SpecFlow.UnitTestProvider.IUnitTestRuntimeProvider('nunit')`
13+
14+
The libraries (NuGet packages) themselves have no SpecFlow dependency, only the
15+
applications and tests which are actually using it.

doc/toc.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* [WebSharper with SMC](websharper.md)
66
* [REST API with SMC](restapi.md)
77
* [Blazor Server](blazor.md)
8+
* [SpecFlow (Blazor)](specflow.md)
89
* [Initial Setup](setup.md)
910
* [Writing GUI Tests](writing.md)
1011
* [Architecture](architecture.md)

src/apiservice.core/Controllers/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Makefile to build the Accesscode context and the diagram fron
1+
# Makefile to build the Accesscode context and the diagram fron
22

33
all: Accesscode_sm.cs Accesscode_sm.png
44

@@ -9,7 +9,7 @@ Accesscode_sm.dot: Accesscode.sm
99
java -jar ..\..\smc\Smc.jar -graph -glevel 1 Accesscode.sm
1010
REM Replace the first comment line to silence Code Access Security and nullable warnings:
1111
SET CS=Accesscode_sm.cs
12-
powershell -Command "@('#pragma warning disable SYSLIB0003', '/* <auto-generated>') + ((Get-Content '%CS%') | Select-Object -Skip 1) | Set-Content -Path '%CS%'"
12+
powershell -Command "@('#pragma warning disable SYSLIB0003', '/* <auto-generated />') + ((Get-Content '%CS%') | Select-Object -Skip 1) | Set-Content -Path '%CS%'"
1313

1414
Accesscode_sm.png: Accesscode_sm.dot
1515
dot -T png -o Accesscode_sm.png Accesscode_sm.dot
@@ -18,4 +18,4 @@ Accesscode_sm.png: Accesscode_sm.dot
1818
clean:
1919
-del Accesscode_sm.cs
2020
-del Accesscode_sm.dot
21-
-del Accesscode_sm.png
21+
-del Accesscode_sm.png

src/asp.blazor/CalculatorSmc/Calculator_sm.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pragma warning disable SYSLIB0003
2-
/* <auto-generated>
2+
/* <auto-generated />
33
* ex: set ro:
44
* DO NOT EDIT.
55
* generated by smc (http://smc.sourceforge.net/)

src/asp.blazor/CalculatorSmc/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Makefile to build the Calculator context and the diagram fron
1+
# Makefile to build the Calculator context and the diagram fron
22

33
all: Calculator_sm.cs Calculator_sm.png
44

@@ -9,12 +9,12 @@ Calculator_sm.dot: Calculator.sm
99
java -jar ..\..\smc\Smc.jar -graph -glevel 1 Calculator.sm
1010
REM Replace the first comment line to silence Code Access Security and nullable warnings:
1111
SET CS=Calculator_sm.cs
12-
powershell -Command "@('#pragma warning disable SYSLIB0003', '/* <auto-generated>') + ((Get-Content '%CS%') | Select-Object -Skip 1) | Set-Content -Path '%CS%'"
12+
powershell -Command "@('#pragma warning disable SYSLIB0003', '/* <auto-generated />') + ((Get-Content '%CS%') | Select-Object -Skip 1) | Set-Content -Path '%CS%'"
1313

1414
Calculator_sm.png: Calculator_sm.dot
1515
dot -T png -o Calculator_sm.png Calculator_sm.dot
1616

1717
clean:
1818
-del Calculator_sm.cs
1919
-del Calculator_sm.dot
20-
-del Calculator_sm.png
20+
-del Calculator_sm.png

src/asp.core/Controllers/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Makefile to build the Calculator context and the diagram fron
1+
# Makefile to build the Calculator context and the diagram fron
22

33
all: Calculator_sm.cs Calculator_sm.png
44

@@ -9,7 +9,7 @@ Calculator_sm.dot: Calculator.sm
99
java -jar ..\..\smc\Smc.jar -graph -glevel 1 Calculator.sm
1010
REM Replace the first comment line to silence Code Access Security and nullable warnings:
1111
SET CS=Calculator_sm.cs
12-
powershell -Command "@('#pragma warning disable SYSLIB0003', '/* <auto-generated>') + ((Get-Content '%CS%') | Select-Object -Skip 1) | Set-Content -Path '%CS%'"
12+
powershell -Command "@('#pragma warning disable SYSLIB0003', '/* <auto-generated />') + ((Get-Content '%CS%') | Select-Object -Skip 1) | Set-Content -Path '%CS%'"
1313

1414
Calculator_sm.png: Calculator_sm.dot
1515
dot -T png -o Calculator_sm.png Calculator_sm.dot
@@ -18,4 +18,4 @@ Calculator_sm.png: Calculator_sm.dot
1818
clean:
1919
-del Calculator_sm.cs
2020
-del Calculator_sm.dot
21-
-del Calculator_sm.png
21+
-del Calculator_sm.png

src/asp.webforms/Properties/AssemblyInfo.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@
3636

3737
// Manually added for accessing the state types
3838
[assembly: InternalsVisibleTo("test.webforms")]
39-
[assembly: InternalsVisibleTo("asptest.webforms")]
39+
[assembly: InternalsVisibleTo("asptest.webforms")]
40+
[assembly: InternalsVisibleTo("asptest.webforms.specflow")]

src/asp.webforms/Web.config

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<!--
33
Informationen zur Konfiguration Ihrer ASP.NET-Anwendung finden Sie unter
44
https://go.microsoft.com/fwlink/?LinkId=169433
@@ -271,6 +271,10 @@
271271
<assemblyIdentity name="System.Collections.Concurrent" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
272272
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
273273
</dependentAssembly>
274+
<dependentAssembly>
275+
<assemblyIdentity name="nunit.framework" publicKeyToken="2638cd05610744eb" culture="neutral" />
276+
<bindingRedirect oldVersion="0.0.0.0-3.13.1.0" newVersion="3.13.1.0" />
277+
</dependentAssembly>
274278
</assemblyBinding>
275279
</runtime>
276280
<system.codedom>

0 commit comments

Comments
 (0)