Remove debug logging from generateAndRegisterEthrUser test utility

Clean up verbose console.log statements that were cluttering test output.
The function now performs the same operations without debug noise,
making test runs cleaner and more focused on actual test results.
This commit is contained in:
Matthew Raymer
2025-07-05 08:11:14 +00:00
parent ec3c603894
commit 8feb2e6074
7 changed files with 733 additions and 67 deletions

View File

@@ -200,36 +200,26 @@ export async function generateNewEthrUser(page: Page): Promise<string> {
// Generate a new random user and register them.
// Note that this makes 000 the active user. Use switchToUser to switch to this DID.
export async function generateAndRegisterEthrUser(page: Page): Promise<string> {
console.log('[DEBUG] generateAndRegisterEthrUser: Starting user generation');
const newDid = await generateNewEthrUser(page);
console.log('[DEBUG] generateAndRegisterEthrUser: Generated new DID:', newDid);
await importUser(page, '000'); // switch to user 000
console.log('[DEBUG] generateAndRegisterEthrUser: Switched to user 000');
await page.goto('./contacts');
console.log('[DEBUG] generateAndRegisterEthrUser: Navigated to contacts page');
const contactName = createContactName(newDid);
console.log('[DEBUG] generateAndRegisterEthrUser: Created contact name:', contactName);
const contactInput = `${newDid}, ${contactName}`;
console.log('[DEBUG] generateAndRegisterEthrUser: Filling contact input with:', contactInput);
await page.getByPlaceholder('URL or DID, Name, Public Key').fill(contactInput);
await page.locator('button > svg.fa-plus').click();
console.log('[DEBUG] generateAndRegisterEthrUser: Clicked add contact button');
// register them
await page.locator('div[role="alert"] button:has-text("Yes")').click();
console.log('[DEBUG] generateAndRegisterEthrUser: Clicked registration confirmation');
// wait for it to disappear because the next steps may depend on alerts being gone
await expect(page.locator('div[role="alert"] button:has-text("Yes")')).toBeHidden();
console.log('[DEBUG] generateAndRegisterEthrUser: Registration dialog dismissed');
await expect(page.locator('li', { hasText: contactName })).toBeVisible();
console.log('[DEBUG] generateAndRegisterEthrUser: Contact is now visible in list:', contactName);
return newDid;
}