Skip to content

Commit

Permalink
Change locators
Browse files Browse the repository at this point in the history
  • Loading branch information
constanzauanini committed Nov 1, 2024
1 parent 7c4cd6c commit b8e8b02
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
11 changes: 4 additions & 7 deletions playwright/e2e/suites/accession.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ export default function AccessionTests() {
await page.getByText('Fresh').click();
await page.getByPlaceholder('Select...').nth(2).click();
await page.getByText('Nursery Media').click();
await page.locator('input[type="text"]').click();
await page.locator('input[type="text"]').fill('5');
await page.locator('#seedsTested').getByRole('textbox').fill('5');
await page.getByRole('button', { name: 'Save' }).click();
await page.getByRole('button', { name: '#' }).click();
await page.getByRole('button', { name: 'Edit' }).click();
Expand Down Expand Up @@ -125,7 +124,7 @@ export default function AccessionTests() {
.getByText(/My New Nursery/)
.nth(0)
.click();
await page.locator('input[type="text"]').fill('300');
await page.locator('#withdrawnQuantity').getByRole('textbox').fill('300');
await page.getByRole('button', { name: 'Add Notes' }).click();
await page.locator('textarea').fill('Adding some test notes here!');
await page.locator('#saveWithdraw').click();
Expand Down Expand Up @@ -159,8 +158,7 @@ export default function AccessionTests() {
await page.getByPlaceholder('Select...').first().click();
await page.getByText('Out-planting').click();
await page.getByLabel('Seed Count', { exact: true }).check();
await page.locator('input[type="text"]').click();
await page.locator('input[type="text"]').fill('100');
await page.locator('#withdrawnQuantity').getByRole('textbox').fill('100');
await page.locator('#saveWithdraw').click();
await expect(page.getByRole('main')).toContainText('95 Grams');
await expect(page.getByRole('main')).toContainText('~95 ct');
Expand All @@ -183,8 +181,7 @@ export default function AccessionTests() {
await page.getByText('Soil').click();
await page.getByPlaceholder('Select...').nth(3).click();
await page.getByText('Soak').click();
await page.locator('input[type="text"]').click();
await page.locator('input[type="text"]').fill('20');
await page.locator('#withdrawnQuantity').getByRole('textbox').fill('20');
await page.locator('#saveWithdraw').click();
await expect(page.getByRole('main')).toContainText('75 Grams');
await expect(page.getByRole('main')).toContainText('~75 ct');
Expand Down
4 changes: 2 additions & 2 deletions playwright/e2e/suites/inventory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function InventoryTests() {
await waitFor(page, '#home');
await page.getByRole('button', { name: 'Seedlings' }).click();
await page.getByRole('button', { name: 'Inventory' }).click();
await page.getByRole('button', { name: 'Add Inventory' }).click();
await page.locator('#new-inventory').click();
await page.getByPlaceholder('Search or Select...').click();
await page.locator('li').filter({ hasText: 'Banana' }).locator('div').click();
await page.locator('div:nth-child(2) > .select > .textfield-container').click();
Expand Down Expand Up @@ -71,7 +71,7 @@ export default function InventoryTests() {
await waitFor(page, '#home');
await page.getByRole('button', { name: 'Seedlings' }).click();
await page.getByRole('button', { name: 'Inventory' }).click();
await page.getByRole('button', { name: 'Add Inventory' }).click();
await page.locator('#new-inventory').click();
await page.getByPlaceholder('Search or Select...').click();
await page.locator('li').filter({ hasText: 'Coconut' }).locator('div').click();

Expand Down
4 changes: 2 additions & 2 deletions playwright/e2e/suites/locations.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function LocationTests() {

await page.getByRole('button', { name: 'Add Seed Bank' }).click();

await page.getByLabel('Name *').fill(newSeedBankName);
await page.locator('#name').getByRole('textbox').fill(newSeedBankName);
await page.locator('textarea').click();
await page.locator('textarea').fill('My Brand New Seed Bank!');
await page.getByLabel('Build Start Date').fill('2023-12-31');
Expand Down Expand Up @@ -61,7 +61,7 @@ export default function LocationTests() {
await page.getByRole('button', { name: 'Locations' }).click();
await page.getByRole('button', { name: 'Nurseries' }).click();
await page.getByRole('button', { name: 'Add Nursery' }).click();
await page.getByLabel('Name *').fill(newNurseryName);
await page.locator('#name').getByRole('textbox').fill(newNurseryName);
await page.locator('textarea').click();
await page.locator('textarea').fill('My Super Special Test Nursery!!!');
await page.getByLabel('Build Start Date').click();
Expand Down

0 comments on commit b8e8b02

Please sign in to comment.