forked from Submitty/Submitty
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Testing:TAGrading] Download Zip File (Submitty#10694)
### Please check if the PR fulfills these requirements: Closes Submitty#10601 * [x] 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? <!-- List issue if it fixes/closes/implements one using the "Fixes #<number>" or "Closes #<number>" syntax --> When we download the zip file , the file name will be like this `assignementName_RCSID_version `and we do not want to exposed any kind of student details ### What is the new behavior? new file name - `grading_homework_hG1b13ljpDjKu32_v1.zip` (**assignementName_anonId_version**) And no test existed so added test for download zip file button **Concerned about should we need to test the content of zip file ?? Difficult to do that** ### Other information? <!-- Is this a breaking change? --> <!-- How did you test --> --------- Co-authored-by: Cameron Peterson <[email protected]> Co-authored-by: Barb Cutler <[email protected]>
- Loading branch information
1 parent
9533d69
commit 2c18347
Showing
4 changed files
with
18 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
site/cypress/e2e/Cypress-TAGrading/zip_file_download.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import path from 'path'; | ||
describe('download zip file', () => { | ||
const downloadsFolder = Cypress.config('downloadsFolder'); | ||
it('downloading and verifying the file', () => { | ||
cy.login(); | ||
cy.visit(['sample', 'gradeable', 'grading_homework', 'grading', 'grade?who_id=hG1b13ljpDjKu32&sort=id&direction=ASC']); | ||
cy.get('body').type('{A}'); | ||
cy.get('body').type('{O}'); // Solution/Notes | ||
cy.get('[data-testid="download-zip-file"]').should('contain', 'Download Zip File'); | ||
cy.get('[data-testid="download-zip-file"]').click(); | ||
const filename = path.join(downloadsFolder, 'grading_homework_hG1b13ljpDjKu32_v1.zip'); | ||
cy.readFile(filename); | ||
}); | ||
}); |