Update tests (#760)

This commit is contained in:
Leendert de Borst
2025-04-03 12:55:15 +02:00
committed by Leendert de Borst
parent abfabc2a4a
commit 4af158b35d
6 changed files with 19 additions and 19 deletions

View File

@@ -125,7 +125,7 @@ else
</div>
</div>
</div>
<button type="submit" class="hidden">Save Credentials</button>
<button type="submit" class="hidden">Save Credential</button>
</EditForm>
}

View File

@@ -213,7 +213,7 @@ public class ClientPlaywrightTest : PlaywrightTest
await customLogic();
}
var submitButton = Page.Locator("text=Save Credentials").First;
var submitButton = Page.Locator("text=Save Credential").First;
await submitButton.ClickAsync();
if (checkForSuccess)
@@ -222,7 +222,7 @@ public class ClientPlaywrightTest : PlaywrightTest
// Check if the credential was created
var pageContent = await Page.TextContentAsync("body");
Assert.That(pageContent, Does.Contain("View credentials entry"), "Credential not created.");
Assert.That(pageContent, Does.Contain("View credential"), "Credential not created.");
}
}
@@ -247,12 +247,12 @@ public class ClientPlaywrightTest : PlaywrightTest
await Page.ClickAsync("text=Edit");
// Wait for the edit credential page to load.
await WaitForUrlAsync("credentials/**/edit", "Edit the existing credentials");
await WaitForUrlAsync("credentials/**/edit", "Edit the existing credential");
// Fill all input fields with specified values and remaining empty fields with random data.
await InputHelper.FillInputFields(formValues);
var submitButton = Page.Locator("text=Save Credentials").First;
var submitButton = Page.Locator("text=Save Credential").First;
await submitButton.ClickAsync();
await WaitForUrlAsync("credentials/**", "Credential updated successfully");
@@ -281,7 +281,7 @@ public class ClientPlaywrightTest : PlaywrightTest
await Page.ClickAsync("text=Delete");
// Wait for the delete credential page to load.
await WaitForUrlAsync("credentials/**/delete", "You can delete a credentials entry below");
await WaitForUrlAsync("credentials/**/delete", "You can delete the credential below");
var submitButton = Page.Locator("text=Yes, I'm sure").First;
await submitButton.ClickAsync();

View File

@@ -75,7 +75,7 @@ public class CredentialTests : ClientPlaywrightTest
var submitButton = Page.Locator("button[id='quickIdentitySubmit']");
await submitButton.ClickAsync();
await WaitForUrlAsync("credentials/**", "View credentials entry");
await WaitForUrlAsync("credentials/**", "View credential");
// Check that the service name is present in the content.
var pageContent = await Page.TextContentAsync("body");
@@ -102,7 +102,7 @@ public class CredentialTests : ClientPlaywrightTest
// Click the edit button.
var editButton = Page.Locator("text=Edit").First;
await editButton.ClickAsync();
await WaitForUrlAsync("edit", "Save Credentials");
await WaitForUrlAsync("edit", "Save Credential");
var serviceNameAfter = "Credential service after";
await InputHelper.FillInputFields(
@@ -111,7 +111,7 @@ public class CredentialTests : ClientPlaywrightTest
{ "service-name", serviceNameAfter },
});
var submitButton = Page.Locator("text=Save Credentials").First;
var submitButton = Page.Locator("text=Save Credential").First;
await submitButton.ClickAsync();
await WaitForUrlAsync("credentials/**", "Delete");

View File

