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(); });