6
6
using Microsoft . Data . SqlClient ;
7
7
using Microsoft . Playwright ;
8
8
using System . Diagnostics ;
9
- using System . Management ;
10
- using System . Runtime . Versioning ;
11
9
using System . Text ;
12
10
using Xunit . Abstractions ;
13
11
@@ -56,24 +54,6 @@ public static async Task FirstLogin_MicrosoftIdFlow_ValidEmailPassword(IPage pag
56
54
await StaySignedIn_MicrosoftIdFlow ( page , staySignedInText , output ) ;
57
55
}
58
56
59
- /// <summary>
60
- /// Login flow for anytime after the first time in a given browsing session.
61
- /// </summary>
62
- /// <param name="page">Playwright Page object the web app is accessed from</param>
63
- /// <param name="email">email of the user to sign in</param>
64
- /// <param name="password">password for sign in</param>
65
- /// <param name="output">Used to communicate output to the test's Standard Output</param>
66
- /// <param name="staySignedIn">Whether to select "stay signed in" on login</param>
67
- public static async Task SuccessiveLogin_MicrosoftIdFlow_ValidEmailPassword ( IPage page , string email , string password , ITestOutputHelper ? output = null , bool staySignedIn = false )
68
- {
69
- string staySignedInText = staySignedIn ? "Yes" : "No" ;
70
-
71
- WriteLine ( output , $ "Logging in again in this browsing session... selecting user via email: { email } .") ;
72
- await SelectKnownAccountByEmail_MicrosoftIdFlow ( page , email ) ;
73
- await EnterPasswordAsync ( page , password , output ) ;
74
- await StaySignedIn_MicrosoftIdFlow ( page , staySignedInText , output ) ;
75
- }
76
-
77
57
/// <summary>
78
58
/// Enters the email of the user to sign in.
79
59
/// </summary>
@@ -155,21 +135,6 @@ private static void WriteLine(ITestOutputHelper? output, string message)
155
135
}
156
136
}
157
137
158
- /// <summary>
159
- /// This starts the recording of playwright trace files. The corresponding EndAndWritePlaywrightTrace method will also need to be used.
160
- /// This is not used anywhere by default and will need to be added to the code if desired.
161
- /// </summary>
162
- /// <param name="page">The page object whose context the trace will record.</param>
163
- public static async Task StartPlaywrightTrace ( IPage page )
164
- {
165
- await page . Context . Tracing . StartAsync ( new ( )
166
- {
167
- Screenshots = true ,
168
- Snapshots = true ,
169
- Sources = true
170
- } ) ;
171
- }
172
-
173
138
/// <summary>
174
139
/// Starts a process from an executable, sets its working directory, and redirects its output to the test's output.
175
140
/// </summary>
@@ -179,7 +144,7 @@ await page.Context.Tracing.StartAsync(new()
179
144
/// <param name="portNumber">The port for the process to listen on.</param>
180
145
/// <param name="isHttp">If the launch URL is http or https. Default is https.</param>
181
146
/// <returns>The started process.</returns>
182
- public static Process StartProcessLocally ( string testAssemblyLocation , string appLocation , string executableName , Dictionary < string , string > ? environmentVariables = null )
147
+ private static Process StartProcessLocally ( string testAssemblyLocation , string appLocation , string executableName , Dictionary < string , string > ? environmentVariables = null )
183
148
{
184
149
string applicationWorkingDirectory = GetApplicationWorkingDirectory ( testAssemblyLocation , appLocation ) ;
185
150
ProcessStartInfo processStartInfo = new ProcessStartInfo ( applicationWorkingDirectory + executableName )
@@ -258,7 +223,7 @@ private static string GetAbsoluteAppDirectory(string testAssemblyLocation, strin
258
223
/// <returns>An absolute path to a Playwright Trace zip folder</returns>
259
224
public static string GetTracePath ( string testAssemblyLocation , string traceName )
260
225
{
261
- const string traceParentFolder = "E2E Tests " ;
226
+ const string traceParentFolder = "UiTests " ;
262
227
const string traceFolder = "PlaywrightTraces" ;
263
228
const string zipExtension = ".zip" ;
264
229
const int netVersionNumberLength = 3 ;
@@ -323,24 +288,6 @@ private static void KillProcessTrees(Queue<Process> processQueue)
323
288
#endif
324
289
}
325
290
326
- /// <summary>
327
- /// Gets the child processes of a process on Windows
328
- /// </summary>
329
- /// <param name="process">The parent process</param>
330
- /// <returns>A list of child processes</returns>
331
- [ SupportedOSPlatform ( "windows" ) ]
332
- public static IList < Process > GetChildProcesses ( this Process process )
333
- {
334
- ManagementObjectSearcher processSearch = new ManagementObjectSearcher ( $ "Select * From Win32_Process Where ParentProcessID={ process . Id } ") ;
335
- IList < Process > processList = processSearch . Get ( )
336
- . Cast < ManagementObject > ( )
337
- . Select ( mo =>
338
- Process . GetProcessById ( Convert . ToInt32 ( mo [ "ProcessID" ] , System . Globalization . CultureInfo . InvariantCulture ) ) )
339
- . ToList ( ) ;
340
- processSearch . Dispose ( ) ;
341
- return processList ;
342
- }
343
-
344
291
/// <summary>
345
292
/// Checks if all processes in a list are alive
346
293
/// </summary>
0 commit comments