From 28dd602d9f6160943d27822e4d057d9d84411b7a Mon Sep 17 00:00:00 2001 From: Jose Olarte III Date: Tue, 30 Jul 2024 18:50:53 +0800 Subject: [PATCH] ID-specific locators --- test-playwright/01-check-activity-feed.spec.ts | 4 ++-- test-playwright/02-check-discover-results.spec.ts | 4 ++-- test-playwright/03-check-noid-messaging.spec.ts | 4 ++-- test-playwright/15-check-usage-limits.spec.ts | 2 +- test-playwright/21-create-project-search.spec.ts | 2 +- test-playwright/40-add-contact.spec.ts | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test-playwright/01-check-activity-feed.spec.ts b/test-playwright/01-check-activity-feed.spec.ts index 30e5ccc..c0d4234 100644 --- a/test-playwright/01-check-activity-feed.spec.ts +++ b/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(); }); \ No newline at end of file diff --git a/test-playwright/02-check-discover-results.spec.ts b/test-playwright/02-check-discover-results.spec.ts index 222ea7b..fa71f6a 100644 --- a/test-playwright/02-check-discover-results.spec.ts +++ b/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(); }); \ No newline at end of file diff --git a/test-playwright/03-check-noid-messaging.spec.ts b/test-playwright/03-check-noid-messaging.spec.ts index 751a128..8ae27d3 100644 --- a/test-playwright/03-check-noid-messaging.spec.ts +++ b/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(); }); \ No newline at end of file diff --git a/test-playwright/15-check-usage-limits.spec.ts b/test-playwright/15-check-usage-limits.spec.ts index f534ed7..84d4045 100644 --- a/test-playwright/15-check-usage-limits.spec.ts +++ b/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(); diff --git a/test-playwright/21-create-project-search.spec.ts b/test-playwright/21-create-project-search.spec.ts index b56d03d..cd72333 100644 --- a/test-playwright/21-create-project-search.spec.ts +++ b/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); }); \ No newline at end of file diff --git a/test-playwright/40-add-contact.spec.ts b/test-playwright/40-add-contact.spec.ts index 44bf399..2bb52d6 100644 --- a/test-playwright/40-add-contact.spec.ts +++ b/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(); }); \ No newline at end of file