ID-specific locators

This commit is contained in:
Jose Olarte III
2024-07-30 18:50:53 +08:00
parent 37d4e36561
commit 2aead1b4b1
6 changed files with 10 additions and 10 deletions

View File

@@ -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();
});

View File

@@ -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();
});

View File

@@ -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();
});

View File

@@ -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();

View File

@@ -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);
});

View File

@@ -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();
});