@@ -128,7 +128,7 @@ public class DbSyncTests : ClientPlaywrightTest
await WaitForUrlAsync("credentials", "Find all of your credentials");
await Page.ClickAsync($"text={serviceName.Key}");
await WaitForUrlAsync($"credentials/**", "View credentials entry");
await WaitForUrlAsync($"credentials/**", "View credential");
foreach (var property in serviceName.Value)
{
// Check if any input on the page has the expected value

View File

@@ -183,7 +183,7 @@ public class AttachmentTests : ClientPlaywrightTest
// Click the edit button
await Page.ClickAsync("text=Edit");
await WaitForUrlAsync("credentials/**/edit", "Edit the existing credentials");
await WaitForUrlAsync("credentials/**/edit", "Edit the existing credential");
// Find and click the delete button for the attachment
var deleteButton = Page.Locator("button:has-text('Delete')").First;
@@ -194,7 +194,7 @@ public class AttachmentTests : ClientPlaywrightTest
Assert.That(pageContent, Does.Not.Contain("TestAttachment.txt"), "Deleted attachment name still appears on edit page.");
// Save the credential
var saveButton = Page.Locator("text=Save Credentials").First;
var saveButton = Page.Locator("text=Save Credential").First;
await saveButton.ClickAsync();
await WaitForUrlAsync("credentials/**", "Credential updated successfully");
@@ -283,7 +283,7 @@ public class AttachmentTests : ClientPlaywrightTest
// Edit the credential
await Page.ClickAsync("text=Edit");
await WaitForUrlAsync("credentials/**/edit", "Edit the existing credentials");
await WaitForUrlAsync("credentials/**/edit", "Edit the existing credential");
var attachmentNames = new[] { "Attachment1.txt", "Attachment2.txt", "Attachment3.txt" };
var fileInput = Page.Locator("input[type='file']");
@@ -305,7 +305,7 @@ public class AttachmentTests : ClientPlaywrightTest
}
// Save the updated credential
var saveButton = Page.Locator("text=Save Credentials").First;
var saveButton = Page.Locator("text=Save Credential").First;
await saveButton.ClickAsync();
await WaitForUrlAsync("credentials/**", "Credential updated successfully");

View File

@@ -33,7 +33,7 @@ public class TotpTests : ClientPlaywrightTest
// Open the edit page again by clicking the button that contains the text "Edit"
await Page.ClickAsync("text=Edit");
await WaitForUrlAsync("credentials/**/edit", "Edit the existing credentials");
await WaitForUrlAsync("credentials/**/edit", "Edit the existing credential");
// Click the "Add TOTP Code" button
var addButton = Page.Locator("button[id='add-totp-code'], a[id='add-totp-code']");
@@ -51,7 +51,7 @@ public class TotpTests : ClientPlaywrightTest
await saveButton.ClickAsync();
// Save the credential
var submitButton = Page.Locator("text=Save Credentials").First;
var submitButton = Page.Locator("text=Save Credential").First;
await submitButton.ClickAsync();
await WaitForUrlAsync("credentials/**", "Credential updated successfully");
@@ -84,7 +84,7 @@ public class TotpTests : ClientPlaywrightTest
// Open the edit page again by clicking the button that contains the text "Edit"
await Page.ClickAsync("text=Edit");
await WaitForUrlAsync("credentials/**/edit", "Edit the existing credentials");
await WaitForUrlAsync("credentials/**/edit", "Edit the existing credential");
// Add a TOTP code
var addButton = Page.Locator("button[id='add-totp-code'], a[id='add-totp-code']");
@@ -96,7 +96,7 @@ public class TotpTests : ClientPlaywrightTest
await Page.Locator("button[id='save-totp-code']").ClickAsync();
// Save the credential
var submitButton = Page.Locator("text=Save Credentials").First;
var submitButton = Page.Locator("text=Save Credential").First;
await submitButton.ClickAsync();
await WaitForUrlAsync("credentials/**", "Credential updated successfully");
@@ -107,7 +107,7 @@ public class TotpTests : ClientPlaywrightTest
// Open the edit page again by clicking the button that contains the text "Edit"
await Page.ClickAsync("text=Edit");
await WaitForUrlAsync("credentials/**/edit", "Edit the existing credentials");
await WaitForUrlAsync("credentials/**/edit", "Edit the existing credential");
// Click the delete button for the TOTP code
var deleteButton = Page.Locator("button.delete-totp-code").First;