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

@@ -1,4 +1,5 @@
import { test, expect } from '@playwright/test';
import { generateEthrUser, importUser } from './testUtils';
test('Confirm usage of test API (may fail if you are running your own Time Safari)', async ({ page }, testInfo) => {
// Load account view
@@ -78,4 +79,19 @@ test('Check ID generation', async ({ page }) => {
// Check that ID is now generated
await expect(page.locator('#sectionIdentityDetails code.truncate')).toContainText('did:ethr:');
});
});
test('Check User 0 can register random person', async ({ page }) => {
await importUser(page, '00');
const newDid = await generateEthrUser(page);
expect(newDid).toContain('did:ethr:');
await page.goto('./');
await page.getByRole('heading', { name: 'Unnamed/Unknown' }).click();
await page.getByPlaceholder('What was given').fill('Access!');
await page.getByRole('button', { name: 'Sign & Send' }).click();
await expect(page.getByText('That gift was recorded.')).toBeVisible();
// now ensure that alert goes away
await page.locator('div[role="alert"] button > svg.fa-xmark').click(); // dismiss alert
await expect(page.getByText('That gift was recorded.')).toBeHidden();
});