Browse Source

Optimize tests

playwright-pwa-install-test
Jose Olarte III 4 months ago
parent
commit
59f97ffc28
  1. 2
      test-playwright/10-create-user-00.spec.ts
  2. 2
      test-playwright/11-create-user-01.spec.ts
  3. 7
      test-playwright/20-create-project.spec.ts
  4. 7
      test-playwright/21-create-project-search.spec.ts
  5. 3
      test-playwright/30-record-gift.spec.ts
  6. 2
      test-playwright/40-add-contact.spec.ts

2
test-playwright/10-create-user-00.spec.ts

@ -4,13 +4,11 @@ test('Create new ID from seed', async ({ page }) => {
// Create new ID using seed phrase "rigid shrug mobile…"
await page.goto('./start');
await page.getByText('You 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('User Zero');
await page.getByRole('button', { name: 'Save Changes' }).click();

2
test-playwright/11-create-user-01.spec.ts

@ -4,13 +4,11 @@ test('Validate copy contact info to clipboard', async ({ page }) => {
// Create new ID using seed phrase "island fever beef…"
await page.goto('./start');
await page.getByText('You 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('User One');
await page.getByRole('button', { name: 'Save Changes' }).click();

7
test-playwright/20-create-project.spec.ts

@ -21,13 +21,11 @@ test('Create new project', async ({ page }) => {
// Create new ID using seed phrase "rigid shrug mobile…"
await page.goto('./start');
await page.getByText('You 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('User Zero');
await page.getByRole('button', { name: 'Save Changes' }).click();
@ -38,15 +36,10 @@ test('Create new project', async ({ page }) => {
await page.goto('./projects');
await page.getByRole('link', { name: 'Projects', exact: true }).click();
await page.getByRole('button').click();
await page.getByPlaceholder('Idea Name').click();
await page.getByPlaceholder('Idea Name').fill(finalTitle); // Add random suffix
await page.getByPlaceholder('Description').click();
await page.getByPlaceholder('Description').fill(finalDescription);
await page.getByPlaceholder('Website').click();
await page.getByPlaceholder('Website').fill('https://example.com');
await page.getByPlaceholder('Start Date').click();
await page.getByPlaceholder('Start Date').fill('2025-12-01');
await page.getByPlaceholder('Start Time').click();
await page.getByPlaceholder('Start Time').fill('12:00');
await page.getByRole('button', { name: 'Save Project' }).click();

7
test-playwright/21-create-project-search.spec.ts

@ -21,13 +21,11 @@ test('Create new project, then search for it', async ({ page }) => {
// Create new ID using seed phrase "rigid shrug mobile…"
await page.goto('./start');
await page.getByText('You 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('User Zero');
await page.getByRole('button', { name: 'Save Changes' }).click();
@ -38,15 +36,10 @@ test('Create new project, then search for it', async ({ page }) => {
await page.goto('./projects');
await page.getByRole('link', { name: 'Projects', exact: true }).click();
await page.getByRole('button').click();
await page.getByPlaceholder('Idea Name').click();
await page.getByPlaceholder('Idea Name').fill(finalTitle); // Add random suffix
await page.getByPlaceholder('Description').click();
await page.getByPlaceholder('Description').fill(finalDescription);
await page.getByPlaceholder('Website').click();
await page.getByPlaceholder('Website').fill('https://example.com');
await page.getByPlaceholder('Start Date').click();
await page.getByPlaceholder('Start Date').fill('2025-12-01');
await page.getByPlaceholder('Start Time').click();
await page.getByPlaceholder('Start Time').fill('12:00');
await page.getByRole('button', { name: 'Save Project' }).click();

3
test-playwright/30-record-gift.spec.ts

@ -22,20 +22,17 @@ test('Record something given', async ({ page }) => {
// Create new ID using seed phrase "rigid shrug mobile…"
await page.goto('./start');
await page.getByText('You 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('User Zero');
await page.getByRole('button', { name: 'Save Changes' }).click();
// Record something given
await page.goto('./');
await page.getByRole('heading', { name: 'Unnamed/Unknown' }).click();
await page.getByPlaceholder('What was given').click();
await page.getByPlaceholder('What was given').fill(finalTitle);
await page.getByRole('spinbutton').fill(randomNonZeroNumber.toString());
await page.getByRole('button', { name: 'Sign & Send' }).click();

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

@ -4,13 +4,11 @@ test('Create new ID from seed', async ({ page }) => {
// Create new ID using seed phrase "rigid shrug mobile…"
await page.goto('./start');
await page.getByText('You 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('User Zero');
await page.getByRole('button', { name: 'Save Changes' }).click();

Loading…
Cancel
Save