Update tests (#1347)

This commit is contained in:
Leendert de Borst
2025-11-19 11:25:03 +01:00
parent 786bf655d0
commit 07b6097d31
7 changed files with 11 additions and 11 deletions

View File

@@ -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>

View File

@@ -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>

View File

@@ -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

View File

@@ -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..

View File

@@ -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.

View File

@@ -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.");
}
}

View File

@@ -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.