From 01b24a50aa1fe2c48a5aace2a4b70573bc926b71 Mon Sep 17 00:00:00 2001 From: weilirs <62249815+weilirs@users.noreply.github.com> Date: Wed, 6 Dec 2023 11:38:07 -0600 Subject: [PATCH] test(e2e,playwright): certification page improvement (#52476) --- e2e/certification.spec.ts | 44 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/e2e/certification.spec.ts b/e2e/certification.spec.ts index 1ae9d25a919..f82b516190c 100644 --- a/e2e/certification.spec.ts +++ b/e2e/certification.spec.ts @@ -112,6 +112,28 @@ test.describe('Certification page - Non Microsoft', () => { 'href', '/learn/2022/responsive-web-design/build-a-personal-portfolio-webpage-project/build-a-personal-portfolio-webpage' ); + + await expect( + page.getByText( + 'If you suspect that any of these projects violate the academic honesty policy, please report this to our team.' + ) + ).toBeVisible(); + + const policyLink = projectLinks.getByRole('link', { + name: 'academic honesty policy' + }); + await expect(policyLink).toHaveAttribute( + 'href', + 'https://www.freecodecamp.org/news/academic-honesty-policy/' + ); + + const reportLink = projectLinks.getByRole('link', { + name: 'report this to our team' + }); + await expect(reportLink).toHaveAttribute( + 'href', + '/user/certifieduser/report-user' + ); }); }); @@ -190,5 +212,27 @@ test.describe('Certification page - Microsoft', () => { 'href', '/learn/foundational-c-sharp-with-microsoft/foundational-c-sharp-with-microsoft-certification-exam/foundational-c-sharp-with-microsoft-certification-exam' ); + + await expect( + page.getByText( + 'If you suspect that any of these projects violate the academic honesty policy, please report this to our team.' + ) + ).toBeVisible(); + + const policyLink = projectLinks.getByRole('link', { + name: 'academic honesty policy' + }); + await expect(policyLink).toHaveAttribute( + 'href', + 'https://www.freecodecamp.org/news/academic-honesty-policy/' + ); + + const reportLink = projectLinks.getByRole('link', { + name: 'report this to our team' + }); + await expect(reportLink).toHaveAttribute( + 'href', + '/user/certifieduser/report-user' + ); }); });