diff --git a/tests/cypress/integration/actions_tasks_objects/case_29_settings_player_step.js b/tests/cypress/integration/actions_tasks_objects/case_29_settings_player_step.js new file mode 100644 index 000000000000..d8b3a10b0ae3 --- /dev/null +++ b/tests/cypress/integration/actions_tasks_objects/case_29_settings_player_step.js @@ -0,0 +1,59 @@ +// Copyright (C) 2020 Intel Corporation +// +// SPDX-License-Identifier: MIT + +/// + +import { taskName } from '../../support/const'; + +context('Settings "Player step"', () => { + const caseId = '29'; + const countJumpStep = 3; + let startFrame; + + before(() => { + cy.openTaskJob(taskName); + }); + + describe(`Testing case "${caseId}"`, () => { + it('Change player step ', () => { + cy.openSettings(); + cy.get('.cvat-settings-modal').within(() => { + cy.contains('Player').click(); + cy.get('.cvat-player-settings-step').within(() => { + cy.get('[role="spinbutton"]').clear().type(countJumpStep); + }); + }); + cy.closeSettings(); + + // get and save start frame + cy.get('.cvat-player-frame-selector').within(() => { + cy.get('[role="spinbutton"]') + .should('have.attr', 'aria-valuenow') + .then((valueFrameNow) => { + startFrame = Number(valueFrameNow); + }); + }); + }); + + it('Jump to forward frame via GUI', () => { + cy.get('.cvat-player-forward-button').click(); + cy.checkFrameNum(startFrame + countJumpStep); + }); + + it('Jump to backward frame via GUI', () => { + cy.get('.cvat-player-backward-button').click(); + cy.checkFrameNum(startFrame); + }); + + it('Jump to forward frame via shortcuts', () => { + cy.get('body').type('{v}'); + cy.checkFrameNum(startFrame + countJumpStep); + }); + + it('Jump to backward frame via shortcuts', () => { + cy.get('body').type('{c}'); + cy.checkFrameNum(startFrame); + }); + }); +}); diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index 10aa88f0d7b7..33e977971629 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -250,14 +250,15 @@ Cypress.Commands.add('createPolygon', (createPolygonParams) => { Cypress.Commands.add('openSettings', () => { cy.get('.cvat-right-header').find('.cvat-header-menu-dropdown').trigger('mouseover', { which: 1 }); cy.get('.anticon-setting').click(); + cy.get('.cvat-settings-modal').should('be.visible'); }); Cypress.Commands.add('closeSettings', () => { - cy.get('.ant-modal-content') - .should('contain', 'Settings') + cy.get('.cvat-settings-modal') .within(() => { cy.contains('button', 'Close').click(); }); + cy.get('.cvat-settings-modal').should('not.be.visible'); }); Cypress.Commands.add('changeWorkspace', (mode, labelName) => {