Update DbPersistTest.cs (#98)

This commit is contained in:
Leendert de Borst
2024-07-12 13:11:45 +02:00
parent 88fe86c19a
commit 0bbb504511
4 changed files with 7 additions and 3 deletions

View File

@@ -168,7 +168,6 @@ public class LoginBase : OwningComponentBase
var localStorageReturnUrl = await LocalStorage.GetItemAsync<string>("returnUrl");
if (!string.IsNullOrEmpty(localStorageReturnUrl))
{
await LocalStorage.RemoveItemAsync("returnUrl");
NavigationManager.NavigateTo(localStorageReturnUrl);
}
else

View File

@@ -48,7 +48,6 @@
// Check that encryption key is set. If not, redirect to unlock screen.
if (!AuthService.IsEncryptionKeySet())
{
await LocalStorage.SetItemAsync(ReturnUrlKey, NavigationManager.Uri);
NavigationManager.NavigateTo("/unlock");
}

View File

@@ -186,6 +186,9 @@ public class PlaywrightTest
/// <returns>Async task.</returns>
protected async Task RefreshPageAndUnlockVault()
{
// Get current URL.
var currentUrl = Page.Url;
// Hard refresh the page.
await Page.ReloadAsync();
@@ -200,6 +203,9 @@ public class PlaywrightTest
var submitButton = Page.GetByRole(AriaRole.Button, new() { Name = "Unlock" });
await submitButton.ClickAsync();
// Wait for the original page to load again.
await WaitForURLAsync(currentUrl);
}
/// <summary>

View File

@@ -37,7 +37,7 @@ public class DbPersistTest : PlaywrightTest
await RefreshPageAndUnlockVault();
// Wait for the credentials page to load again.
await WaitForURLAsync("**/credentials*");
await WaitForURLAsync("**/credentials/**", serviceNameBefore);
// Check if the service name is still present in the content.
pageContent = await Page.TextContentAsync("body");