forked from jsnbuchanan/crowd-funder-for-time-pwa
add test for registration of new user
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user