Skip to content

Commit

Permalink
Fixed missed keyup arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
bsekachev committed Nov 17, 2021
1 parent 71f2ee2 commit f74bc1e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ context('Object make a copy.', () => {
cy.get('body').type('{ctrl}', { release: false }); // Hold
cy.get('body')
.trigger('keydown', { keyCode: keyCodeC, code: 'KeyC', ctrlKey: true })
.trigger('keyup')
.trigger('keyup', { keyCode: keyCodeC, code: 'KeyC', ctrlKey: true })
.trigger('keydown', { keyCode: keyCodeV, code: 'KeyV', ctrlKey: true })
.trigger('keyup');
.trigger('keyup', { keyCode: keyCodeC, code: 'KeyC', ctrlKey: true });
cy.get('.cvat-canvas-container').click(400, 300);
cy.get('.cvat-canvas-container').click(500, 300);
cy.get('body').type('{ctrl}'); // Unhold
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ context('Redraw feature.', () => {
createPolygonShape.pointsMap.forEach((element) => {
cy.get('.cvat-canvas-container').click(element.x, element.y - 50);
});
cy.get('.cvat-canvas-container').trigger('keydown', { keyCode: keyCodeN, code: 'KeyN' }).trigger('keyup');
cy.get('.cvat-canvas-container').trigger('keydown', { keyCode: keyCodeN, code: 'KeyN' })
.trigger('keyup', { keyCode: keyCodeN, code: 'KeyN' });
cy.get('.cvat_canvas_shape').then(($shape) => {
expect($shape.length).to.be.equal(2);
});
Expand All @@ -104,7 +105,8 @@ context('Redraw feature.', () => {
createPolylinesShape.pointsMap.forEach((element) => {
cy.get('.cvat-canvas-container').click(element.x, element.y - 50);
});
cy.get('.cvat-canvas-container').trigger('keydown', { keyCode: keyCodeN, code: 'KeyN' }).trigger('keyup');
cy.get('.cvat-canvas-container').trigger('keydown', { keyCode: keyCodeN, code: 'KeyN' })
.trigger('keyup', { keyCode: keyCodeN, code: 'KeyN' });
cy.get('.cvat_canvas_shape').then(($shape) => {
expect($shape.length).to.be.equal(3);
});
Expand All @@ -120,7 +122,8 @@ context('Redraw feature.', () => {
createPointsShape.pointsMap.forEach((element) => {
cy.get('.cvat-canvas-container').click(element.x, element.y - 50);
});
cy.get('.cvat-canvas-container').trigger('keydown', { keyCode: keyCodeN, code: 'KeyN' }).trigger('keyup');
cy.get('.cvat-canvas-container').trigger('keydown', { keyCode: keyCodeN, code: 'KeyN' })
.trigger('keyup', { keyCode: keyCodeN, code: 'KeyN' });
cy.get('.cvat_canvas_shape').then(($shape) => {
expect($shape.length).to.be.equal(4);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ context('Repeat draw feature.', () => {
}

function repeatDrawningFinish() {
cy.get('.cvat-canvas-container').trigger('keydown', { keyCode: keyCodeN, code: 'KeyN' }).trigger('keyup');
cy.get('.cvat-canvas-container').trigger('keydown', { keyCode: keyCodeN, code: 'KeyN' })
.trigger('keyup', { keyCode: keyCodeN, code: 'KeyN' });
}

before(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ context('Autoborder feature.', () => {
cy.get('body').type('{Ctrl}'); // Autoborder activation
testAutoborderPointsCount(8); // 8 points at the rectangles
cy.get('.cvat-canvas-container').click(400, 350).click(450, 250).click(500, 350).click(500, 450);
cy.get('.cvat-canvas-container').trigger('keydown', { keyCode: keyCodeN, code: 'KeyN' }).trigger('keyup');
cy.get('.cvat-canvas-container').trigger('keydown', { keyCode: keyCodeN, code: 'KeyN' })
.trigger('keyup', { keyCode: keyCodeN, code: 'KeyN' });
cy.get('.cvat_canvas_autoborder_point').should('not.exist');

// Collect the polygon points coordinates
Expand All @@ -99,7 +100,8 @@ context('Autoborder feature.', () => {
.click(550, 500)
.click(600, 450)
.click(600, 350);
cy.get('.cvat-canvas-container').trigger('keydown', { keyCode: keyCodeN, code: 'KeyN' }).trigger('keyup');
cy.get('.cvat-canvas-container').trigger('keydown', { keyCode: keyCodeN, code: 'KeyN' })
.trigger('keyup', { keyCode: keyCodeN, code: 'KeyN' });
cy.get('.cvat_canvas_autoborder_point').should('not.exist');

// Collect the polygon points coordinates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ context('The points of the previous polygon mustn\'t appear while polygon\'s int
cy.get('#cvat_canvas_shape_1')
.trigger('mousemove', { force: true })
.trigger('keydown', { keyCode: keyCodeN, code: 'KeyN', shiftKey: true })
.trigger('keyup', { force: true }, { keyCode: keyCodeN, code: 'KeyN', shiftKey: true });
.trigger('keyup', {
force: true, keyCode: keyCodeN, code: 'KeyN', shiftKey: true
});
cy.createPolygon(reDrawPolygonTrack);
});
it('Activate auto bordering mode', () => {
Expand Down

0 comments on commit f74bc1e

Please sign in to comment.