66using Microsoft . Data . SqlClient ;
77using Microsoft . Playwright ;
88using System . Diagnostics ;
9- using System . Management ;
10- using System . Runtime . Versioning ;
119using System . Text ;
1210using Xunit . Abstractions ;
1311
@@ -56,24 +54,6 @@ public static async Task FirstLogin_MicrosoftIdFlow_ValidEmailPassword(IPage pag
5654 await StaySignedIn_MicrosoftIdFlow ( page , staySignedInText , output ) ;
5755 }
5856
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-
7757 /// <summary>
7858 /// Enters the email of the user to sign in.
7959 /// </summary>
@@ -155,21 +135,6 @@ private static void WriteLine(ITestOutputHelper? output, string message)
155135 }
156136 }
157137
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-
173138 /// <summary>
174139 /// Starts a process from an executable, sets its working directory, and redirects its output to the test's output.
175140 /// </summary>
@@ -179,7 +144,7 @@ await page.Context.Tracing.StartAsync(new()
179144 /// <param name="portNumber">The port for the process to listen on.</param>
180145 /// <param name="isHttp">If the launch URL is http or https. Default is https.</param>
181146 /// <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 )
183148 {
184149 string applicationWorkingDirectory = GetApplicationWorkingDirectory ( testAssemblyLocation , appLocation ) ;
185150 ProcessStartInfo processStartInfo = new ProcessStartInfo ( applicationWorkingDirectory + executableName )
@@ -258,7 +223,7 @@ private static string GetAbsoluteAppDirectory(string testAssemblyLocation, strin
258223 /// <returns>An absolute path to a Playwright Trace zip folder</returns>
259224 public static string GetTracePath ( string testAssemblyLocation , string traceName )
260225 {
261- const string traceParentFolder = "E2E Tests " ;
226+ const string traceParentFolder = "UiTests " ;
262227 const string traceFolder = "PlaywrightTraces" ;
263228 const string zipExtension = ".zip" ;
264229 const int netVersionNumberLength = 3 ;
@@ -323,24 +288,6 @@ private static void KillProcessTrees(Queue<Process> processQueue)
323288#endif
324289 }
325290
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-
344291 /// <summary>
345292 /// Checks if all processes in a list are alive
346293 /// </summary>
0 commit comments