mirror of
https://github.com/aliasvault/aliasvault.git
synced 2025-12-23 22:28:22 -05:00
Update tests (#1347)
This commit is contained in:
@@ -113,10 +113,10 @@ else
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-4">
|
||||
<button type="submit" class="w-full px-5 py-2 text-base font-medium text-center text-white bg-primary-700 rounded-lg hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800 flex items-center justify-center gap-2">
|
||||
<button type="submit" id="login-button" class="w-full px-5 py-2 text-base font-medium text-center text-white bg-primary-700 rounded-lg hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800 flex items-center justify-center gap-2">
|
||||
@Localizer["LoginButton"]
|
||||
</button>
|
||||
<button type="button" @onclick="() => _showMobileLoginModal = true" class="hidden md:flex w-full px-5 py-2 text-base font-medium text-center text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:ring-gray-700 items-center justify-center gap-2">
|
||||
<button type="button" id="mobile-login-button" @onclick="() => _showMobileLoginModal = true" class="hidden md:flex w-full px-5 py-2 text-base font-medium text-center text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:ring-gray-700 items-center justify-center gap-2">
|
||||
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"></path>
|
||||
</svg>
|
||||
|
||||
@@ -72,12 +72,12 @@ else
|
||||
<ValidationMessage For="() => _unlockModel.Password"/>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="w-full px-5 py-2 text-base font-medium text-center text-white bg-primary-700 rounded-lg hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800 flex items-center justify-center gap-2">
|
||||
<button type="submit" id="unlock-button" class="w-full px-5 py-2 text-base font-medium text-center text-white bg-primary-700 rounded-lg hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800 flex items-center justify-center gap-2">
|
||||
@Localizer["UnlockButton"]
|
||||
</button>
|
||||
</EditForm>
|
||||
|
||||
<button type="button" @onclick="() => _showMobileUnlockModal = true" class="hidden md:flex w-full px-5 py-2 text-base font-medium text-center text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:ring-gray-700 items-center justify-center gap-2 mt-4">
|
||||
<button type="button" id="mobile-unlock-button" @onclick="() => _showMobileUnlockModal = true" class="hidden md:flex w-full px-5 py-2 text-base font-medium text-center text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:ring-gray-700 items-center justify-center gap-2 mt-4">
|
||||
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"></path>
|
||||
</svg>
|
||||
|
||||
@@ -173,7 +173,7 @@ public class ClientPlaywrightTest : PlaywrightTest
|
||||
{ "password", TestUserPassword },
|
||||
});
|
||||
|
||||
var submitButton = Page.GetByRole(AriaRole.Button, new() { Name = "Unlock" });
|
||||
var submitButton = Page.Locator("#unlock-button");
|
||||
await submitButton.ClickAsync();
|
||||
|
||||
// Wait for the sync page to show
|
||||
|
||||
@@ -32,7 +32,7 @@ public class PasswordLockoutTests : AdminPlaywrightTest
|
||||
{
|
||||
await Page.Locator("input[id='username']").FillAsync(TestUserUsername);
|
||||
await Page.Locator("input[id='password']").FillAsync("wrongpassword");
|
||||
var submitButton = Page.GetByRole(AriaRole.Button, new() { Name = "Login to your account" });
|
||||
var submitButton = Page.Locator("#login-button");
|
||||
await submitButton.ClickAsync();
|
||||
|
||||
// Wait for the text "Error: Invalid login attempt." to appear if we expect not to be locked out yet..
|
||||
|
||||
@@ -62,7 +62,7 @@ public class TwoFactorAuthLockoutTests : AdminPlaywrightTest
|
||||
{ "password", TestUserPassword },
|
||||
});
|
||||
|
||||
submitButton = Page.GetByRole(AriaRole.Button, new() { Name = "Login" });
|
||||
submitButton = Page.Locator("#login-button");
|
||||
await submitButton.ClickAsync();
|
||||
|
||||
// Wait for 2FA page.
|
||||
|
||||
@@ -66,7 +66,7 @@ public class JwtTokenTests : ClientPlaywrightTest
|
||||
{ "password", TestUserPassword },
|
||||
});
|
||||
|
||||
var submitButton = Page.GetByRole(AriaRole.Button, new() { Name = "Unlock" });
|
||||
var submitButton = Page.Locator("#unlock-button");
|
||||
await submitButton.ClickAsync();
|
||||
|
||||
// Check if we get redirected back to the page we were trying to access.
|
||||
@@ -96,9 +96,9 @@ public class JwtTokenTests : ClientPlaywrightTest
|
||||
// Not all pages do a webapi call on load everytime so we need to navigate to a page that does.
|
||||
await NavigateUsingBlazorRouter("test/2");
|
||||
|
||||
await WaitForUrlAsync("user/login", "Login");
|
||||
await WaitForUrlAsync("user/login", "Log in");
|
||||
|
||||
var pageContent = await Page.TextContentAsync("body");
|
||||
Assert.That(pageContent, Does.Contain("Login"), "No redirect to login while refresh token should be expired.");
|
||||
Assert.That(pageContent, Does.Contain("Log in"), "No redirect to login while refresh token should be expired.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class UnlockTests : ClientPlaywrightTest
|
||||
{ "password", TestUserPassword },
|
||||
});
|
||||
|
||||
var submitButton = Page.GetByRole(AriaRole.Button, new() { Name = "Unlock" });
|
||||
var submitButton = Page.Locator("#unlock-button");
|
||||
await submitButton.ClickAsync();
|
||||
|
||||
// Check if we get redirected back to the page we were trying to access.
|
||||
|
||||
Reference in New Issue
Block a user