Browse Source

Fix: switch users to test unregistered contacts

pull/142/head
Jose Olarte III 6 days ago
parent
commit
5ad1ea4c3c
  1. 14
      test-playwright/40-add-contact.spec.ts

14
test-playwright/40-add-contact.spec.ts

@ -82,18 +82,18 @@ test('Add contact, record gift, confirm gift', async ({ page }) => {
// Combine title prefix with the random string // Combine title prefix with the random string
const finalTitle = standardTitle + finalRandomString; const finalTitle = standardTitle + finalRandomString;
const contactName = 'Contact #000 renamed'; const contactName = 'Contact #001 renamed';
const userName = 'User #000'; const userName = 'User #001';
// Import user 01 // Import user 00
await importUser(page, '01'); await importUser(page, '00');
// Add new contact // Add new contact
await page.goto('./contacts'); await page.goto('./contacts');
await page.getByPlaceholder('URL or DID, Name, Public Key').fill('did:ethr:0x0000694B58C2cC69658993A90D3840C560f2F51F, ' + userName); await page.getByPlaceholder('URL or DID, Name, Public Key').fill('did:ethr:0x111d15564f824D56C7a07b913aA7aDd03382aA39, ' + userName);
await page.locator('button > svg.fa-plus').click(); await page.locator('button > svg.fa-plus').click();
await expect(page.locator('div[role="alert"] span:has-text("No")')).toBeVisible(); await expect(page.locator('div[role="alert"] span:has-text("No")')).toBeVisible();
await page.locator('div[role="alert"] button:has-text("No")').click(); await page.locator('div[role="alert"] button:has-text("No")').click(); // don't register
await expect(page.locator('div[role="alert"] span:has-text("Contact Added")')).toBeVisible(); await expect(page.locator('div[role="alert"] span:has-text("Contact Added")')).toBeVisible();
await page.locator('div[role="alert"] button > svg.fa-xmark').click(); // dismiss info alert await page.locator('div[role="alert"] button > svg.fa-xmark').click(); // dismiss info alert
await expect(page.locator('div[role="alert"] button > svg.fa-xmark')).toBeHidden(); // ensure alert is gone await expect(page.locator('div[role="alert"] button > svg.fa-xmark')).toBeHidden(); // ensure alert is gone
@ -149,7 +149,7 @@ test('Add contact, record gift, confirm gift', async ({ page }) => {
await page.getByText('You have a seed').click(); await page.getByText('You have a seed').click();
await page.getByPlaceholder('Seed Phrase').fill('rigid shrug mobile smart veteran half all pond toilet brave review universe ship congress found yard skate elite apology jar uniform subway slender luggage'); await page.getByPlaceholder('Seed Phrase').fill('rigid shrug mobile smart veteran half all pond toilet brave review universe ship congress found yard skate elite apology jar uniform subway slender luggage');
await page.getByRole('button', { name: 'Import' }).click(); await page.getByRole('button', { name: 'Import' }).click();
await expect(page.getByRole('code')).toContainText('did:ethr:0x0000694B58C2cC69658993A90D3840C560f2F51F'); await expect(page.getByRole('code')).toContainText('did:ethr:0x111d15564f824D56C7a07b913aA7aDd03382aA39');
// Go to home view and look for gift // Go to home view and look for gift
await page.goto('./'); await page.goto('./');

Loading…
Cancel
Save