From 31313a928cf2abc71e7e12868d153c1687ac8cfc Mon Sep 17 00:00:00 2001 From: Dev Singh Date: Wed, 11 Sep 2024 11:40:59 -0500 Subject: [PATCH] edit test --- e2e/tests/student/edit.spec.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/e2e/tests/student/edit.spec.ts b/e2e/tests/student/edit.spec.ts index e64af41..20ead4a 100644 --- a/e2e/tests/student/edit.spec.ts +++ b/e2e/tests/student/edit.spec.ts @@ -10,9 +10,13 @@ describe("Test that users can edit their profile", () => { expect(page.getByText('Skills')).toBeTruthy() expect(page.getByText('Botting')).toBeTruthy() await page.getByRole('button', { name: 'Edit' }).click(); - await page.getByRole('button', { name: 'Add Degree' }).click(); - await page.getByRole('textbox', { name: 'Major' }).click(); - await page.getByRole('option', { name: 'Computer Science', exact: true }).click(); + try { + await page.getByRole('button', { name: 'Add Degree' }).click(); + await page.getByRole('textbox', { name: 'Major' }).click(); + await page.getByRole('option', { name: 'Computer Science', exact: true }).click(); + } catch (e) { + console.log("user already has a degree, not adding another one.") + } await page.getByRole('button', { name: 'Save' }).click(); expect(await page.waitForSelector('text="Profile saved!"')).toBeTruthy(); });