-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Added tests for Requests
page
#8287
Conversation
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe recent updates introduce a comprehensive suite of end-to-end tests for the Requests page of the CVAT application, utilizing Cypress for automated validation of key functionalities such as task creation, error handling, and export processes. Additionally, modifications to the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- tests/cypress/e2e/features/requests_page.js (1 hunks)
- tests/cypress/support/commands.js (1 hunks)
Additional comments not posted (5)
tests/cypress/e2e/features/requests_page.js (4)
1-5
: File header and context block look good.The copyright and license information are correctly included, and the context block initializes necessary variables for the tests.
40-85
: Setup in thebefore
hook is well-structured.The setup process efficiently prepares the environment for testing by logging in, creating a project and task, and generating necessary files.
87-89
: Cleanup in theafter
hook is appropriate.Deleting the project after tests ensures that resources are cleaned up, maintaining test isolation.
91-153
: Test cases are comprehensive and well-structured.The test cases effectively verify task creation, error handling, and export processes on the Requests page, covering critical functionalities.
tests/cypress/support/commands.js (1)
1296-1298
: Modification todownloadExport
command is well-implemented.The addition of the
expectNotification
parameter enhances flexibility, allowing tests to conditionally verify notifications.
/check |
❌ Some checks failed |
Requests
pageRequests
page
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #8287 +/- ##
===========================================
- Coverage 83.34% 83.34% -0.01%
===========================================
Files 393 393
Lines 41579 41579
Branches 3843 3843
===========================================
- Hits 34655 34654 -1
- Misses 6924 6925 +1
|
cy.createProjects( | ||
project.name, | ||
project.label, | ||
project.attrName, | ||
project.attrVaue, | ||
project.multiAttrParams, | ||
project.advancedConfiguration, | ||
); | ||
cy.openProject(project.name); | ||
cy.url().then((url) => { | ||
data.projectID = Number(url.split('/').slice(-1)[0].split('?')[0]); | ||
|
||
const task = { | ||
name: taskName, | ||
label: mainLabelName, | ||
attrName, | ||
textDefaultValue: 'Requests attr', | ||
dataArchiveName: `${imageFileName}.zip`, | ||
multiAttrParams: false, | ||
forProject: true, | ||
attachToProject: true, | ||
projectName, | ||
}; | ||
cy.goToTaskList(); | ||
cy.createAnnotationTask( | ||
task.name, | ||
task.label, | ||
task.attrName, | ||
task.textDefaultValue, | ||
archiveName, | ||
task.multiAttrParams, | ||
null, | ||
task.forProject, | ||
task.attachToProject, | ||
task.projectName, | ||
); | ||
|
||
cy.goToTaskList(); | ||
cy.openTask(taskName); | ||
cy.url().then((taskUrl) => { | ||
data.taskID = Number(taskUrl.split('/').slice(-1)[0].split('?')[0]); | ||
cy.getJobIDFromIdx(0).then((jobID) => { | ||
cy.headlessCreateObjects([rectanglePayload], jobID); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
headlessCreateProject -> returns project ID
headlessCreateTask -> returns task ID and job ID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a problem #8297, which doesnt allow to test backups with file share created tasks/projects. Thats why we create them from local files
Quality Gate passedIssues Measures |
/check |
❌ Some checks failed |
/check |
✔️ All checks completed successfully |
Motivation and context
Tests for #8095
And for the problem with sumultaneous job exports crush
How has this been tested?
Checklist
develop
branch[ ] I have created a changelog fragment[ ] I have updated the documentation accordingly[ ] I have increased versions of npm packages if it is necessary(cvat-canvas,
cvat-core,
cvat-data and
cvat-ui)
License
Feel free to contact the maintainers if that's a concern.
Summary by CodeRabbit
New Features
downloadExport
command to accept a configuration object, allowing users to control notification verification during tests.Bug Fixes
Tests