|
@ -22,6 +22,7 @@ test('Record an offer', async ({ page }) => { |
|
|
await page.getByTestId('offerButton').click(); |
|
|
await page.getByTestId('offerButton').click(); |
|
|
await page.getByTestId('inputDescription').fill(description); |
|
|
await page.getByTestId('inputDescription').fill(description); |
|
|
await page.getByTestId('inputOfferAmount').fill(randomNonZeroNumber.toString()); |
|
|
await page.getByTestId('inputOfferAmount').fill(randomNonZeroNumber.toString()); |
|
|
|
|
|
expect(page.getByRole('button', { name: 'Sign & Send' })); |
|
|
await page.getByRole('button', { name: 'Sign & Send' }).click(); |
|
|
await page.getByRole('button', { name: 'Sign & Send' }).click(); |
|
|
await expect(page.getByText('That offer was recorded.')).toBeVisible(); |
|
|
await expect(page.getByText('That offer was recorded.')).toBeVisible(); |
|
|
|
|
|
|
|
@ -36,8 +37,8 @@ test('Record an offer', async ({ page }) => { |
|
|
const serverPagePromise = page.waitForEvent('popup'); |
|
|
const serverPagePromise = page.waitForEvent('popup'); |
|
|
await page.getByRole('link', { name: 'View on the Public Server' }).click(); |
|
|
await page.getByRole('link', { name: 'View on the Public Server' }).click(); |
|
|
const serverPage = await serverPagePromise; |
|
|
const serverPage = await serverPagePromise; |
|
|
await serverPage.getByText(description); |
|
|
await expect(serverPage.getByText(description)).toBeVisible(); |
|
|
await serverPage.getByText('did:none:HIDDEN'); |
|
|
await expect(serverPage.getByText('did:none:HIDDEN')).toBeVisible(); |
|
|
|
|
|
|
|
|
// Now update that offer
|
|
|
// Now update that offer
|
|
|
|
|
|
|
|
@ -61,12 +62,12 @@ test('Record an offer', async ({ page }) => { |
|
|
await page.goto('./projects'); |
|
|
await page.goto('./projects'); |
|
|
await page.getByRole('link', { name: 'Offers', exact: true }).click(); |
|
|
await page.getByRole('link', { name: 'Offers', exact: true }).click(); |
|
|
await page.locator('li').filter({ hasText: description }).locator('a').first().click(); |
|
|
await page.locator('li').filter({ hasText: description }).locator('a').first().click(); |
|
|
const newItemDesc = await page.getByTestId('description'); |
|
|
const newItemDesc = page.getByTestId('description'); |
|
|
await expect(newItemDesc).toHaveText(updatedDescription); |
|
|
await expect(newItemDesc).toHaveText(updatedDescription); |
|
|
|
|
|
|
|
|
// go to edit page
|
|
|
// go to edit page
|
|
|
await page.getByTestId('editClaimButton').click(); |
|
|
await page.getByTestId('editClaimButton').click(); |
|
|
const newAmount = await page.getByTestId('inputOfferAmount'); |
|
|
const newAmount = page.getByTestId('inputOfferAmount'); |
|
|
await expect(newAmount).toHaveValue((randomNonZeroNumber + 1).toString()); |
|
|
await expect(newAmount).toHaveValue((randomNonZeroNumber + 1).toString()); |
|
|
|
|
|
|
|
|
// go to the home page and check that the offer is shown as new
|
|
|
// go to the home page and check that the offer is shown as new
|
|
@ -102,8 +103,8 @@ test('Affirm delivery of an offer', async ({ page }) => { |
|
|
// click on the 'Affirm Delivery' button
|
|
|
// click on the 'Affirm Delivery' button
|
|
|
await page.getByRole('button', { name: 'Affirm Delivery' }).click(); |
|
|
await page.getByRole('button', { name: 'Affirm Delivery' }).click(); |
|
|
// fill our offer info and submit
|
|
|
// fill our offer info and submit
|
|
|
await page.getByPlaceholder('What was given').fill("Whatever the offer says"); |
|
|
await page.getByPlaceholder('What was given').fill('Whatever the offer says'); |
|
|
await page.getByRole('spinbutton').fill("2"); |
|
|
await page.getByRole('spinbutton').fill('2'); |
|
|
await page.getByRole('button', { name: 'Sign & Send' }).click(); |
|
|
await page.getByRole('button', { name: 'Sign & Send' }).click(); |
|
|
await expect(page.getByText('That gift was recorded.')).toBeVisible(); |
|
|
await expect(page.getByText('That gift was recorded.')).toBeVisible(); |
|
|
}); |
|
|
}); |
|
|