Compare commits
15 Commits
46ebd95394
...
03a3964cbd
Author | SHA1 | Date |
---|---|---|
Jose Olarte III | 03a3964cbd | 3 months ago |
Trent Larson | acf04792be | 3 months ago |
Jose Olarte III | 3262f0ee64 | 3 months ago |
Jose Olarte III | 69473a826f | 3 months ago |
Jose Olarte III | 51eb45353e | 3 months ago |
Jose Olarte III | b1875b5812 | 3 months ago |
Jose Olarte III | bd27d8a10f | 3 months ago |
Jose Olarte III | c076ce5b44 | 3 months ago |
Jose Olarte III | 915d51dc2f | 3 months ago |
Jose Olarte III | b1d61251dc | 3 months ago |
Jose Olarte III | a9aeeeb51e | 3 months ago |
Jose Olarte III | d679d0c804 | 3 months ago |
Jose Olarte III | c4a8026276 | 3 months ago |
Jose Olarte III | 10fad9c167 | 3 months ago |
Jose Olarte III | 084fb09971 | 4 months ago |
4 changed files with 164 additions and 9 deletions
@ -0,0 +1,45 @@ |
|||||
|
import { test, expect } from '@playwright/test'; |
||||
|
import { importUser, createUniqueStringsArray } from './testUtils'; |
||||
|
|
||||
|
test('Create 10 new projects', async ({ page }) => { |
||||
|
const projectCount = 10; |
||||
|
|
||||
|
// Standard texts
|
||||
|
const standardTitle = "Idea "; |
||||
|
const standardDescription = "Description of Idea "; |
||||
|
|
||||
|
// Title and description arrays
|
||||
|
const finalTitles = []; |
||||
|
const finalDescriptions = []; |
||||
|
|
||||
|
// Create an array of unique strings
|
||||
|
const uniqueStrings = await createUniqueStringsArray(projectCount); |
||||
|
|
||||
|
// Populate arrays with titles and descriptions
|
||||
|
for (let i = 0; i < projectCount; i++) { |
||||
|
let loopTitle = standardTitle + uniqueStrings[i]; |
||||
|
finalTitles.push(loopTitle); |
||||
|
let loopDescription = standardDescription + uniqueStrings[i]; |
||||
|
finalDescriptions.push(loopDescription); |
||||
|
} |
||||
|
|
||||
|
// Import user 00
|
||||
|
await importUser(page, '00'); |
||||
|
|
||||
|
// Create new projects
|
||||
|
for (let i = 0; i < projectCount; i++) { |
||||
|
await page.goto('./projects'); |
||||
|
await page.getByRole('link', { name: 'Projects', exact: true }).click(); |
||||
|
await page.getByRole('button').click(); |
||||
|
await page.getByPlaceholder('Idea Name').fill(finalTitles[i]); // Add random suffix
|
||||
|
await page.getByPlaceholder('Description').fill(finalDescriptions[i]); |
||||
|
await page.getByPlaceholder('Website').fill('https://example.com'); |
||||
|
await page.getByPlaceholder('Start Date').fill('2025-12-01'); |
||||
|
await page.getByPlaceholder('Start Time').fill('12:00'); |
||||
|
await page.getByRole('button', { name: 'Save Project' }).click(); |
||||
|
|
||||
|
// Check texts
|
||||
|
await expect(page.locator('h2')).toContainText(finalTitles[i]); |
||||
|
await expect(page.locator('#Content')).toContainText(finalDescriptions[i]); |
||||
|
} |
||||
|
}); |
@ -0,0 +1,43 @@ |
|||||
|
import { test, expect } from '@playwright/test'; |
||||
|
import { importUser, createUniqueStringsArray, createRandomNumbersArray } from './testUtils'; |
||||
|
|
||||
|
test('Record 10 new gifts', async ({ page }) => { |
||||
|
const giftCount = 10; |
||||
|
|
||||
|
// Standard text
|
||||
|
const standardTitle = "Gift "; |
||||
|
|
||||
|
// Field value arrays
|
||||
|
const finalTitles = []; |
||||
|
const finalNumbers = []; |
||||
|
|
||||
|
// Create arrays for field input
|
||||
|
const uniqueStrings = await createUniqueStringsArray(giftCount); |
||||
|
const randomNumbers = await createRandomNumbersArray(giftCount); |
||||
|
|
||||
|
// Populate array with titles
|
||||
|
for (let i = 0; i < giftCount; i++) { |
||||
|
let loopTitle = standardTitle + uniqueStrings[i]; |
||||
|
finalTitles.push(loopTitle); |
||||
|
let loopNumber = randomNumbers[i]; |
||||
|
finalNumbers.push(loopNumber); |
||||
|
} |
||||
|
|
||||
|
// Import user 00
|
||||
|
await importUser(page, '00'); |
||||
|
|
||||
|
// Record new gifts
|
||||
|
for (let i = 0; i < giftCount; i++) { |
||||
|
// Record something given
|
||||
|
await page.goto('./'); |
||||
|
await page.getByRole('heading', { name: 'Unnamed/Unknown' }).click(); |
||||
|
await page.getByPlaceholder('What was given').fill(finalTitles[i]); |
||||
|
await page.getByRole('spinbutton').fill(finalNumbers[i].toString()); |
||||
|
await page.getByRole('button', { name: 'Sign & Send' }).click(); |
||||
|
await expect(page.getByText('That gift was recorded.')).toBeVisible(); |
||||
|
|
||||
|
// Refresh home view and check gift
|
||||
|
await page.goto('./'); |
||||
|
await expect(page.locator('li').filter({ hasText: finalTitles[i] })).toBeVisible(); |
||||
|
} |
||||
|
}); |
Loading…
Reference in new issue