Skip to content
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

test(ui-cypress): add Cypress setup with TypeScript support for E2E and … #2315

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

hdinia
Copy link
Member

@hdinia hdinia commented Jan 24, 2025

  • Configure Cypress for React + TypeScript + Vite
  • Add support files for E2E and component testing
  • Set up proper type declarations for Cypress commands
  • Add ESLint rules for Cypress compatibility
  • Include basic test examples for studies page

@hdinia hdinia requested review from skamril and TheoPascoli January 24, 2025 16:50
@hdinia hdinia changed the title feat(ui-test): add Cypress setup with TypeScript support for E2E and … test(cypress): add Cypress setup with TypeScript support for E2E and … Jan 24, 2025
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only for testing the implementation, must be added to .gitignore

@hdinia hdinia force-pushed the setup-cypress branch 2 times, most recently from f6e655e to d494952 Compare January 27, 2025 08:06
@skamril skamril changed the title test(cypress): add Cypress setup with TypeScript support for E2E and … test(ui-cypress): add Cypress setup with TypeScript support for E2E and … Jan 27, 2025
webapp/cypress.config.ts Outdated Show resolved Hide resolved
webapp/cypress/.gitignore Outdated Show resolved Hide resolved
"extends": "../tsconfig.json",
"compilerOptions": {
"types": ["cypress", "@testing-library/cypress"],
"baseUrl": ".",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'baseUrl' and 'paths' are already in the extended config

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one overwrite the base config, it's intended

webapp/cypress/types/global.d.ts Outdated Show resolved Hide resolved
webapp/cypress/types/global.d.ts Outdated Show resolved Hide resolved
@@ -41,6 +42,7 @@ export default [
},
reactPlugin.configs.flat["jsx-runtime"],
jsdocPlugin.configs["flat/recommended-typescript"],
cypressPlugin.configs.recommended,
Copy link
Member

@skamril skamril Jan 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove cypressPlugin.configs.recommended and add in rules ...cypressPlugin.configs.recommended.rules.

Their recommended config is not valid for ESLint 9 (they use the old way to add plugin).

cf. https://github.com/cypress-io/eslint-plugin-cypress/blob/master/lib/config/recommended.js

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will check that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants