|
@ -16,7 +16,7 @@ test('New offers for another user', async ({ page }) => { |
|
|
await expect(page.locator('div[role="alert"] button > svg.fa-xmark')).toBeHidden(); // ensure alert is gone
|
|
|
await expect(page.locator('div[role="alert"] button > svg.fa-xmark')).toBeHidden(); // ensure alert is gone
|
|
|
|
|
|
|
|
|
// show buttons to make offers directly to people
|
|
|
// show buttons to make offers directly to people
|
|
|
await page.getByRole('button').filter({ hasText: /Show Given Hours/i }).click(); |
|
|
await page.getByRole('button').filter({ hasText: /See Hours/i }).click(); |
|
|
|
|
|
|
|
|
// make an offer directly to user 1
|
|
|
// make an offer directly to user 1
|
|
|
// Generate a random string of 3 characters, skipping the "0." at the beginning
|
|
|
// Generate a random string of 3 characters, skipping the "0." at the beginning
|
|
@ -50,7 +50,7 @@ test('New offers for another user', async ({ page }) => { |
|
|
await offerNumElem.click(); |
|
|
await offerNumElem.click(); |
|
|
|
|
|
|
|
|
await expect(page.getByText('New Offers To You', { exact: true })).toBeVisible(); |
|
|
await expect(page.getByText('New Offers To You', { exact: true })).toBeVisible(); |
|
|
await page.getByTestId('showOffersToUser').click(); |
|
|
await page.getByTestId('showOffersToUser').locator('div > svg.fa-chevron-right').click(); |
|
|
// note that they show in reverse chronologicalorder
|
|
|
// note that they show in reverse chronologicalorder
|
|
|
await expect(page.getByText(`help of ${randomString2} from #000`)).toBeVisible(); |
|
|
await expect(page.getByText(`help of ${randomString2} from #000`)).toBeVisible(); |
|
|
await expect(page.getByText(`help of ${randomString1} from #000`)).toBeVisible(); |
|
|
await expect(page.getByText(`help of ${randomString1} from #000`)).toBeVisible(); |
|
@ -62,7 +62,8 @@ test('New offers for another user', async ({ page }) => { |
|
|
// now find the "Click to keep all above as new offers" after that list item and click it
|
|
|
// now find the "Click to keep all above as new offers" after that list item and click it
|
|
|
const liElem = page.locator('li').filter({ hasText: `help of ${randomString2} from #000` }); |
|
|
const liElem = page.locator('li').filter({ hasText: `help of ${randomString2} from #000` }); |
|
|
await liElem.hover(); |
|
|
await liElem.hover(); |
|
|
const keepAboveAsNew = liElem.locator('div').filter({ hasText: /keep all above/ }); |
|
|
const keepAboveAsNew = await liElem.locator('div').filter({ hasText: /keep all above/ }); |
|
|
|
|
|
|
|
|
await keepAboveAsNew.click(); |
|
|
await keepAboveAsNew.click(); |
|
|
|
|
|
|
|
|
// now see that only one offer is shown as new
|
|
|
// now see that only one offer is shown as new
|
|
@ -71,7 +72,7 @@ test('New offers for another user', async ({ page }) => { |
|
|
await expect(offerNumElem).toHaveText('1'); |
|
|
await expect(offerNumElem).toHaveText('1'); |
|
|
await offerNumElem.click(); |
|
|
await offerNumElem.click(); |
|
|
await expect(page.getByText('New Offer To You', { exact: true })).toBeVisible(); |
|
|
await expect(page.getByText('New Offer To You', { exact: true })).toBeVisible(); |
|
|
await page.getByTestId('showOffersToUser').click(); |
|
|
await page.getByTestId('showOffersToUser').locator('div > svg.fa-chevron-right').click(); |
|
|
|
|
|
|
|
|
// now see that no offers are shown as new
|
|
|
// now see that no offers are shown as new
|
|
|
await page.goto('./'); |
|
|
await page.goto('./'); |
|
|