Skip to content

Commit

Permalink
eslint fixes #3
Browse files Browse the repository at this point in the history
  • Loading branch information
bsekachev committed Aug 29, 2023
1 parent cb7d7fb commit 6326345
Show file tree
Hide file tree
Showing 54 changed files with 233 additions and 185 deletions.
28 changes: 14 additions & 14 deletions tests/cypress/e2e/actions_tasks2/case_101_opencv_basic_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,8 @@ context('OpenCV. Intelligent scissors. Histogram Equalization. TrackerMIL.', ()
);
});
});
cy.get('.cvat-appearance-selected-opacity-slider')
.click('left')
.find('[role="slider"]')
cy.get('.cvat-appearance-selected-opacity-slider').click('left');
cy.get('.cvat-appearance-selected-opacity-slider').find('[role="slider"]')
.then((sliderSelectedOpacityLeft) => {
const sliderSelectedOpacityValuenow = sliderSelectedOpacityLeft.attr('aria-valuenow');
cy.get('.cvat_canvas_interact_intermediate_shape').should(
Expand All @@ -128,8 +127,8 @@ context('OpenCV. Intelligent scissors. Histogram Equalization. TrackerMIL.', ()
sliderSelectedOpacityValuenow / 100,
);
});
cy.get('.cvat-appearance-selected-opacity-slider').click('right');
cy.get('.cvat-appearance-selected-opacity-slider')
.click('right')
.find('[role="slider"]')
.then((sliderSelectedOpacityRight) => {
const sliderSelectedOpacityValuenow = sliderSelectedOpacityRight.attr('aria-valuenow');
Expand Down Expand Up @@ -166,34 +165,35 @@ context('OpenCV. Intelligent scissors. Histogram Equalization. TrackerMIL.', ()
it('Check "Histogram Equalization" feature.', () => {
cy.checkPopoverHidden('opencv-control');
cy.interactOpenCVControlButton();
cy.get('.cvat-opencv-control-popover')
.contains('[role="tab"]', 'Image')
.click()
cy.get('.cvat-opencv-control-popover').contains('[role="tab"]', 'Image').click();
cy.get('.cvat-opencv-control-popover').contains('[role="tab"]', 'Image')
.parents('.ant-tabs-tab')
.should('have.class', 'ant-tabs-tab-active');
cy.get('.cvat-opencv-image-tool').click();
cy.get('.cvat-opencv-image-tool').should('have.class', 'cvat-opencv-image-tool-active');
cy.get('.cvat-notification-notice-opencv-processing-error').should('not.exist');
cy.get('.cvat-opencv-image-tool').click();
cy.get('.cvat-opencv-image-tool').should('not.have.class', 'cvat-opencv-image-tool-active');
cy.get('.cvat-opencv-image-tool').trigger('mouseleave').trigger('mouseout');
cy.get('.cvat-opencv-image-tool').trigger('mouseleave');
cy.get('.cvat-opencv-image-tool').trigger('mouseout');
cy.get('.cvat-opencv-control').click();
});

// Waiting for fix https://github.com/openvinotoolkit/cvat/issues/3474
it.skip('Redraw the shape created with "Intelligent cissors".', () => {
cy.get('.cvat-canvas-container').click();
cy.get('.cvat-opencv-control-popover').should('be.hidden');
cy.get('#cvat_canvas_shape_1')
.trigger('mousemove')
.trigger('mouseover')
.should('have.class', 'cvat_canvas_shape_activated');
cy.get('body').trigger('keydown', { keyCode: keyCodeN, code: 'KeyN', shiftKey: true }).trigger('keyup');
cy.get('#cvat_canvas_shape_1').trigger('mousemove');
cy.get('#cvat_canvas_shape_1').trigger('mouseover');
cy.get('#cvat_canvas_shape_1').should('have.class', 'cvat_canvas_shape_activated');
cy.get('body').trigger('keydown', { keyCode: keyCodeN, code: 'KeyN', shiftKey: true });
cy.get('body').trigger('keyup');
cy.get('.cvat-opencv-control').should('have.attr', 'tabindex');
createOpencvShape.pointsMap.forEach((el) => {
cy.get('.cvat-canvas-container').click(el.x + 150, el.y + 50);
});
cy.get('body').trigger('keydown', { keyCode: keyCodeN, code: 'KeyN' }).trigger('keyup');
cy.get('body').trigger('keydown', { keyCode: keyCodeN, code: 'KeyN' });
cy.get('body').trigger('keyup');
});

it('Create a shape with "TrackerMIL". Track it for several frames.', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,10 @@ context('Settings. Text size/position. Text labels content.', () => {
cy.openSettings();

// Change the text size to 16
cy.get('.cvat-workspace-settings-text-size')
.find('input')
.should('have.attr', 'value', '14')
.clear()
.type('10')
.should('have.attr', 'value', '10');
cy.get('.cvat-workspace-settings-text-size').find('input').should('have.attr', 'value', '14');
cy.get('.cvat-workspace-settings-text-size').find('input').clear();
cy.get('.cvat-workspace-settings-text-size').find('input').type('10');
cy.get('.cvat-workspace-settings-text-size').find('input').should('have.attr', 'value', '10');
cy.closeSettings();
cy.get('.cvat_canvas_text').should('have.attr', 'style', 'font-size: 10px;');
});
Expand Down
23 changes: 11 additions & 12 deletions tests/cypress/e2e/actions_tasks2/case_21_canvas_color_feature.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,17 @@ context('Canvas color feature', () => {
.find('div[title]')
.then((colorPicker) => {
for (let i = 0; i < colorPicker.length; i++) {
cy.get(colorPicker[i])
.click()
.should('have.css', 'background-color')
.then((colorPickerBgValue) => {
cy.get('.cvat-canvas-grid-root')
.should('have.css', 'background-color')
.then((canvasBgColor) => {
// For each color change compare
// the value with the css value background-color of .cvat-canvas-grid-root
expect(colorPickerBgValue).to.be.equal(canvasBgColor);
});
});
cy.get(colorPicker[i]).click();
cy.get(colorPicker[i]).should('have.css', 'background-color');
cy.get(colorPicker[i]).then((colorPickerBgValue) => {
cy.get('.cvat-canvas-grid-root')
.should('have.css', 'background-color')
.then((canvasBgColor) => {
// For each color change compare
// the value with the css value background-color of .cvat-canvas-grid-root
expect(colorPickerBgValue).to.be.equal(canvasBgColor);
});
});
}
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ context('Canvas grid feature', () => {
});
it('Set "Grid size" to 50.', () => {
cy.get('.cvat-image-setups-grid-size-input').within(() => {
cy.get('[role="spinbutton"]').clear().type(settingsGridSize);
cy.get('[role="spinbutton"]').clear();
cy.get('[role="spinbutton"]').type(settingsGridSize);
});
});
it('Set "Grid color" to black.', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ context('Canvas brightness/contrast/saturation feature', () => {
cy.wrap($el)
.get($el)
.within(() => {
cy.get('[role=slider]')
.type(stringAction)
.should('have.attr', 'aria-valuenow', expectedResultInSetting);
cy.get('[role=slider]').type(stringAction);
cy.get('[role=slider]').should('have.attr', 'aria-valuenow', expectedResultInSetting);
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ context('Settings "Player step"', () => {
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.get('[role="spinbutton"]').clear();
cy.get('[role="spinbutton"]').type(countJumpStep);
});
});
cy.closeSettings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ context('Label constructor. Color label. Label name editing', () => {
});
cy.get('.cvat-change-task-label-color-button').click();
cy.changeColorViaBadge(labelColor.yellowHex);
cy.get('[placeholder="Label name"]').clear().type(colorYellow); // Check PR 2806
cy.get('[placeholder="Label name"]').clear();
cy.get('[placeholder="Label name"]').type(colorYellow); // Check PR 2806
cy.contains('button', 'Done').click();
});

Expand Down Expand Up @@ -149,7 +150,9 @@ context('Label constructor. Color label. Label name editing', () => {
.not('.ant-popover-hidden')
.should('be.visible')
.within(() => {
cy.contains('hex').prev().clear().type(labelColor.yellowHex);
cy.contains('hex').prev();
cy.contains('hex').clear();
cy.contains('hex').type(labelColor.yellowHex);
cy.contains('button', 'Cancel').click();
});
cy.get('.cvat-label-color-picker').should('be.hidden');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ context('Attribute annotation mode (AAM) zoom margin feature', () => {
cy.get('.cvat-settings-modal').within(() => {
cy.contains('Workspace').click();
cy.get('.cvat-workspace-settings-aam-zoom-margin').within(() => {
cy.get('[role="spinbutton"]').clear().type(valueZoomMargin);
cy.get('[role="spinbutton"]').clear();
cy.get('[role="spinbutton"]').type(valueZoomMargin);
});
});
cy.closeSettings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@ context('Changing a label name via label constructor.', () => {

it('Change label name to any other correct value. Press "Cancel". Label name is not changed.', () => {
cy.get('.cvat-constructor-viewer-item').find('[aria-label="edit"]').click();
cy.get('[placeholder="Label name"]').clear().type(secondLabelName);
cy.get('[placeholder="Label name"]').clear();
cy.get('[placeholder="Label name"]').type(secondLabelName);
cy.contains('[type="button"]', 'Cancel').click();
cy.get('.cvat-constructor-viewer-item').should('exist').and('have.text', firstLabelName);
});

it('Change label name to any other correct value. Press "Done". Label name changed.', () => {
cy.get('.cvat-constructor-viewer-item').find('[aria-label="edit"]').click();
cy.get('[placeholder="Label name"]').clear().type(secondLabelName);
cy.get('[placeholder="Label name"]').clear();
cy.get('[placeholder="Label name"]').type(secondLabelName);
cy.contains('[type="submit"]', 'Done').click();
cy.get('.cvat-constructor-viewer-item')
.should('exist')
Expand Down
15 changes: 6 additions & 9 deletions tests/cypress/e2e/actions_tasks2/case_97_export_import_task.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,12 @@ context('Export, import an annotation task.', { browser: '!firefox' }, () => {
cy.createRectangle(createRectangleShape2Points).then(() => {
Cypress.config('scrollBehavior', false);
});
cy.get('#cvat_canvas_shape_1')
.trigger('mousemove')
.trigger('mouseover')
.should('have.class', 'cvat_canvas_shape_activated');
cy.get('.svg_select_points_rot')
.should('be.visible')
.and('have.length', 1)
.trigger('mousemove')
.trigger('mouseover');
cy.get('#cvat_canvas_shape_1').trigger('mousemove');
cy.get('#cvat_canvas_shape_1').trigger('mouseover');
cy.get('#cvat_canvas_shape_1').should('have.class', 'cvat_canvas_shape_activated');
cy.get('.svg_select_points_rot').should('be.visible').and('have.length', 1);
cy.get('.svg_select_points_rot').trigger('mousemove');
cy.get('.svg_select_points_rot').trigger('mouseover');
cy.get('.svg_select_points_rot').trigger('mousedown', { button: 0 });
cy.get('.cvat-canvas-container').trigger('mousemove', 345, 150);
cy.get('.cvat-canvas-container').trigger('mouseup');
Expand Down
6 changes: 4 additions & 2 deletions tests/cypress/e2e/actions_tasks2/fit_image_different_res.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@ context('Correct behaviour of fit when navigating between frames with different
cy.openSettings();
if (resetZoom) {
cy.get('.cvat-player-settings-reset-zoom-checkbox').within(() => {
cy.get('[type="checkbox"]').check().should('be.checked');
cy.get('[type="checkbox"]').check();
cy.get('[type="checkbox"]').should('be.checked');
});
} else {
cy.get('.cvat-player-settings-reset-zoom-checkbox').within(() => {
cy.get('[type="checkbox"]').uncheck().should('not.be.checked');
cy.get('[type="checkbox"]').uncheck();
cy.get('[type="checkbox"]').should('not.be.checked');
});
}
cy.closeSettings();
Expand Down
28 changes: 14 additions & 14 deletions tests/cypress/e2e/actions_tasks3/case_105_cloud_storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,21 @@ context('Cloud storage.', () => {
});
// Check add/remove manifest file
cy.get('.cvat-add-manifest-button').should('be.visible').click();
cy.get('[placeholder="manifest.jsonl"]')
.should('exist')
.should('have.attr', 'value', '')
.type(dummyData.manifest)
.should('have.attr', 'value', dummyData.manifest);
cy.get('[placeholder="manifest.jsonl"]').should('exist').should('have.attr', 'value', '');
cy.get('[placeholder="manifest.jsonl"]').type(dummyData.manifest);
cy.get('[placeholder="manifest.jsonl"]').should('have.attr', 'value', dummyData.manifest);
cy.get('[data-icon="delete"]').should('be.visible').click();
cy.get('[placeholder="manifest.jsonl"]').should('not.exist');
});

it('Check "AWS S3" provider fields.', () => {
cy.get('#display_name')
.type(dummyData.display_name)
.should('have.attr', 'value', dummyData.display_name);
cy.get('#display_name').type(dummyData.display_name);
cy.get('#display_name').should('have.attr', 'value', dummyData.display_name);
cy.get('#provider_type').click();
cy.contains('.cvat-cloud-storage-select-provider', 'AWS').click();
cy.get('#resource')
.should('exist')
.type(dummyData.resource)
.should('have.attr', 'value', dummyData.resource);
cy.get('#resource').should('exist');
cy.get('#resource').type(dummyData.resource);
cy.get('#resource').should('have.attr', 'value', dummyData.resource);
// Check fields with "Key id and secret access key pair"
cy.get('#credentials_type').should('exist').click();
cy.get('.ant-select-dropdown')
Expand Down Expand Up @@ -133,8 +129,12 @@ context('Cloud storage.', () => {
.should('be.visible')
.click();
cy.get('.cvat-cloud-storage-form-item-key-file').should('not.exist');
cy.get('#prefix').should('exist').type(dummyData.prefix).should('have.value', dummyData.prefix);
cy.get('#project_id').should('exist').type(dummyData.projectID).should('have.value', dummyData.projectID);
cy.get('#prefix').should('exist');
cy.get('#prefix').type(dummyData.prefix);
cy.get('#prefix').should('have.value', dummyData.prefix);
cy.get('#project_id').should('exist');
cy.get('#project_id').type(dummyData.projectID);
cy.get('#project_id').should('have.value', dummyData.projectID);
cy.get('#location').should('exist').click();
cy.get('.ant-select-dropdown')
.not('.ant-select-dropdown-hidden')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ context('Connected file share.', () => {
for (let frame = 0; frame < imageFiles.images.length; frame++) {
cy.get(playerFilenameWrapper).should('have.text', `images/${imageFiles.images[frame]}`);
cy.checkFrameNum(frame);
cy.get('.cvat-player-next-button').click().trigger('mouseout');
cy.get('.cvat-player-next-button').click();
cy.get('.cvat-player-next-button').trigger('mouseout');
}
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ context('Dummy cloud storages.', { browser: '!firefox' }, () => {
}

function testGoToCSUpdatePage() {
cy.get('.cvat-cloud-storage-item-menu-button').trigger('mousemove').trigger('mouseover');
cy.get('.cvat-cloud-storage-item-menu-button').trigger('mousemove');
cy.get('.cvat-cloud-storage-item-menu-button').trigger('mouseover');
cy.get('.ant-dropdown')
.not('.ant-dropdown-hidden')
.within(() => {
Expand Down
6 changes: 4 additions & 2 deletions tests/cypress/e2e/actions_tasks3/case_118_multi_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ context('Create mutli tasks.', () => {
'https://raw.githubusercontent.com/cvat-ai/cvat/v1.2.0/cvat/apps/documentation/static/documentation/images/cvatt.jpg';

cy.contains('[role="tab"]', 'Remote sources').click();
cy.get('.cvat-file-selector-remote').clear().type(imageUrls);
cy.get('.cvat-file-selector-remote').clear();
cy.get('.cvat-file-selector-remote').type(imageUrls);

cy.get('.cvat-create-task-content-alert').should('be.visible');
cy.get('.cvat-create-task-content-footer [type="submit"]').should('be.disabled');
Expand Down Expand Up @@ -116,7 +117,8 @@ context('Create mutli tasks.', () => {

videoFiles.videos.forEach((video) => {
const URL = `${baseUrl}/${revision}/${folder}/videos/${video}`;
cy.get('.cvat-file-selector-remote').type(URL).type('{enter}');
cy.get('.cvat-file-selector-remote').type(URL);
cy.get('.cvat-file-selector-remote').type('{enter}');
});

submitTask();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ context('Rotate all images feature.', () => {
}

function imageRotate(direction = 'anticlockwise', deg) {
cy.get('.cvat-rotate-canvas-control').trigger('mouseover').should('be.visible');
cy.get('.cvat-rotate-canvas-control').trigger('mouseover');
cy.get('.cvat-rotate-canvas-control').should('be.visible');
if (direction === 'clockwise') {
cy.get('.cvat-rotate-canvas-controls-right').should('be.visible').click();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ context('Create a task with files from remote sources.', () => {
});

it('Set correct URL to remote file. The task is created.', () => {
cy.get('.cvat-file-selector-remote').clear().type(correctUrl);
cy.get('.cvat-file-selector-remote').clear();
cy.get('.cvat-file-selector-remote').type(correctUrl);
cy.contains('button', 'Submit & Continue').click();
cy.get('.cvat-notification-create-task-success').should('exist');
cy.goToTaskList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ context('Settings. "Player speed" option.', () => {
function changePlayerSpeed(speed) {
cy.openSettings();
cy.get('.cvat-player-settings-speed').within(() => {
cy.get('.cvat-player-settings-speed-select').click().wait(300); // Wait for the dropdown menu transition.
cy.get('.cvat-player-settings-speed-select').click();
cy.wait(300); // Wait for the dropdown menu transition.
});
cy.get(`.cvat-player-settings-speed-${speed}`).click();
cy.get('.cvat-player-settings-speed-select').should(
Expand Down
Loading

0 comments on commit 6326345

Please sign in to comment.