Remove Cypress #52905
Labels
scope: tools/scripts
Scripts for supporting dev work, generating config and build artifacts, etc.
status: PR in works
Work in Progress (WIP) Issues.
Description
This issue to track the work needed for the Cypress removal.
Summary
We have added a significant amount of Playwright tests to the codebase, so I think we're in a good position to start removing Cypress.
I'd propose we proceed by going through each Cypress file and check if the test cases are written in Playwright. Add the tests in if they aren't.
Potential impediments
There is a significant discrepancy I've found and I'm afraid it might complicate the migration work. It's that Cypress has a
.task() API
that allows us to execute a Node command while Playwright doesn't. With this API, we can choose to work with new user data or certified user data in each test case, but we don't have this flexibility with Playwright.freeCodeCamp/cypress/e2e/default/top-contributor.ts
Line 3 in 0d123e0
freeCodeCamp/.github/workflows/e2e-playwright.yml
Line 132 in 0d123e0
IMHO, the ability to write tests with new user data is important, as we need to have test coverage for flows such as completing a new step/challenge, claiming a certifications, etc.
A couple approaches I have so far:
1.1 Mocking manually:
freeCodeCamp/e2e/email-sign-up.spec.ts
Lines 113 to 128 in 0d123e0
1.2 Using HAR files: https://playwright.dev/docs/mock#mocking-with-har-files
exec()
within Playwright tests when needed. Example: https://stackoverflow.com/questions/71397181/node-execute-command-asynchronously-and-read-results-on-completionseed
and one that runs withseed:certified-user
I'm still unsure which approach I prefer:
Action items
Setup a GHA workflow that runs Playwright test with
pnpm run seed
pnpm run seed
Add missing Playwright test cases
pnpm run seed
cypress/e2e/default/learn/challenges/projects.ts
in the Dev Notes section belowpnpm run seed
Migrate and remove Cypress test files
tags.js
legacy/redirects/adding-development.js
feat: convert adding development redirect tests to Playwright #54897landing.ts
feat(e2e): adding playwright and migrate landing page e2e tests #51216show-certification.ts
feat: convert "show certification" tests to Playwright #54899top-contributor.ts
feat: badges #54670learn/index.ts
feat(e2e): adding playwright e2e tests for /learn page #51276settings/certifications.ts
feat: convert academic honstey tests to Playwright #54855settings/email-change.ts
test: migrate email-change to playwright #55035settings/image-picture-check.ts
test(e2e): migrate image picture check tests to playwright #54273settings/portfolio.ts
feat: convert portfolio test to Playwright #54908settings/scrollbar-width.ts
feat: convert scrollbar test to playwright #54665settings/settings.ts
- test(e2e): add tests for the progress reset flow #54614settings/user-token.ts
feat: convert "user token" tests to Playwright #54939settings/username-change.ts
feat: improve username validation test #54634user/certifications.ts
feat: Convert "Certifications" spec to Playwright #54965user/privacy-terms.ts
feat: delete and rename "Quincy's email tests" already convered by Playwright #54941user/report-user.ts
feat: convert report user test to Playwright #54683legacy/redirects/challenges.ts
feat: convert all redirect tests to Playwright #55031learn/challenges/backend.ts
feat: convert backend test to Playwright #54641learn/challenges/c-sharp-exam.ts
feat: convert c-sharp exam tests to Playwright #54946learn/challenges/c-sharp.ts
feat: convert c-sharp test to playwright #54749learn/challenges/code-storage.ts
feat: convert code storage test to Playwright #54662learn/challenges/codeally.ts
feat: convert Codeally test to Playwright #54876learn/challenges/failed-updates.ts
feat: convert failed updates test to Playwright #54761learn/challenges/javascript.ts
learn/challenges/lower-jaw.ts
test(e2e,playwright):lower-jaw #52058learn/challenges/multifile-cert-project.ts
feat: convert "mutlifile cert projects" spec to Playwright #54994learn/challenges/multifile.ts
feat: convert multifile tests to Playwright #54833learn/challenges/navigation.ts
feat: convert "navigation tests spec" to Playwright #54944learn/challenges/output.ts
feat: signout helper function for Playwright #54747learn/challenges/progress-bar.ts
feat: convert progressbar test to Playwright #54636learn/challenges/project-preview.ts
- fix: delete already covered project preview test by Playwright #54676learn/challenges/projects.ts
- feat: convert projects to Playwright #54689learn/challenges/sass.ts
- feat: convert Sass test to Playwright test #54618learn/coding-interview-prep/intro-page.ts
- feat: convert intro page test to playwright #54620learn/common-components/editor.ts
feat: convert "editor spec" to Playwright #54970learn/common-components/footer.ts
test(e2e,playwright): Footer #51761learn/common-components/help-button.ts
feat(e2e,playwright):migrate common components help button tests #51628learn/common-components/navbar.ts
learn/common-components/search-bar.ts
learn/donate/donate-page-default.ts
test(e2e,playwright): donate.tsx #51768learn/donate/donate-page-donor.ts
feat: donate page donor tests to playwright #54857learn/donate/donation-block-completion-modal.ts
feat: convert "Donation Block Completion modal" tests to Playwright #54903learn/header/lang-selector.ts
test(e2e,playwright): Landing, Header #52104learn/header/universal-navigation.ts
feat: convert universal navigation test to Playwright #54873learn/redirects/breadcrumbs.ts
- fix: remove breadcrumb test from Cypress #54640learn/redirects/es6-to-basic-javascript.ts
feat: convert all redirect tests to Playwright #55031learn/redirects/heading-challenge.ts
feat: convert all redirect tests to Playwright #55031learn/responsive-web-design/intro-page.ts
feat: convert intro page rwd to Playwright #54666learn/responsive-web-design/show-cert-from-superblock.ts
feat: convert show cert from superblock tests to Playwright #54836learn/responsive-web-design/basic-css/index.ts
feat: convert basic css tests to Playwright #54856mobile-learn/test-challenges.js
third-party/donate-page.ts
Remove Cypress
cypress
folderdata-cy
remaining in the codebaseThe text was updated successfully, but these errors were encountered: