forked from trent_larson/crowd-funder-for-time-pwa
fix error is OfferDialog where assignment to a project was missed, plus some refactors
This commit is contained in:
@@ -128,6 +128,7 @@ test('Check User 0 can register a random person', async ({ page }) => {
|
||||
await deleteContact(page, newDid);
|
||||
// go the activity page for this new person
|
||||
await page.goto('./did/' + encodeURIComponent(newDid));
|
||||
// maybe replace by: const popupPromise = page.waitForEvent('popup');
|
||||
let error;
|
||||
try {
|
||||
await page.waitForSelector('div[role="alert"]', { timeout: 2000 });
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { importUser, createUniqueStringsArray, createRandomNumbersArray } from './testUtils';
|
||||
|
||||
test('Record 10 new gifts', async ({ page }) => {
|
||||
const giftCount = 10;
|
||||
test('Record 9 new gifts', async ({ page }) => {
|
||||
const giftCount = 9; // because 10 has taken us above 30 seconds
|
||||
|
||||
// Standard text
|
||||
const standardTitle = "Gift ";
|
||||
const standardTitle = 'Gift ';
|
||||
|
||||
// Field value arrays
|
||||
const finalTitles = [];
|
||||
|
||||
@@ -17,6 +17,7 @@ test('Record an offer', async ({ page }) => {
|
||||
await page.locator('ul#listDiscoverResults li:nth-child(1)').click();
|
||||
|
||||
// Record an offer
|
||||
await page.locator('button', { hasText: 'Edit' }).isVisible(); // since the 'edit' takes longer to show, wait for that (lest the click miss)
|
||||
await page.getByTestId('offerButton').click();
|
||||
await page.getByTestId('inputDescription').fill(description);
|
||||
await page.getByTestId('inputOfferAmount').fill(randomNonZeroNumber.toString());
|
||||
@@ -28,6 +29,8 @@ test('Record an offer', async ({ page }) => {
|
||||
await page.locator('li').filter({ hasText: description }).locator('a').first().click();
|
||||
await expect(page.getByRole('heading', { name: 'Verifiable Claim Details' })).toBeVisible();
|
||||
await expect(page.getByText(description, { exact: true })).toBeVisible();
|
||||
await expect(page.getByText('Offered to a bigger plan')).toBeVisible();
|
||||
|
||||
const serverPagePromise = page.waitForEvent('popup');
|
||||
await page.getByRole('link', { name: 'View on the Public Server' }).click();
|
||||
const serverPage = await serverPagePromise;
|
||||
@@ -49,6 +52,7 @@ test('Record an offer', async ({ page }) => {
|
||||
await itemDesc.fill(updatedDescription);
|
||||
await amount.fill(String(randomNonZeroNumber + 1));
|
||||
await page.getByRole('button', { name: 'Sign & Send' }).click();
|
||||
await expect(page.getByText('That offer was recorded.')).toBeVisible();
|
||||
|
||||
// go to the offer claim again and check the updated values
|
||||
await page.goto('./projects');
|
||||
|
||||
Reference in New Issue
Block a user