Updated test directory
This commit is contained in:
18
test-playwright/example.spec.ts
Normal file
18
test-playwright/example.spec.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('has title', async ({ page }) => {
|
||||
await page.goto('https://playwright.dev/');
|
||||
|
||||
// Expect a title "to contain" a substring.
|
||||
await expect(page).toHaveTitle(/Playwright/);
|
||||
});
|
||||
|
||||
test('get started link', async ({ page }) => {
|
||||
await page.goto('https://playwright.dev/');
|
||||
|
||||
// Click the get started link.
|
||||
await page.getByRole('link', { name: 'Get started' }).click();
|
||||
|
||||
// Expects page to have a heading with the name of Installation.
|
||||
await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
|
||||
});
|
||||
19
test-playwright/new-id-from-seed.spec.ts
Normal file
19
test-playwright/new-id-from-seed.spec.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('Create new ID from seed', async ({ page }) => {
|
||||
// Create new ID using seed phrase "rigid shrug mobile…"
|
||||
await page.goto('https://timesafari.app/start');
|
||||
await page.getByText('No, I have a seed').click();
|
||||
await page.getByPlaceholder('Seed Phrase').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.getByRole('button', { name: 'Import' }).click();
|
||||
|
||||
// Set name
|
||||
await page.getByRole('link', { name: 'Set Your Name' }).click();
|
||||
await page.getByPlaceholder('Name').click();
|
||||
await page.getByPlaceholder('Name').fill('Rigid Shrug Mobile');
|
||||
await page.getByRole('button', { name: 'Save Changes' }).click();
|
||||
|
||||
// Check DID
|
||||
await expect(page.getByRole('code')).toContainText('did:ethr:0x0000694B58C2cC69658993A90D3840C560f2F51F');
|
||||
});
|
||||
25
test-playwright/validate-contact-info-clipboard.spec.ts
Normal file
25
test-playwright/validate-contact-info-clipboard.spec.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('Validate copy contact info to clipboard', async ({ page }) => {
|
||||
// Create new ID using seed phrase "island fever beef…"
|
||||
await page.goto('https://timesafari.app/start');
|
||||
await page.getByText('No, I have a seed').click();
|
||||
await page.getByPlaceholder('Seed Phrase').click();
|
||||
await page.getByPlaceholder('Seed Phrase').fill('island fever beef wine urban aim vacant quit afford total poem flame service calm better adult neither color gaze forum month sister imitate excite');
|
||||
await page.getByRole('button', { name: 'Import' }).click();
|
||||
|
||||
// Set name
|
||||
await page.getByRole('link', { name: 'Set Your Name' }).click();
|
||||
await page.getByPlaceholder('Name').click();
|
||||
await page.getByPlaceholder('Name').fill('Island Fever Beef');
|
||||
await page.getByRole('button', { name: 'Save Changes' }).click();
|
||||
|
||||
// Check DID
|
||||
await expect(page.getByRole('code')).toContainText('did:ethr:0x111d15564f824D56C7a07b913aA7aDd03382aA39');
|
||||
|
||||
// Copy and check contact info
|
||||
await page.getByRole('link', { name: 'Share Your Info' }).click();
|
||||
await page.locator('#Content div').filter({ hasText: 'Click that QR to copy your' }).locator('div').first().click();
|
||||
let clipboardContactInfo = await page.evaluate("navigator.clipboard.readText()");
|
||||
expect(clipboardContactInfo).toContain("https://endorser.ch/contact?jwt=");
|
||||
});
|
||||
Reference in New Issue
Block a user