Skip to content

[Testing:InstructorUI] Added Cypress test for locked gradeable#11364

Merged
bmcutler merged 33 commits into
Submitty:mainfrom
subCode321:add-cypress-feature
Jun 2, 2025
Merged

[Testing:InstructorUI] Added Cypress test for locked gradeable#11364
bmcutler merged 33 commits into
Submitty:mainfrom
subCode321:add-cypress-feature

Conversation

@subCode321

@subCode321 subCode321 commented Jan 25, 2025

Copy link
Copy Markdown
Contributor

added a cypress test for checking appropriate message to be displayed upon clicking a locked gradeable.

Please check if the PR fulfills these requirements:

  • Tests for the changes have been added/updated (if possible)
  • Documentation has been updated/added if relevant
  • Screenshots are attached to Github PR if visual/UI changes were made

What is the current behavior?

There was no way to test the alert on clicking on a locked gradeable.

What is the new behavior?

Fixes #11160
Cypress tests and matches the appropriate message to be displayed for the locked gradeable upon being clicked.

Other information?

added a cypress test for checking appropriate message to be displayed upon clicking a locked gradeable.
@codecov

codecov Bot commented Jan 25, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 22.12%. Comparing base (b62b721) to head (a6996a6).
Report is 28 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main   #11364      +/-   ##
============================================
+ Coverage     22.10%   22.12%   +0.01%     
- Complexity     8947     8949       +2     
============================================
  Files           247      247              
  Lines         32235    32243       +8     
  Branches         83       83              
============================================
+ Hits           7125     7133       +8     
  Misses        25031    25031              
  Partials         79       79              
Flag Coverage Δ
autograder 21.60% <ø> (ø)
js 27.17% <ø> (ø)
migrator 100.00% <ø> (ø)
php 19.12% <ø> (+0.02%) ⬆️
python_submitty_utils 80.08% <ø> (ø)
submitty_daemon_jobs 88.88% <ø> (ø)

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.

fixed minor lint issues
removed data-testid from input values.
the excessive query calls were causing the cypress UI test to fail
had commented out the previous tests
changed gradeableid
@subCode321

Copy link
Copy Markdown
Contributor Author

@williamschen23 , sorry for pinging on weekend, but I just wanted to know if there's any procedure for debugging site errors in Cypress as they have very little information to check and debug. Is there any forum in Zulip where I can ask?

Comment thread site/app/templates/admin/admin_gradeable/AdminGradeableAuto.twig Outdated
Comment thread site/cypress/e2e/Cypress-UI/navigation_page.spec.js Outdated
used data test id for gradeable-lock and also changed test gradeable to cypress test gradeable.
removed arbitrary waiting time
removed subscript from cypress_test_gradeable

@williamschen23 williamschen23 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.

For me, I would rather make a new gradeable in the course config that has a lock on another gradeable. Creating a gradeable comes with verifying that the creation of gradeable works, which was already done in another test

I will defer the review to @IDzyre

@IDzyre

IDzyre commented Jan 28, 2025

Copy link
Copy Markdown
Member

Do we not already have a gradeable that is 'locked' ? The sample course is (i think) supposed to have examples for instructors to follow when it comes to different types of gradeables. I would be in favor of having another gradeable created with the setup_sample_course script, if there is not already one made.

@williamschen23

Copy link
Copy Markdown
Contributor

There are team-locked gradeables, none of them are for pre-requisite gradeables. I also don't see the field in courses.yml, so we might need to add that...

@subCode321

Copy link
Copy Markdown
Contributor Author

There are team-locked gradeables, none of them are for pre-requisite gradeables. I also don't see the field in courses.yml, so we might need to add that...

I have done that. Added two locked gradeables using the sample.yml file
image

@subCode321

Copy link
Copy Markdown
Contributor Author

Do we not already have a gradeable that is 'locked' ? The sample course is (i think) supposed to have examples for instructors to follow when it comes to different types of gradeables. I would be in favor of having another gradeable created with the setup_sample_course script, if there is not already one made.

done.

@subCode321

Copy link
Copy Markdown
Contributor Author

For me, I would rather make a new gradeable in the course config that has a lock on another gradeable. Creating a gradeable comes with verifying that the creation of gradeable works, which was already done in another test

I will defer the review to @IDzyre

Now, the cypress testing is done on the existing locked gradeables, for all 3 levels.

@subCode321

Copy link
Copy Markdown
Contributor Author

@williamschen23 , sorry for pinging. I made the changes you had requested for (i.e to create a locked gradeable using the script). However, the creation of one extra course is causing the metrics of other courses to change, due to which the cypress tests are failing. Could you guide me further on how to proceed with fixing these tests?

@williamschen23

Copy link
Copy Markdown
Contributor

@williamschen23 , sorry for pinging. I made the changes you had requested for (i.e to create a locked gradeable using the script). However, the creation of one extra course is causing the metrics of other courses to change, due to which the cypress tests are failing. Could you guide me further on how to proceed with fixing these tests?

This is all based off of memory, but doing
recreate_sample_courses --test_only_grading
rebuilds the courses and you can see where the error is. The cypress tests will be under npx cypress open and you can run them to see what happens. Pretty sure for that test, you can only run it once.
In addition, can you add the field to courses.yml? I think that the file is for all possible options, but feel free to correct me if I'm wrong.

@github-actions github-actions Bot added the Abandoned PR - Needs New Owner No activity on PR for more than 2 weeks -- seeking new owner to complete label Feb 19, 2025
@subCode321

Copy link
Copy Markdown
Contributor Author

Hey, I'm working on this. Will update today

@subCode321

Copy link
Copy Markdown
Contributor Author

@williamschen23 I've updated the PR but unable to repro this one last test failure. Would need your help in understanding the root cause involved here

@JManion32 JManion32 removed the Abandoned PR - Needs New Owner No activity on PR for more than 2 weeks -- seeking new owner to complete label Jun 2, 2025

@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 ran recreate_sample_courses and verified that the new Cypress test works correctly.

image

@github-project-automation github-project-automation Bot moved this from In Review to Awaiting Maintainer Review in Submitty Development Jun 2, 2025
@bmcutler
bmcutler merged commit 1c49edb into Submitty:main Jun 2, 2025
@github-project-automation github-project-automation Bot moved this from Awaiting Maintainer Review to Done in Submitty Development Jun 2, 2025
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.

New Sample Course for Locked Gradeable

5 participants