diff --git a/tests/cypress/integration/actions_tasks_objects/case_23_canvas_grid_feature.js b/tests/cypress/integration/actions_tasks_objects/case_23_canvas_grid_feature.js index 9b50f8be..907df914 100644 --- a/tests/cypress/integration/actions_tasks_objects/case_23_canvas_grid_feature.js +++ b/tests/cypress/integration/actions_tasks_objects/case_23_canvas_grid_feature.js @@ -12,6 +12,14 @@ context('Canvas grid feature', () => { const gridColor = 'Black'; const gridOpacity = 80; + function generateString(countPointsToMove) { + let action = ''; + for (let i = 0; i < countPointsToMove; i++) { + action += '{leftarrow}'; + } + return action; + } + before(() => { cy.openTaskJob(taskName); }); @@ -37,9 +45,7 @@ context('Canvas grid feature', () => { }); it('Set "Grid opacity" to 80%.', () => { cy.get('.cvat-player-settings-grid-opacity-input').within(() => { - for (let i = 0; i < 20; i++) { - cy.get('[role="slider"]').type('{leftarrow}'); // Moving the slider to the left up to 80. - } + cy.get('[role="slider"]').type(generateString(20)); // Moving the slider to the left up to 80. cy.get('[role="slider"]').should('have.attr', 'aria-valuenow', gridOpacity); }); });