1- using System ;
2- using System . Diagnostics ;
3- using System . IO ;
4- using System . Net ;
5- using Behavioral . Automation . Configs ;
6- using Behavioral . Automation . FluentAssertions ;
1+ using Behavioral . Automation . FluentAssertions ;
72using Behavioral . Automation . Services ;
83using BoDi ;
94using TechTalk . SpecFlow ;
@@ -17,7 +12,6 @@ public class Bootstrapper
1712 private readonly ITestRunner _runner ;
1813 private readonly DemoTestServicesBuilder _servicesBuilder ;
1914 private readonly BrowserRunner _browserRunner ;
20- private static Process _coreRunProcess ;
2115
2216 public Bootstrapper ( IObjectContainer objectContainer , ITestRunner runner , BrowserRunner browserRunner )
2317 {
@@ -27,53 +21,6 @@ public Bootstrapper(IObjectContainer objectContainer, ITestRunner runner, Browse
2721 _servicesBuilder = new DemoTestServicesBuilder ( objectContainer , new TestServicesBuilder ( _objectContainer ) ) ;
2822 }
2923
30- private static bool IsConnectionEstablished ( )
31- {
32- try
33- {
34- WebRequest . CreateHttp ( ConfigManager . GetConfig < Config > ( ) . BaseUrl ) . GetResponse ( ) ;
35- return true ;
36- }
37- catch ( WebException )
38- {
39- return false ;
40- }
41- }
42-
43- private static void RunTestApp ( )
44- {
45- string testAppPath = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , ".." , ".." , ".." , ".." , ".." , "src" ,
46- "BlazorApp" ) ;
47-
48- _coreRunProcess = new Process
49- {
50- StartInfo = new ProcessStartInfo
51- {
52- FileName = "cmd.exe" ,
53- Arguments = "/c dotnet run" ,
54- WorkingDirectory = testAppPath
55- }
56- } ;
57- _coreRunProcess . Start ( ) ;
58- }
59-
60- [ BeforeTestRun ]
61- public static void StartDemoApp ( )
62- {
63- if ( ! IsConnectionEstablished ( ) )
64- RunTestApp ( ) ;
65- }
66-
67- [ AfterTestRun ]
68- public static void StopDemoApp ( )
69- {
70- if ( _coreRunProcess != null )
71- {
72- _coreRunProcess . Kill ( true ) ;
73- _coreRunProcess . Dispose ( ) ;
74- }
75- }
76-
7724 [ AfterScenario ]
7825 public void CloseBrowser ( )
7926 {
0 commit comments