From 50547c4d1d890417725373e434154f8f437d869d Mon Sep 17 00:00:00 2001 From: joana Date: Sun, 23 Nov 2025 16:26:35 +0000 Subject: [PATCH 01/10] Remove mentee registration option from mentorship dropdown --- src/utils/staticContent.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/utils/staticContent.ts b/src/utils/staticContent.ts index 84af62a7..053b205f 100644 --- a/src/utils/staticContent.ts +++ b/src/utils/staticContent.ts @@ -22,10 +22,6 @@ export const headerSetup = { title: 'Mentor Registration', path: '/mentorship/mentor-registration', }, - { - title: 'Mentee Registration', - path: '/mentorship/mentor-registration', - }, { title: 'Resources', path: '/mentorship/resources', From 8b589e5f0098059fc6394938231b9790052440d1 Mon Sep 17 00:00:00 2001 From: joana Date: Sun, 21 Dec 2025 19:36:29 +0000 Subject: [PATCH 02/10] Create file for playright test --- .../tests/becomeAMentee.page.spec.ts | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 playwright-tests/tests/becomeAMentee.page.spec.ts diff --git a/playwright-tests/tests/becomeAMentee.page.spec.ts b/playwright-tests/tests/becomeAMentee.page.spec.ts new file mode 100644 index 00000000..aee771cf --- /dev/null +++ b/playwright-tests/tests/becomeAMentee.page.spec.ts @@ -0,0 +1,36 @@ +import { expect } from '@playwright/test'; +import { test } from '@utils/fixtures'; + +test.describe('Become a mentee Page', () => { + test('MENT-004: Verify title and cards are correctly displayed', async ({ + mentorshipPage, + basePage, + }) => { + await basePage.navigateToPath('/mentorship'); + });}) + + + + // test.describe('Mentorship Feedback Section', () => { + // test('MENT-004: Verify title and cards are correctly displayed', async ({ + // mentorshipPage, + // basePage, + // }) => { + // await basePage.navigateToPath('/mentorship'); + + // await expect(mentorshipPage.testimonialsTitle).toBeVisible(); + + // await expect(mentorshipPage.testimonialCards).toHaveCount(3); + + // await expect(mentorshipPage.firstTestimonialCardIcon).toBeVisible(); + + // await expect(mentorshipPage.firstTestimonialCardText).toBeVisible(); + // await expect(mentorshipPage.firstTestimonialCardText).not.toBeEmpty(); + + // await expect(mentorshipPage.firstTestimonialCardAuthor).toHaveText( + // /^.+,\s*Mentor\s+\d{4}$/, + // ); + + // await expect(mentorshipPage.showMoreButton).toBeVisible(); + // }); + // }); \ No newline at end of file From 1e372c0be8bc705f5175b88a94aaf65fc024fda1 Mon Sep 17 00:00:00 2001 From: joana Date: Sun, 11 Jan 2026 16:34:25 +0000 Subject: [PATCH 03/10] test: add title, description tests --- .../tests/becomeAMentee.page.spec.ts | 84 +++++++++++-------- 1 file changed, 51 insertions(+), 33 deletions(-) diff --git a/playwright-tests/tests/becomeAMentee.page.spec.ts b/playwright-tests/tests/becomeAMentee.page.spec.ts index aee771cf..c1fea1f1 100644 --- a/playwright-tests/tests/becomeAMentee.page.spec.ts +++ b/playwright-tests/tests/becomeAMentee.page.spec.ts @@ -1,36 +1,54 @@ import { expect } from '@playwright/test'; import { test } from '@utils/fixtures'; -test.describe('Become a mentee Page', () => { - test('MENT-004: Verify title and cards are correctly displayed', async ({ - mentorshipPage, - basePage, - }) => { - await basePage.navigateToPath('/mentorship'); - });}) - - - - // test.describe('Mentorship Feedback Section', () => { - // test('MENT-004: Verify title and cards are correctly displayed', async ({ - // mentorshipPage, - // basePage, - // }) => { - // await basePage.navigateToPath('/mentorship'); - - // await expect(mentorshipPage.testimonialsTitle).toBeVisible(); - - // await expect(mentorshipPage.testimonialCards).toHaveCount(3); - - // await expect(mentorshipPage.firstTestimonialCardIcon).toBeVisible(); - - // await expect(mentorshipPage.firstTestimonialCardText).toBeVisible(); - // await expect(mentorshipPage.firstTestimonialCardText).not.toBeEmpty(); - - // await expect(mentorshipPage.firstTestimonialCardAuthor).toHaveText( - // /^.+,\s*Mentor\s+\d{4}$/, - // ); - - // await expect(mentorshipPage.showMoreButton).toBeVisible(); - // }); - // }); \ No newline at end of file +test('Validate "Become a Mentee" section and Find a Mentor button', async ({ + page, + homePage, +}) => { + // 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(); + + // Click the button + await findMentorButton.click(); + + // Verify redirection + await expect(page).toHaveURL(/\/mentorship\/mentors/); + await expect(page).toHaveTitle(/Meet Our Mentors/i); +}); From 80321654b2cb4a4175beee9fc549e53a2daa43c8 Mon Sep 17 00:00:00 2001 From: joana Date: Sun, 11 Jan 2026 16:37:31 +0000 Subject: [PATCH 04/10] playwright --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 54571eed..105821de 100644 --- a/package.json +++ b/package.json @@ -58,5 +58,6 @@ "engines": { "node": ">=20", "pnpm": ">=9" - } + }, + "packageManager": "pnpm@9.15.4+sha512.b2dc20e2fc72b3e18848459b37359a32064663e5627a51e4c74b2c29dd8e8e0491483c3abb40789cfd578bf362fb6ba8261b05f0387d76792ed6e23ea3b1b6a0" } From c58ff9aef131d61daa7ac30953afd27f1b4ce94f Mon Sep 17 00:00:00 2001 From: joana Date: Sun, 11 Jan 2026 16:51:31 +0000 Subject: [PATCH 05/10] test: add button testing --- playwright-tests/tests/becomeAMentee.page.spec.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/playwright-tests/tests/becomeAMentee.page.spec.ts b/playwright-tests/tests/becomeAMentee.page.spec.ts index c1fea1f1..731989fa 100644 --- a/playwright-tests/tests/becomeAMentee.page.spec.ts +++ b/playwright-tests/tests/becomeAMentee.page.spec.ts @@ -3,7 +3,6 @@ import { test } from '@utils/fixtures'; test('Validate "Become a Mentee" section and Find a Mentor button', async ({ page, - homePage, }) => { // Navigate to Mentorship page await page.goto('/mentorship'); @@ -44,11 +43,8 @@ test('Validate "Become a Mentee" section and Find a Mentor button', async ({ }); await expect(findMentorButton).toBeVisible(); await expect(findMentorButton).toBeEnabled(); - - // Click the button await findMentorButton.click(); // Verify redirection await expect(page).toHaveURL(/\/mentorship\/mentors/); - await expect(page).toHaveTitle(/Meet Our Mentors/i); }); From d5141ec51f00a27d85a8c1e24fe2ee73b4212b90 Mon Sep 17 00:00:00 2001 From: joana Date: Sun, 18 Jan 2026 14:38:28 +0000 Subject: [PATCH 06/10] fix: remove ununcessary element --- playwright-tests/tests/becomeAMentee.page.spec.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/playwright-tests/tests/becomeAMentee.page.spec.ts b/playwright-tests/tests/becomeAMentee.page.spec.ts index 731989fa..1fcf888f 100644 --- a/playwright-tests/tests/becomeAMentee.page.spec.ts +++ b/playwright-tests/tests/becomeAMentee.page.spec.ts @@ -12,7 +12,6 @@ test('Validate "Become a Mentee" section and Find a Mentor button', async ({ level: 4, name: /Become a Mentee/i, }); - await sectionTitle.scrollIntoViewIfNeeded(); // Validate title await expect(sectionTitle).toBeVisible(); From 09e89e0e5760590873db86d297b7325cbacd9650 Mon Sep 17 00:00:00 2001 From: joana Date: Sun, 8 Feb 2026 19:26:39 +0000 Subject: [PATCH 07/10] test: improve tests and add ID to MentorBecomeCard item list --- playwright-tests/pages/mentorship.page.ts | 12 ++++++++ .../tests/becomeAMentee.page.spec.ts | 28 ++++++------------- src/components/MentorBecomeCard.tsx | 4 ++- src/pages/mentorship/index.tsx | 2 ++ 4 files changed, 25 insertions(+), 21 deletions(-) diff --git a/playwright-tests/pages/mentorship.page.ts b/playwright-tests/pages/mentorship.page.ts index f88ab110..4aada10f 100644 --- a/playwright-tests/pages/mentorship.page.ts +++ b/playwright-tests/pages/mentorship.page.ts @@ -42,6 +42,9 @@ export class MentorshipPage extends BasePage { readonly feedbackArea: Locator; readonly testimonialCards: Locator; readonly showMoreButton: Locator; + readonly sectionTitle: Locator; + readonly description: Locator; + readonly menteeListItems: Locator; constructor(page: Page) { super(page); @@ -54,6 +57,15 @@ export class MentorshipPage extends BasePage { this.feedbackArea = page.getByTestId('feedback-area'); this.testimonialCards = this.feedbackArea.getByTestId('feedback-card'); this.showMoreButton = this.feedbackArea.getByTestId('feedback-show-more'); + this.sectionTitle = page.getByRole('heading', { + level: 4, + name: /Become a Mentee/i, + }); + this.description = page.getByRole('heading', { + level: 5, + name: /You should become a mentee if you:/i, + }); + this.menteeListItems = page.locator('ol[data-testid="mentee-card"] > li'); } getTestimonialCard(index: number): TestimonialCard { diff --git a/playwright-tests/tests/becomeAMentee.page.spec.ts b/playwright-tests/tests/becomeAMentee.page.spec.ts index 1fcf888f..a8a24910 100644 --- a/playwright-tests/tests/becomeAMentee.page.spec.ts +++ b/playwright-tests/tests/becomeAMentee.page.spec.ts @@ -1,5 +1,7 @@ import { expect } from '@playwright/test'; import { test } from '@utils/fixtures'; +import { HomePage } from '@pages/home.page'; +import { MentorshipPage } from '@pages/mentorship.page'; test('Validate "Become a Mentee" section and Find a Mentor button', async ({ page, @@ -7,20 +9,12 @@ test('Validate "Become a Mentee" section and Find a Mentor button', async ({ // 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, - }); + // "Become a Mentee" section + const { sectionTitle, description, menteeListItems } = new MentorshipPage( + page, + ); - // 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 @@ -32,16 +26,10 @@ test('Validate "Become a Mentee" section and Find a Mentor button', async ({ 'Need support in advancing your career', ]; - for (const item of items) { - await expect(page.getByText(item)).toBeVisible(); - } + await expect(menteeListItems).toHaveText(items); // Validate "Find a mentor" button - const findMentorButton = page.getByRole('button', { - name: 'Find a mentor', - }); - await expect(findMentorButton).toBeVisible(); - await expect(findMentorButton).toBeEnabled(); + const { findMentorButton } = new HomePage(page); await findMentorButton.click(); // Verify redirection diff --git a/src/components/MentorBecomeCard.tsx b/src/components/MentorBecomeCard.tsx index fe3789d6..00fb093e 100644 --- a/src/components/MentorBecomeCard.tsx +++ b/src/components/MentorBecomeCard.tsx @@ -10,6 +10,7 @@ interface MentorBecomeCardProps { topics: string[]; buttonText: string; buttonUrl: string; + listTestId?: string; } export const MentorBecomeCard = ({ @@ -17,6 +18,7 @@ export const MentorBecomeCard = ({ topics, buttonText, buttonUrl, + listTestId, }: MentorBecomeCardProps) => { const isMobile = useMediaQuery(theme.breakpoints.down('md')); return ( @@ -48,7 +50,7 @@ export const MentorBecomeCard = ({ You should become a {mentorOrMentee} if you: -
    +
      {topics.map((topic: any, index: number) => (
    1. { buttonText={'Join as a mentor'} > Date: Sun, 24 May 2026 16:25:10 +0100 Subject: [PATCH 08/10] chore: improve naming for readability --- src/pages/mentorship/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/mentorship/index.tsx b/src/pages/mentorship/index.tsx index 98daa864..24dcdc87 100644 --- a/src/pages/mentorship/index.tsx +++ b/src/pages/mentorship/index.tsx @@ -98,7 +98,7 @@ const MentorshipPage = ({ mentorship }: MentorshipPageProps) => { buttonText={'Join as a mentor'} > Date: Sun, 24 May 2026 17:00:23 +0100 Subject: [PATCH 09/10] refactor: replace CSS selector with Playwright method --- playwright-tests/pages/mentorship.page.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright-tests/pages/mentorship.page.ts b/playwright-tests/pages/mentorship.page.ts index 4aada10f..77d042bf 100644 --- a/playwright-tests/pages/mentorship.page.ts +++ b/playwright-tests/pages/mentorship.page.ts @@ -65,7 +65,7 @@ export class MentorshipPage extends BasePage { level: 5, name: /You should become a mentee if you:/i, }); - this.menteeListItems = page.locator('ol[data-testid="mentee-card"] > li'); + this.menteeListItems = page.getByTestId('become-mentee-card').locator('li'); } getTestimonialCard(index: number): TestimonialCard { From ec691d4a6ae3cd6e16154872b9841dfe4d2af71d Mon Sep 17 00:00:00 2001 From: Joana Brito <140211258+joanaBrit@users.noreply.github.com> Date: Sun, 24 May 2026 17:16:58 +0100 Subject: [PATCH 10/10] Refactor: Replace manual page object creation with Playwright fixtures in becomeAMentee.page.spec.ts Co-authored-by: Eleonora Belova <65826199+nora-weisser@users.noreply.github.com> --- .../tests/becomeAMentee.page.spec.ts | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/playwright-tests/tests/becomeAMentee.page.spec.ts b/playwright-tests/tests/becomeAMentee.page.spec.ts index a8a24910..71d32bc0 100644 --- a/playwright-tests/tests/becomeAMentee.page.spec.ts +++ b/playwright-tests/tests/becomeAMentee.page.spec.ts @@ -4,18 +4,13 @@ import { HomePage } from '@pages/home.page'; import { MentorshipPage } from '@pages/mentorship.page'; test('Validate "Become a Mentee" section and Find a Mentor button', async ({ - page, + page, mentorshipPage, homePage }) => { // Navigate to Mentorship page await page.goto('/mentorship'); - // "Become a Mentee" section - const { sectionTitle, description, menteeListItems } = new MentorshipPage( - page, - ); - - await expect(sectionTitle).toBeVisible(); - await expect(description).toBeVisible(); + await expect(mentorshipPage.sectionTitle).toBeVisible(); + await expect(mentorshipPage.description).toBeVisible(); // List items const items = [ @@ -26,12 +21,8 @@ test('Validate "Become a Mentee" section and Find a Mentor button', async ({ 'Need support in advancing your career', ]; - await expect(menteeListItems).toHaveText(items); - - // Validate "Find a mentor" button - const { findMentorButton } = new HomePage(page); - await findMentorButton.click(); - - // Verify redirection + await expect(mentorshipPage.menteeListItems).toHaveText(items); + + await homePage.findMentorButton.click(); await expect(page).toHaveURL(/\/mentorship\/mentors/); });