Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public async Task Susi_B2C_LocalAccount_TodoAppFunctionsCorrectlyAsync()
if (InitialConnectionRetryCount == 0) { throw ex; }
}
}
LabResponse labResponse = await LabUserHelper.GetB2CLocalAccountAsync();
var userConfig = await LabResponseHelper.GetUserConfigAsync("MSAL-B2C-Local-JSON");

// Initial sign in
_output.WriteLine("Starting web app sign-in flow.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ public async Task ChallengeUser_MicrosoftIdFlow_LocalApp_ValidEmailPasswordCreds
}

page = await NavigateToWebAppAsync(context, TodoListClientPort);
LabResponse labResponse = await LabUserHelper.GetDefaultUserAsync();
var userConfig = await LabResponseHelper.GetUserConfigAsync("MSAL-User-Default-JSON");

// Initial sign in
_output.WriteLine("Starting web app sign-in flow.");
string email = labResponse.User.Upn;
await UiTestHelpers.FirstLogin_MicrosoftIdFlow_ValidEmailPasswordAsync(page, email, labResponse.User.GetOrFetchPassword(), _output);
string email = userConfig.Upn;
await UiTestHelpers.FirstLogin_MicrosoftIdFlow_ValidEmailPasswordAsync(page, email, LabResponseHelper.FetchUserPassword(userConfig.LabName), _output);
await Assertions.Expect(page.GetByText("TodoList")).ToBeVisibleAsync(_assertVisibleOptions);
await Assertions.Expect(page.GetByText(email)).ToBeVisibleAsync(_assertVisibleOptions);
_output.WriteLine("Web app sign-in flow successful.");
Expand All @@ -115,7 +115,7 @@ public async Task ChallengeUser_MicrosoftIdFlow_LocalApp_ValidEmailPasswordCreds
// Sign in again using Todo List button
_output.WriteLine("Starting web app sign-in flow using Todo List button after sign out.");
await page.GetByRole(AriaRole.Link, new() { Name = "TodoList" }).ClickAsync();
await UiTestHelpers.SuccessiveLogin_MicrosoftIdFlow_ValidEmailPasswordAsync(page, email, labResponse.User.GetOrFetchPassword(), _output);
await UiTestHelpers.SuccessiveLogin_MicrosoftIdFlow_ValidEmailPasswordAsync(page, email, LabResponseHelper.FetchUserPassword(userConfig.LabName), _output);
var todoLink = page.GetByRole(AriaRole.Link, new() { Name = "Create New" });
await Assertions.Expect(todoLink).ToBeVisibleAsync(_assertVisibleOptions);
_output.WriteLine("Web app sign-in flow successful using Todo List button after sign out.");
Expand Down Expand Up @@ -237,7 +237,7 @@ public async Task ChallengeUser_MicrosoftIdFlow_LocalApp_ValidEmailPasswordCreds
// Initial sign in
_output.WriteLine("Starting web app sign-in flow.");
string email = "idlab@msidlabciam6.onmicrosoft.com";
await UiTestHelpers.FirstLogin_MicrosoftIdFlow_ValidEmailPasswordAsync(page, email, LabUserHelper.FetchUserPassword("msidlabciam6"), _output);
await UiTestHelpers.FirstLogin_MicrosoftIdFlow_ValidEmailPasswordAsync(page, email, LabResponseHelper.FetchUserPassword("msidlabciam6"), _output);
await Assertions.Expect(page.GetByText("Welcome")).ToBeVisibleAsync(_assertVisibleOptions);
await Assertions.Expect(page.GetByText(email)).ToBeVisibleAsync(_assertVisibleOptions);
_output.WriteLine("Web app sign-in flow successful.");
Expand All @@ -251,7 +251,7 @@ public async Task ChallengeUser_MicrosoftIdFlow_LocalApp_ValidEmailPasswordCreds
// Sign in again using Todo List button
_output.WriteLine("Starting web app sign-in flow using sign in button after sign out.");
await page.GetByRole(AriaRole.Link, new() { Name = "Sign in" }).ClickAsync();
await UiTestHelpers.FirstLogin_MicrosoftIdFlow_ValidEmailPasswordAsync(page, email, LabUserHelper.FetchUserPassword("msidlabciam6"), _output);
await UiTestHelpers.FirstLogin_MicrosoftIdFlow_ValidEmailPasswordAsync(page, email, LabResponseHelper.FetchUserPassword("msidlabciam6"), _output);
await Assertions.Expect(page.GetByText("Welcome")).ToBeVisibleAsync(_assertVisibleOptions);
await Assertions.Expect(page.GetByText(email)).ToBeVisibleAsync(_assertVisibleOptions);
_output.WriteLine("Web app sign-in flow successful using Sign in button after sign out.");
Expand Down
6 changes: 3 additions & 3 deletions tests/E2E Tests/WebAppUiTests/WebAppIntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ public async Task ChallengeUser_MicrosoftIdentityFlow_RemoteApp_ValidEmailPasswo
IBrowser browser = await playwright.Chromium.LaunchAsync(new() { Headless = true });
IPage page = await browser.NewPageAsync();
await page.GotoAsync(UrlString);
LabResponse labResponse = await LabUserHelper.GetDefaultUserAsync();
var userConfig = await LabResponseHelper.GetUserConfigAsync("MSAL-User-Default-JSON");

try
{
// Act
Trace.WriteLine("Starting Playwright automation: web app sign-in & call Graph");
string email = labResponse.User.Upn;
await UiTestHelpers.FirstLogin_MicrosoftIdFlow_ValidEmailPasswordAsync(page, email, labResponse.User.GetOrFetchPassword());
string email = userConfig.Upn;
await UiTestHelpers.FirstLogin_MicrosoftIdFlow_ValidEmailPasswordAsync(page, email, LabResponseHelper.FetchUserPassword(userConfig.LabName));

// Assert
await Assertions.Expect(page.GetByText("Welcome")).ToBeVisibleAsync();
Expand Down