Merge branch 'develop' of https://github.com/openvinotoolkit/cvat into dkru/cypress-test-issue-2485-2

main
Kruchinin 5 years ago
commit 0ad297504f

@ -33,7 +33,7 @@
}
.cvat-tag-annotation-sidebar-buttons,
.cvat-tag-anntation-sidebar-checkbox-skip-frame {
.cvat-tag-annotation-sidebar-checkbox-skip-frame {
padding-bottom: 15px;
}

@ -227,7 +227,7 @@ function TagAnnotationSidebar(props: StateToProps & DispatchToProps): JSX.Elemen
<Button onClick={onChangeFrame}>Skip frame</Button>
</Col>
</Row>
<Row type='flex' className='cvat-tag-anntation-sidebar-checkbox-skip-frame'>
<Row type='flex' className='cvat-tag-annotation-sidebar-checkbox-skip-frame'>
<Col>
<Checkbox
checked={skipFrame}
@ -239,11 +239,12 @@ function TagAnnotationSidebar(props: StateToProps & DispatchToProps): JSX.Elemen
</Checkbox>
</Col>
</Row>
<Row type='flex' justify='start'>
<Row type='flex' justify='start' className='cvat-tag-annotation-sidebar-frame-tags'>
<Col>
<Text strong>Frame tags:&nbsp;</Text>
{frameTags.map((tag: any) => (
<Tag
className={'cvat-tag-annotation-sidebar-frame-tag-label'}
color={tag.label.color}
onClose={() => {
onRemoveState(tag);

@ -0,0 +1,80 @@
// Copyright (C) 2020 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
import { taskName, labelName } from '../../support/const';
context('Tag annotation mode.', () => {
const caseId = '22';
function checkCountFrameTags(countTags) {
if (countTags == 0) {
cy.get('span.cvat-tag-annotation-sidebar-frame-tag-label').should('not.exist');
} else {
cy.get('span.cvat-tag-annotation-sidebar-frame-tag-label').should('have.length', countTags);
};
};
function checkPresenceFrameTags(labelName) {
cy.get('.cvat-tag-annotation-sidebar-frame-tags').within(() => {
cy.get('span.cvat-tag-annotation-sidebar-frame-tag-label').contains(labelName).should('exist');
});
};
function addTag() {
cy.get('.cvat-tag-annotation-sidebar-buttons').contains('Add tag').click();
};
function skipFrame() {
cy.get('.cvat-tag-annotation-sidebar-buttons').contains('Skip frame').click();
};
function changeCheckboxAutomaticallyGoToNextFrame(value) {
cy.get('.cvat-tag-annotation-sidebar-checkbox-skip-frame').within(() => {
if (value == "check") {
cy.get('[type="checkbox"]').check();
} else if (value == "uncheck") {
cy.get('[type="checkbox"]').uncheck();
};
});
};
before(() => {
cy.openTaskJob(taskName);
});
describe(`Testing case "${caseId}"`, () => {
it('Go to tag annotation', () => {
cy.changeWorkspace('Tag annotation', labelName);
checkCountFrameTags(0);
});
it('Skip frame', () => {
skipFrame();
cy.checkFrameNum(1);
checkCountFrameTags(0);
cy.goToPreviousFrame(0);
checkCountFrameTags(0);
});
it('Add tag', () => {
addTag();
checkCountFrameTags(1);
checkPresenceFrameTags(labelName);
});
it('Set "Automatically go to the next frame" to true and add tag', () => {
cy.goToNextFrame(1);
checkCountFrameTags(0);
changeCheckboxAutomaticallyGoToNextFrame("check");
addTag();
cy.checkFrameNum(2);
checkCountFrameTags(0);
cy.goToPreviousFrame(1);
checkCountFrameTags(1);
checkPresenceFrameTags(labelName);
});
});
});

@ -497,8 +497,18 @@ Cypress.Commands.add('goCheckFrameNumber', (frameNum) => {
});
});
Cypress.Commands.add('checkFrameNumber', (frameNum) => {
Cypress.Commands.add('checkFrameNum', (frameNum) => {
cy.get('.cvat-player-frame-selector').within(() => {
cy.get('[role="spinbutton"]').should('have.value', frameNum);
cy.get('input[role="spinbutton"]').should('have.value', frameNum);
});
});
Cypress.Commands.add('goToNextFrame', (expectedFrameNum) => {
cy.get('.cvat-player-next-button').click();
cy.checkFrameNum(expectedFrameNum);
});
Cypress.Commands.add('goToPreviousFrame', (expectedFrameNum) => {
cy.get('.cvat-player-previous-button').click();
cy.checkFrameNum(expectedFrameNum);
});

Loading…
Cancel
Save