Skip to content

Commit

Permalink
Added test for not showing ground truth annotations in standard view (#…
Browse files Browse the repository at this point in the history
…8742)

<!-- Raise an issue to propose your change
(https://github.com/cvat-ai/cvat/issues).
It helps to avoid duplication of efforts from multiple independent
contributors.
Discuss your ideas with maintainers to be sure that changes will be
approved and merged.
Read the [Contribution guide](https://docs.cvat.ai/docs/contributing/).
-->

<!-- Provide a general summary of your changes in the Title above -->

### Motivation and context
<!-- Why is this change required? What problem does it solve? If it
fixes an open
issue, please link to the issue here. Describe your changes in detail,
add
screenshots. -->
Test for #8675

### How has this been tested?
<!-- Please describe in detail how you tested your changes.
Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc. -->

### Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply.
If an item isn't applicable for some reason, then ~~explicitly
strikethrough~~ the whole
line. If you don't do that, GitHub will show incorrect progress for the
pull request.
If you're unsure about any of these, don't hesitate to ask. We're here
to help! -->
- [x] I submit my changes into the `develop` branch
- ~~[ ] I have created a changelog fragment <!-- see top comment in
CHANGELOG.md -->~~
- ~~[ ] I have updated the documentation accordingly~~
- [x] I have added tests to cover my changes
- ~~[ ] I have linked related issues (see [GitHub docs](

https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword))~~
- ~~[ ] I have increased versions of npm packages if it is necessary

([cvat-canvas](https://github.com/cvat-ai/cvat/tree/develop/cvat-canvas#versioning),

[cvat-core](https://github.com/cvat-ai/cvat/tree/develop/cvat-core#versioning),

[cvat-data](https://github.com/cvat-ai/cvat/tree/develop/cvat-data#versioning)
and

[cvat-ui](https://github.com/cvat-ai/cvat/tree/develop/cvat-ui#versioning))~~

### License

- [x] I submit _my code changes_ under the same [MIT License](
https://github.com/cvat-ai/cvat/blob/develop/LICENSE) that covers the
project.
  Feel free to contact the maintainers if that's a concern.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
- Improved test reliability by changing the test setup to run before
each test case.

- **New Features**
- Added a test case to ensure ground truth annotations are not visible
in the standard annotation view after creation.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
klakhov authored Nov 27, 2024
1 parent edef764 commit 4f7391d
Showing 1 changed file with 47 additions and 1 deletion.
48 changes: 47 additions & 1 deletion tests/cypress/e2e/features/ground_truth_jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ context('Ground truth jobs', () => {
describe('Regression tests', () => {
const serverFiles = ['bigArchive.zip'];

before(() => {
beforeEach(() => {
createAndOpenTask(serverFiles);
});

Expand Down Expand Up @@ -400,5 +400,51 @@ context('Ground truth jobs', () => {
jobID = Number(url.split('/').slice(-1)[0].split('?')[0]);
}).should('match', /\/tasks\/\d+\/jobs\/\d+/);
});

it('Check GT annotations can not be shown in standard annotation view', () => {
cy.headlessCreateJob({
task_id: taskID,
frame_count: 4,
type: 'ground_truth',
frame_selection_method: 'random_uniform',
seed: 1,
}).then((jobResponse) => {
groundTruthJobID = jobResponse.jobID;
return cy.headlessCreateObjects(groundTruthFrames.map((frame, index) => {
const gtRect = groundTruthRectangles[index];
return {
labelName,
objectType: 'shape',
shapeType: 'rectangle',
occluded: false,
frame,
points: [gtRect.firstX, gtRect.firstY, gtRect.secondX, gtRect.secondY],
};
}), groundTruthJobID);
}).then(() => {
cy.visit(`/tasks/${taskID}/jobs/${jobID}`);
cy.get('.cvat-canvas-container').should('exist');

cy.changeWorkspace('Review');
cy.get('.cvat-objects-sidebar-show-ground-truth').click();
cy.get('.cvat-objects-sidebar-show-ground-truth').should(
'have.class', 'cvat-objects-sidebar-show-ground-truth-active',
);
groundTruthFrames.forEach((frame, index) => {
cy.goCheckFrameNumber(frame);
checkRectangleAndObjectMenu(groundTruthRectangles[index]);
});

cy.interactMenu('Open the task');
cy.get('.cvat-task-job-list').within(() => {
cy.contains('a', `Job #${jobID}`).click();
});
groundTruthFrames.forEach((frame) => {
cy.goCheckFrameNumber(frame);
cy.get('.cvat_canvas_shape').should('not.exist');
cy.get('.cvat-objects-sidebar-state-item').should('not.exist');
});
});
});
});
});

0 comments on commit 4f7391d

Please sign in to comment.