New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Cypress #52905
Comments
Thanks for tracking this. 1: No thank you 🙂 For 3, we might even have 3 directories:
|
I agree that 3) is the way to go for now. In the future we can seed multiple users and login to whichever user is appropriate for the test, but that's a little way off. |
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
e2e
directory to facilitate the CI changepnpm 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
landing.ts
show-certification.ts
top-contributor.ts
feat: badges #54670learn/index.ts
settings/certifications.ts
settings/email-change.ts
settings/image-picture-check.ts
settings/portfolio.ts
settings/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
settings/username-change.ts
- feat: improve username validation test #54634user/certifications.ts
user/privacy-terms.ts
user/report-user.ts
feat: convert report user test to Playwright #54683legacy/redirects/challenges.ts
learn/challenges/backend.ts
feat: convert backend test to Playwright #54641learn/challenges/c-sharp-exam.ts
learn/challenges/c-sharp.ts
learn/challenges/code-storage.ts
feat: convert code storage test to Playwright #54662learn/challenges/codeally.ts
learn/challenges/failed-updates.ts
learn/challenges/javascript.ts
learn/challenges/lower-jaw.ts
learn/challenges/multifile-cert-project.ts
learn/challenges/multifile.ts
learn/challenges/navigation.ts
learn/challenges/output.ts
learn/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
learn/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
learn/common-components/footer.ts
learn/common-components/help-button.ts
learn/common-components/navbar.ts
learn/common-components/search-bar.ts
learn/donate/donate-page-default.ts
learn/donate/donate-page-donor.ts
learn/donate/donation-block-completion-modal.ts
learn/header/lang-selector.ts
learn/header/universal-navigation.ts
learn/redirects/breadcrumbs.ts
- fix: remove breadcrumb test from Cypress #54640learn/redirects/es6-to-basic-javascript.ts
learn/redirects/heading-challenge.ts
learn/responsive-web-design/intro-page.ts
feat: convert intro page rwd to Playwright #54666learn/responsive-web-design/show-cert-from-superblock.ts
learn/responsive-web-design/basic-css/index.ts
mobile-learn/test-challenges.js
third-party/donate-page.ts
Remove Cypress
cypress
directoryDev notes
Development notes
cypress/e2e/default/learn/responsive-web-design/show-cert-from-superblock.ts
freeCodeCamp/e2e/settings.spec.ts
Line 369 in cedc365
freeCodeCamp/e2e/settings.spec.ts
Line 395 in cedc365
seed
instead ofseed:certified-user
cypress/e2e/default/learn/challenges/projects.ts
main
while they shouldn't, as one of thedata-cy
they need to work with doesn't existfreeCodeCamp/cypress/e2e/default/learn/challenges/projects.ts
Line 157 in e0027b1
cypress/e2e/default/settings/certifications.ts
seed
instead ofseed:certified-user
.The text was updated successfully, but these errors were encountered: