Skip to content

Commit c7125a8

Browse files
authored
Tried to fix one test (#5212)
* Tried to fix one test * Fixed linter issues & cypress commands
1 parent f62aa27 commit c7125a8

File tree

5 files changed

+24
-23
lines changed

5 files changed

+24
-23
lines changed

cvat-ui/src/components/annotation-page/top-bar/filters-modal.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ function FiltersModalComponent(): JSX.Element {
261261
visible={visible}
262262
closable={false}
263263
width={800}
264+
destroyOnClose
264265
centered
265266
onCancel={() => dispatch(showFilters(false))}
266267
footer={[

tests/cypress/integration/actions_objects/case_36_always_show_object_details_feature.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ context('Always show object details feature', () => {
1111
const rectangleShape2Points = {
1212
points: 'By 2 Points',
1313
type: 'Shape',
14-
labelName: labelName,
14+
labelName,
1515
firstX: 400,
1616
firstY: 100,
1717
secondX: 500,
@@ -20,7 +20,7 @@ context('Always show object details feature', () => {
2020
const polygonTrack = {
2121
reDraw: false,
2222
type: 'Track',
23-
labelName: labelName,
23+
labelName,
2424
pointsMap: [
2525
{ x: 400, y: 300 },
2626
{ x: 500, y: 300 },

tests/cypress/integration/actions_tasks3/case_19_all_image_rotate_features.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ import { taskName } from '../../support/const';
99
context('Rotate all images feature.', () => {
1010
const caseId = '19';
1111

12+
function checkDegRotate(deg) {
13+
cy.get('#cvat_canvas_background').should('have.attr', 'style').and('contain', `rotate(${deg}deg);`);
14+
}
15+
1216
function imageRotate(direction = 'anticlockwise', deg) {
1317
cy.get('.cvat-rotate-canvas-control').trigger('mouseover');
1418
if (direction === 'clockwise') {
@@ -19,10 +23,6 @@ context('Rotate all images feature.', () => {
1923
checkDegRotate(deg);
2024
}
2125

22-
function checkDegRotate(deg) {
23-
cy.get('#cvat_canvas_background').should('have.attr', 'style').and('contain', `rotate(${deg}deg);`);
24-
}
25-
2626
function checkFrameNum(frameNum) {
2727
cy.get('.cvat-player-frame-selector').within(() => {
2828
cy.get('input[role="spinbutton"]').should('have.value', frameNum);
@@ -40,7 +40,7 @@ context('Rotate all images feature.', () => {
4040
imageRotate('anticlockwise', 270);
4141
});
4242

43-
it("Go to the next frame. It wasn't rotated.", () => {
43+
it('Go to the next frame. It wasn\'t rotated.', () => {
4444
cy.get('.cvat-player-next-button').click();
4545
checkFrameNum(1);
4646
checkDegRotate(0);

tests/cypress/integration/issues_prs2/issue_1439_blocked_object_info.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ context('Information about a blocked object disappears if hover the cursor over
1111
const createRectangleShape2Points = {
1212
points: 'By 2 Points',
1313
type: 'Shape',
14-
labelName: labelName,
14+
labelName,
1515
firstX: 250,
1616
firstY: 350,
1717
secondX: 350,
@@ -20,7 +20,7 @@ context('Information about a blocked object disappears if hover the cursor over
2020
const createRectangleShape2PointsSecond = {
2121
points: 'By 2 Points',
2222
type: 'Shape',
23-
labelName: labelName,
23+
labelName,
2424
firstX: createRectangleShape2Points.firstX,
2525
firstY: createRectangleShape2Points.firstY - 150,
2626
secondX: createRectangleShape2Points.secondX,

tests/cypress/support/commands_filters_feature.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Cypress.Commands.add('сheckFiltersModalOpened', () => {
1414
});
1515

1616
Cypress.Commands.add('collectGroupID', () => {
17-
let groupDataID = [];
17+
const groupDataID = [];
1818
cy.get('.group').then(($group) => {
1919
for (let i = 0; i < $group.length; i++) {
2020
groupDataID.push($group[i].dataset.id);
@@ -24,7 +24,7 @@ Cypress.Commands.add('collectGroupID', () => {
2424
});
2525

2626
Cypress.Commands.add('collectRuleID', () => {
27-
let ruleDataID = [];
27+
const ruleDataID = [];
2828
cy.get('.rule').then(($rule) => {
2929
for (let i = 0; i < $rule.length; i++) {
3030
ruleDataID.push($rule[i].dataset.id);
@@ -37,7 +37,7 @@ Cypress.Commands.add('clearFilters', () => {
3737
cy.сheckFiltersModalOpened();
3838
cy.contains('button', 'Clear filters').click();
3939
cy.get('.cvat-filters-modal-visible').should('not.exist');
40-
cy.get('.cvat-filters-modal').should('be.hidden');
40+
cy.get('.cvat-filters-modal').should('not.exist');
4141
});
4242

4343
Cypress.Commands.add('addFiltersGroup', (groupIndex) => {
@@ -66,7 +66,9 @@ Cypress.Commands.add('setGroupCondition', (groupIndex, condition) => {
6666

6767
Cypress.Commands.add(
6868
'setFilter',
69-
({ groupIndex, ruleIndex, field, operator, valueSource, value, label, labelAttr, submit }) => {
69+
({
70+
groupIndex, ruleIndex, field, operator, valueSource, value, label, labelAttr, submit,
71+
}) => {
7072
cy.сheckFiltersModalOpened();
7173
cy.collectGroupID().then((groupIdIndex) => {
7274
cy.collectRuleID().then((ruleIdIndex) => {
@@ -104,16 +106,14 @@ Cypress.Commands.add(
104106
.within(() => {
105107
if (field === 'Attributes') {
106108
cy.get('[placeholder="Enter string"]').last().type(`${value}{Enter}`);
107-
} else {
108-
if (!valueSource) {
109-
if (field === 'ObjectID' || field === 'Width' || field === 'Height') {
110-
cy.get('[placeholder="Enter number"]').type(`${value}{Enter}`);
111-
} else {
112-
cy.get('[type="search"]').last().type(`${value}{Enter}`);
113-
}
109+
} else if (!valueSource) {
110+
if (field === 'ObjectID' || field === 'Width' || field === 'Height') {
111+
cy.get('[placeholder="Enter number"]').type(`${value}{Enter}`);
114112
} else {
115-
cy.contains('[type="button"]', 'Select field ').click();
113+
cy.get('[type="search"]').last().type(`${value}{Enter}`);
116114
}
115+
} else {
116+
cy.contains('[type="button"]', 'Select field ').click();
117117
}
118118
});
119119
if (valueSource) {
@@ -124,7 +124,7 @@ Cypress.Commands.add(
124124
cy.contains('button', 'Submit').click();
125125
});
126126
cy.get('.cvat-filters-modal-visible').should('not.exist');
127-
cy.get('.cvat-filters-modal').should('be.hidden');
127+
cy.get('.cvat-filters-modal').should('not.exist');
128128
}
129129
});
130130
});
@@ -143,5 +143,5 @@ Cypress.Commands.add('selectFilterValue', (filterValue) => {
143143
cy.contains('button', 'Submit').click();
144144
});
145145
cy.get('.cvat-filters-modal-visible').should('not.exist');
146-
cy.get('.cvat-filters-modal').should('be.hidden');
146+
cy.get('.cvat-filters-modal').should('not.exist');
147147
});

0 commit comments

Comments
 (0)