add test for registration of new user

This commit is contained in:
2024-08-22 20:21:37 -06:00
parent 85b9aa8e2b
commit 2d450e6455
8 changed files with 87 additions and 20 deletions

View File

@@ -2,6 +2,7 @@ import { test, expect } from '@playwright/test';
import { importUser } from './testUtils';
test('Add contact, record gift, confirm gift', async ({ page }) => {
// Generate a random string of 16 characters
let randomString = Math.random().toString(36).substring(2, 18);
@@ -31,8 +32,10 @@ test('Add contact, record gift, confirm gift', async ({ page }) => {
await page.getByPlaceholder('URL or DID, Name, Public Key').fill('did:ethr:0x0000694B58C2cC69658993A90D3840C560f2F51F, User #000');
await page.locator('button > svg.fa-plus').click();
await expect(page.locator('div[role="alert"]')).toBeVisible();
await page.locator('div[role="alert"] button:has-text("Yes")').click();
await page.locator('div[role="alert"] button > svg.fa-xmark').click(); // dismiss alert
await expect(page.locator('div[role="alert"] button > svg.fa-xmark')).toBeHidden(); // ensure alert is gone
await page.locator('div[role="alert"] button:has-text("Cancel")').click();
// Verify added contact
await expect(page.locator('li.border-b')).toContainText('User #000');