Skip to content

[Testing:System] Cypress component testing for vue#12836

Merged
williamjallen merged 11 commits into
Submitty:mainfrom
jndlansh:cypress/component-testing
May 31, 2026
Merged

[Testing:System] Cypress component testing for vue#12836
williamjallen merged 11 commits into
Submitty:mainfrom
jndlansh:cypress/component-testing

Conversation

@jndlansh

@jndlansh jndlansh commented May 4, 2026

Copy link
Copy Markdown
Contributor

Why is this Change Important & Necessary?

Closes #10786

This PR introduces cypress component testing in the Submitty Codebase. This is particularly important to test the multiple vue components that have been introduced in the repo recently and for the ongoing migration process to VueJS.

First Component Test – Popup.vue:
Added 6 tests covering:

Visibility gating (component hidden when visible: false)
Props and slots rendering with correct title and content
Event emission on overlay click, header close button, and footer close button
Keyboard accessibility (Escape key toggles popup)
Variant mode (savable: true renders "Discard" and "Save" buttons)
Save action event emission

What is the New Behavior?

cypress.popup.mp4

What steps should a reviewer take to reproduce or test the bug or new feature?

cd site
npx cypress run --component
cd site
npx cypress open --component

Automated Testing & Documentation

  1. 6 test cases for Popup.vue
  2. CSS styling: Global Submitty styles load automatically in component mode
  3. Existing Jest tests and E2E Cypress tests unaffected
  4. Pattern established: cypress/component/Popup.cy.ts serves as reusable template

Other information

Breaking Changes: None. This PR is purely additive with no changes to existing components, tests and build processes.

@codecov

codecov Bot commented May 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 21.67%. Comparing base (d9c3f15) to head (74cb2f6).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##               main   #12836   +/-   ##
=========================================
  Coverage     21.67%   21.67%           
  Complexity     9802     9802           
=========================================
  Files           268      268           
  Lines         36724    36723    -1     
  Branches        489      489           
=========================================
  Hits           7960     7960           
+ Misses        28279    28278    -1     
  Partials        485      485           
Flag Coverage Δ
autograder 21.32% <ø> (ø)
js 2.02% <ø> (+<0.01%) ⬆️
migrator 100.00% <ø> (ø)
php 20.73% <ø> (ø)
python_submitty_utils 80.08% <ø> (ø)
submitty_daemon_jobs 91.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@williamjallen

Copy link
Copy Markdown
Member

@jndlansh Please see failing CI.

@jndlansh

Copy link
Copy Markdown
Contributor Author

Fixed CI checks that were failing

@williamjallen

Copy link
Copy Markdown
Member

@jndlansh Please see failing CI

@williamjallen williamjallen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please also add this as a new CI job.

@github-project-automation github-project-automation Bot moved this from Seeking Reviewer to Work in Progress in Submitty Development May 13, 2026
@jndlansh jndlansh changed the title [Testing:Vue] Cypress component testing for vue [Testing:System] Cypress component testing for vue May 13, 2026
@jndlansh

Copy link
Copy Markdown
Contributor Author

I have added the cypress component testing as a new CI job. Also changes the title's to submission from vue. I think that should work.

@williamjallen williamjallen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems reasonable to me. @IDzyre, would you mind taking a brief look at this?

@github-project-automation github-project-automation Bot moved this from Work in Progress to Awaiting Maintainer Review in Submitty Development May 17, 2026
@williamjallen

Copy link
Copy Markdown
Member

The rest of the Cypress CI jobs are failing for unrelated reasons.

@jndlansh

Copy link
Copy Markdown
Contributor Author

Thank you @williamjallen, when this PR gets merged, I will be able to add Cypress CT to other vue components as well. Meanwhile I will be looking as potential testcases for the same.

@IDzyre

IDzyre commented May 18, 2026

Copy link
Copy Markdown
Member

Question: Is there a reason this is using cypress in TS not JS like the rest of the codebase? If we could, I think we should be consistent. If there is another reason, I can be convinced otherwise.

@jndlansh

Copy link
Copy Markdown
Contributor Author

Hey @IDzyre!
I saw that Vue files and the other Vue components were already written in TS and were using lang="ts" in components.
So naturally I used TS for Cypress CT setup, I thought they would sync better.

I can use JS for CT if that is required and makes the codebase consistent

@IDzyre

IDzyre commented May 19, 2026

Copy link
Copy Markdown
Member

@williamjallen Do you have a preference here? I'd be partial to making it javascript if that is possible, to keep all cypress testing in the same language. If typescript is easier/more efficient/has a significant reason to lean that way, we can go that way.

@williamjallen

Copy link
Copy Markdown
Member

I agree with @IDzyre here, let's switch this to JS. In the future, we may want to switch everything to TS, but for now we should remain consistent.

@williamjallen williamjallen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See comments.

@github-project-automation github-project-automation Bot moved this from Awaiting Maintainer Review to Work in Progress in Submitty Development May 21, 2026
Comment thread site/cypress.config.ts
@jndlansh

Copy link
Copy Markdown
Contributor Author

Rest I have now shifted CT to JS. The popup.cy.js passes fine as before.

@jndlansh
jndlansh requested a review from williamjallen May 22, 2026 08:32
@automateprojectmangement automateprojectmangement Bot moved this from Work in Progress to In Review in Submitty Development May 22, 2026

@JManion32 JManion32 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I noticed this error when running the test in the CLI:

<<<CYPRESS.STDERR.START>>>Files in the public directory are served at the root path.
Instead of /public/css/colors.css, use /css/colors.css.
Files in the public directory are served at the root path.
Instead of /public/css/bootstrap.css, use /css/bootstrap.css.
Files in the public directory are served at the root path.
Instead of /public/css/server.css, use /css/server.css.
<<<CYPRESS.STDERR.END>>>

Can we adjust these paths?

@github-project-automation github-project-automation Bot moved this from In Review to Work in Progress in Submitty Development May 25, 2026
@jndlansh

Copy link
Copy Markdown
Contributor Author

It works when I use CSS link href="/css/server.css" in component-index.html.

It passes the test both ways, I did not get this error either way.

Shall I use the later method suggested @JManion32 ?

@JManion32

Copy link
Copy Markdown
Contributor

It works when I use CSS link href="/css/server.css" in component-index.html.

It passes the test both ways, I did not get this error either way.

Shall I use the later method suggested @JManion32 ?

Yes.

@williamjallen
williamjallen requested a review from JManion32 May 28, 2026 01:57
@automateprojectmangement automateprojectmangement Bot moved this from Work in Progress to In Review in Submitty Development May 28, 2026
@williamjallen
williamjallen merged commit 651617a into Submitty:main May 31, 2026
25 of 27 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in Submitty Development May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Cypress component testing for Vue components

4 participants