Browse Source

ID-specific locators

playwright-pwa-install-test
Jose Olarte III 2 months ago
parent
commit
28dd602d9f
  1. 4
      test-playwright/01-check-activity-feed.spec.ts
  2. 4
      test-playwright/02-check-discover-results.spec.ts
  3. 4
      test-playwright/03-check-noid-messaging.spec.ts
  4. 2
      test-playwright/15-check-usage-limits.spec.ts
  5. 2
      test-playwright/21-create-project-search.spec.ts
  6. 4
      test-playwright/40-add-contact.spec.ts

4
test-playwright/01-check-activity-feed.spec.ts

@ -5,8 +5,8 @@ test('Check activity feed', async ({ page }) => {
await page.goto('./');
// Check that initial 10 activities have been loaded
await page.locator('li:nth-child(10)');
await page.locator('ul#listLatestActivity li:nth-child(10)');
// Scroll down a bit to trigger loading additional activities
await page.locator('li:nth-child(50)').scrollIntoViewIfNeeded();
await page.locator('ul#listLatestActivity li:nth-child(50)').scrollIntoViewIfNeeded();
});

4
test-playwright/02-check-discover-results.spec.ts

@ -5,8 +5,8 @@ test('Check discover results', async ({ page }) => {
await page.goto('./discover');
// Check that initial 10 projects have been loaded
await page.locator('section#Content li.border-b:nth-child(10)');
await page.locator('ul#listDiscoverResults li.border-b:nth-child(10)');
// Scroll down a bit to trigger loading additional projects
await page.locator('section#Content li.border-b:nth-child(20)').scrollIntoViewIfNeeded();
await page.locator('ul#listDiscoverResults li.border-b:nth-child(20)').scrollIntoViewIfNeeded();
});

4
test-playwright/03-check-noid-messaging.spec.ts

@ -13,8 +13,8 @@ test('Check no-ID messaging in account', async ({ page }) => {
await page.goto('./account');
// Check 'someone must register you' notice
await expect(page.getByText('Note: Before you can share with others or take any action, you need an identifier.')).toBeVisible();
await expect(page.locator('#noticeBeforeShare')).toBeVisible();
// Check 'a friend needs to register you' notice
await expect(page.getByText('Note: Before you can publicly announce a new project or time commitment, a friend needs to register you.')).toBeVisible();
await expect(page.locator('#noticeBeforeAnnounce')).toBeVisible();
});

2
test-playwright/15-check-usage-limits.spec.ts

@ -20,7 +20,7 @@ test('Check usage limits', async ({ page }) => {
await expect(page.getByRole('code')).toContainText('did:ethr:0x111d15564f824D56C7a07b913aA7aDd03382aA39');
// Verify that "Usage Limits" section is visible
await expect(page.locator('div.bg-slate-100.rounded-md').filter({ hasText: 'Usage Limits' })).toBeVisible();
await expect(page.locator('#sectionUsageLimits')).toBeVisible();
await expect(page.getByText('Your claims counter resets')).toBeVisible();
await expect(page.getByText('Your registration counter resets')).toBeVisible();
await expect(page.getByText('Your image counter resets')).toBeVisible();

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

@ -52,5 +52,5 @@ test('Create new project, then search for it', async ({ page }) => {
await page.waitForTimeout(5000); // Wait for a bit
await page.getByPlaceholder('Search…').fill(finalRandomString);
await page.locator('#QuickSearch button').click();
await expect(page.locator('section#Content li.border-b:nth-child(1)')).toContainText(finalRandomString);
await expect(page.locator('ul#listDiscoverResults li.border-b:nth-child(1)')).toContainText(finalRandomString);
});

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

@ -32,6 +32,6 @@ test('Add contact', async ({ page }) => {
// Confirm that home feed shows contact
await page.goto('./');
await expect(page.locator('li').filter({ hasText: 'Contact 00 gave to' }).nth(0)).toBeVisible();
await expect(page.locator('li').filter({ hasText: 'Contact 00 received' }).nth(0)).toBeVisible();
await expect(page.locator('ul#listLatestActivity li').filter({ hasText: 'Contact 00 gave to' }).nth(0)).toBeVisible();
await expect(page.locator('ul#listLatestActivity li').filter({ hasText: 'Contact 00 received' }).nth(0)).toBeVisible();
});
Loading…
Cancel
Save