diff --git a/package.json b/package.json index b58a81a..d958ea6 100644 --- a/package.json +++ b/package.json @@ -59,5 +59,6 @@ "engines": { "node": ">=20", "pnpm": ">=9" - } + }, + "packageManager": "pnpm@9.15.4+sha512.b2dc20e2fc72b3e18848459b37359a32064663e5627a51e4c74b2c29dd8e8e0491483c3abb40789cfd578bf362fb6ba8261b05f0387d76792ed6e23ea3b1b6a0" } diff --git a/playwright-tests/tests/becomeAMentee.page.spec.ts b/playwright-tests/tests/becomeAMentee.page.spec.ts new file mode 100644 index 0000000..731989f --- /dev/null +++ b/playwright-tests/tests/becomeAMentee.page.spec.ts @@ -0,0 +1,50 @@ +import { expect } from '@playwright/test'; +import { test } from '@utils/fixtures'; + +test('Validate "Become a Mentee" section and Find a Mentor button', async ({ + page, +}) => { + // Navigate to Mentorship page + await page.goto('/mentorship'); + + // Scroll to "Become a Mentee" section + const sectionTitle = page.getByRole('heading', { + level: 4, + name: /Become a Mentee/i, + }); + await sectionTitle.scrollIntoViewIfNeeded(); + + // Validate title + await expect(sectionTitle).toBeVisible(); + + // Validate description text + const description = page.getByRole('heading', { + level: 5, + name: /You should become a mentee if you:/i, + }); + await expect(description).toBeVisible(); + + // List items + const items = [ + 'Want to start a career in software engineering', + 'Want to find a better job', + 'Want to be promoted at work', + 'Want to apply for a leadership position', + 'Need support in advancing your career', + ]; + + for (const item of items) { + await expect(page.getByText(item)).toBeVisible(); + } + + // Validate "Find a mentor" button + const findMentorButton = page.getByRole('button', { + name: 'Find a mentor', + }); + await expect(findMentorButton).toBeVisible(); + await expect(findMentorButton).toBeEnabled(); + await findMentorButton.click(); + + // Verify redirection + await expect(page).toHaveURL(/\/mentorship\/mentors/); +});