From 3e0ab4db05225b22c6ec489f01776e9cc5829a02 Mon Sep 17 00:00:00 2001 From: Oleg Valiulin Date: Tue, 17 Dec 2024 16:46:37 +0000 Subject: [PATCH 01/15] drafting a cypress test on issue #8785 --- ...perties_of_undefined_reading_getUpdated.js | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js diff --git a/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js b/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js new file mode 100644 index 000000000000..0323db9ebf07 --- /dev/null +++ b/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js @@ -0,0 +1,45 @@ +// Copyright (C) 2024 CVAT.ai Corporation +// +// SPDX-License-Identifier: MIT + +/// + +import { taskName } from '../../support/const'; + +context('When saving after deleting a frame, job metadata is inconsistent.', () => { + const issueId = '8785'; + + before(() => { + cy.openTaskJob(taskName); + cy.goToNextFrame(4); + }); + + describe(`Testing issue ${issueId}`, () => { + it('Crash on Save job. Save again.', () => { + cy.deleteFrame(); // FIXME: does normal saving with 200, better to just push a button + + // Check that frame is deleted + cy.contains('button', 'Restore').should('be.visible'); + + /** + * FIXME: this just asserts 502 + * + * Here you have an example job endpoint response stubbing + * Response is then intercepted and stubbed with 502 status code + * + * flow is like this: press a button directly + intercept + * + * Cypress works worse with double intercepts + * Intercepting saveJob not gonna work + * since it already does an intercept of the same request + * + * */ + + // Send bad PATCH + cy.saveJob('PATCH', 502); + + // Send again + cy.saveJob('PATCH', 200); + }); + }); +}); From 577bb060be85335e58d45d930cf59e116a02aea4 Mon Sep 17 00:00:00 2001 From: Oleg Valiulin Date: Wed, 18 Dec 2024 14:23:10 +0000 Subject: [PATCH 02/15] add middleware --- ...perties_of_undefined_reading_getUpdated.js | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js b/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js index 0323db9ebf07..ed4536492a00 100644 --- a/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js +++ b/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js @@ -16,7 +16,35 @@ context('When saving after deleting a frame, job metadata is inconsistent.', () describe(`Testing issue ${issueId}`, () => { it('Crash on Save job. Save again.', () => { - cy.deleteFrame(); // FIXME: does normal saving with 200, better to just push a button + // cy.deleteFrame(); // FIXME: does normal saving with 200, better to just push a button + function clickDelete() { + cy.get('.cvat-player-delete-frame').click(); + cy.get('.cvat-modal-delete-frame').within(() => { + cy.contains('button', 'Delete').click(); + }); + } + function clickSave() { + cy.get('button').contains('Save').click({ force: true }); + cy.get('button').contains('Save').trigger('mouseout'); + } + function middleware(request, response) { + let calls = 0; + const responseStub = { statusCode: 502, body: 'Network error' }; + function handle(req, res) { + if (calls === 0) { + calls++; + res.send(responseStub); + } else { + req.continue(); + } + } + handle(request, response); + } + cy.intercept('PATCH', '/api/jobs/**/data/meta**', middleware); + clickDelete(); + clickSave(); + + cy.wait('@patchMeta'); // Check that frame is deleted cy.contains('button', 'Restore').should('be.visible'); From f45e810b9e402f9c5ef5f78d215deae574727c61 Mon Sep 17 00:00:00 2001 From: Oleg Valiulin Date: Wed, 18 Dec 2024 17:18:09 +0000 Subject: [PATCH 03/15] fix closure, draft test --- ...perties_of_undefined_reading_getUpdated.js | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js b/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js index ed4536492a00..d52ffa9d79ca 100644 --- a/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js +++ b/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js @@ -27,27 +27,31 @@ context('When saving after deleting a frame, job metadata is inconsistent.', () cy.get('button').contains('Save').click({ force: true }); cy.get('button').contains('Save').trigger('mouseout'); } - function middleware(request, response) { + function middleware() { let calls = 0; - const responseStub = { statusCode: 502, body: 'Network error' }; + const badResponseStub = { statusCode: 502, body: 'Network error' }; function handle(req, res) { if (calls === 0) { + console.log(calls); calls++; - res.send(responseStub); + res.send(badResponseStub); } else { - req.continue(); + console.log(calls); + req.continue({ statusCode: 200, body: 'OK' }); } } - handle(request, response); + return handle; } - cy.intercept('PATCH', '/api/jobs/**/data/meta**', middleware); + cy.intercept('PATCH', '/api/jobs/**/data/meta**', middleware()).as('patchMeta'); clickDelete(); clickSave(); + cy.contains('button', 'Restore').should('be.visible'); + cy.wait('@patchMeta').its('response.body').should('eq', 502); + cy.wait('@patchMeta').its('response.body').should('eq', 200); - cy.wait('@patchMeta'); + // TODO: refactor saveJob with necessary status // Check that frame is deleted - cy.contains('button', 'Restore').should('be.visible'); /** * FIXME: this just asserts 502 From 351a81ad6d5d2b42b52494edf78421b2d04e7330 Mon Sep 17 00:00:00 2001 From: Oleg Valiulin Date: Thu, 19 Dec 2024 11:40:10 +0000 Subject: [PATCH 04/15] wip --- ...perties_of_undefined_reading_getUpdated.js | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js b/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js index d52ffa9d79ca..60d7ee01d2f3 100644 --- a/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js +++ b/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js @@ -27,29 +27,26 @@ context('When saving after deleting a frame, job metadata is inconsistent.', () cy.get('button').contains('Save').click({ force: true }); cy.get('button').contains('Save').trigger('mouseout'); } + const badStatusCode = 502; function middleware() { + const badResponseStub = { statusCode: badStatusCode, body: 'Network error' }; let calls = 0; - const badResponseStub = { statusCode: 502, body: 'Network error' }; function handle(req, res) { if (calls === 0) { - console.log(calls); calls++; res.send(badResponseStub); } else { - console.log(calls); - req.continue({ statusCode: 200, body: 'OK' }); + req.continue(); } } return handle; } cy.intercept('PATCH', '/api/jobs/**/data/meta**', middleware()).as('patchMeta'); clickDelete(); - clickSave(); cy.contains('button', 'Restore').should('be.visible'); - cy.wait('@patchMeta').its('response.body').should('eq', 502); - cy.wait('@patchMeta').its('response.body').should('eq', 200); - - // TODO: refactor saveJob with necessary status + clickSave(); + cy.wait('@patchMeta').its('response.status').should('eq', badStatusCode); + cy.wait('@patchMeta').its('response.status').should('eq', 200); // Check that frame is deleted @@ -66,12 +63,6 @@ context('When saving after deleting a frame, job metadata is inconsistent.', () * since it already does an intercept of the same request * * */ - - // Send bad PATCH - cy.saveJob('PATCH', 502); - - // Send again - cy.saveJob('PATCH', 200); }); }); }); From 2741805317bb88b21303c7f56d8af7d183d3d153 Mon Sep 17 00:00:00 2001 From: Oleg Valiulin Date: Fri, 20 Dec 2024 16:30:31 +0000 Subject: [PATCH 05/15] save job and validate error --- ...perties_of_undefined_reading_getUpdated.js | 83 +++++++++++-------- 1 file changed, 47 insertions(+), 36 deletions(-) diff --git a/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js b/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js index 60d7ee01d2f3..47e576d3d4b4 100644 --- a/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js +++ b/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js @@ -9,60 +9,71 @@ import { taskName } from '../../support/const'; context('When saving after deleting a frame, job metadata is inconsistent.', () => { const issueId = '8785'; + function checkDeletedFrameVisibility() { + cy.openSettings(); + cy.get('.cvat-workspace-settings-show-deleted').within(() => { + cy.get('[type="checkbox"]').should('not.be.checked').check(); + }); + cy.closeSettings(); + } + function clickDelete() { + cy.get('.cvat-player-delete-frame').click(); + cy.get('.cvat-modal-delete-frame').within(() => { + cy.contains('button', 'Delete').click(); + }); + } + function clickSave() { + cy.get('button').contains('Save').click({ force: true }); + cy.get('button').contains('Save').trigger('mouseout'); + } + before(() => { + checkDeletedFrameVisibility(); cy.openTaskJob(taskName); - cy.goToNextFrame(4); + cy.goToNextFrame(1); }); describe(`Testing issue ${issueId}`, () => { it('Crash on Save job. Save again.', () => { - // cy.deleteFrame(); // FIXME: does normal saving with 200, better to just push a button - function clickDelete() { - cy.get('.cvat-player-delete-frame').click(); - cy.get('.cvat-modal-delete-frame').within(() => { - cy.contains('button', 'Delete').click(); - }); - } - function clickSave() { - cy.get('button').contains('Save').click({ force: true }); - cy.get('button').contains('Save').trigger('mouseout'); - } - const badStatusCode = 502; - function middleware() { - const badResponseStub = { statusCode: badStatusCode, body: 'Network error' }; + const badResponse = { statusCode: 502, body: 'A horrible network error' }; + + cy.on('uncaught:exception', (err) => { + expect(err.message).to.include(badResponse.body); + expect(err.code).to.equal(badResponse.statusCode); + return false; + }); + + function createHandler() { let calls = 0; - function handle(req, res) { + function handle(req) { if (calls === 0) { calls++; - res.send(badResponseStub); + req.continue((res) => { + res.send(badResponse); + }); } else { req.continue(); } } return handle; } - cy.intercept('PATCH', '/api/jobs/**/data/meta**', middleware()).as('patchMeta'); + + const routeMatcher = { + url: '/api/jobs/**/data/meta**', + method: 'PATCH', + times: 1, // cancels the intercept + }; + const routeHandler = createHandler(); + + cy.intercept(routeMatcher, routeHandler).as('patchError'); + clickDelete(); - cy.contains('button', 'Restore').should('be.visible'); - clickSave(); - cy.wait('@patchMeta').its('response.status').should('eq', badStatusCode); - cy.wait('@patchMeta').its('response.status').should('eq', 200); + cy.get('.cvat-player-restore-frame').should('be.visible'); - // Check that frame is deleted + clickSave(); + cy.wait('@patchError').its('response.statusCode').should('eq', badResponse.statusCode); - /** - * FIXME: this just asserts 502 - * - * Here you have an example job endpoint response stubbing - * Response is then intercepted and stubbed with 502 status code - * - * flow is like this: press a button directly + intercept - * - * Cypress works worse with double intercepts - * Intercepting saveJob not gonna work - * since it already does an intercept of the same request - * - * */ + cy.saveJob(); }); }); }); From 3099ab45e42ab5cb22a5bab1dc0c1941b459decb Mon Sep 17 00:00:00 2001 From: Oleg Valiulin Date: Fri, 20 Dec 2024 16:59:36 +0000 Subject: [PATCH 06/15] add more venv folders --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c375c7df4e7e..320ed7a050c7 100644 --- a/.gitignore +++ b/.gitignore @@ -49,8 +49,9 @@ yarn-error.log* # Ignore all the installed packages node_modules -venv/ +venv*/ .venv/ +.env/ # Ignore all js dists cvat-data/dist From b0de39c5f024590bb00b1044f3b9bb2f961f9074 Mon Sep 17 00:00:00 2001 From: Oleg Valiulin Date: Mon, 23 Dec 2024 12:02:04 +0000 Subject: [PATCH 07/15] stub response without handler, check response --- ...perties_of_undefined_reading_getUpdated.js | 30 +++++-------------- tests/cypress/support/utils_interceptors.js | 14 +++++++++ 2 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 tests/cypress/support/utils_interceptors.js diff --git a/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js b/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js index 47e576d3d4b4..90bc0d3e9cb5 100644 --- a/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js +++ b/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js @@ -38,42 +38,28 @@ context('When saving after deleting a frame, job metadata is inconsistent.', () const badResponse = { statusCode: 502, body: 'A horrible network error' }; cy.on('uncaught:exception', (err) => { - expect(err.message).to.include(badResponse.body); expect(err.code).to.equal(badResponse.statusCode); return false; - }); - - function createHandler() { - let calls = 0; - function handle(req) { - if (calls === 0) { - calls++; - req.continue((res) => { - res.send(badResponse); - }); - } else { - req.continue(); - } - } - return handle; - } + }); // On 502, Cypres always triggers a Node exception const routeMatcher = { url: '/api/jobs/**/data/meta**', method: 'PATCH', - times: 1, // cancels the intercept + times: 1, // cancels the intercept without retries }; - const routeHandler = createHandler(); - cy.intercept(routeMatcher, routeHandler).as('patchError'); + cy.intercept(routeMatcher, badResponse).as('patchError'); clickDelete(); cy.get('.cvat-player-restore-frame').should('be.visible'); clickSave(); - cy.wait('@patchError').its('response.statusCode').should('eq', badResponse.statusCode); + cy.wait('@patchError').then((intercept) => { + expect(intercept.response.body).to.equal(badResponse.body); + expect(intercept.response.statusCode).to.equal(badResponse.statusCode); + }); - cy.saveJob(); + cy.saveJob('PATCH', 200); }); }); }); diff --git a/tests/cypress/support/utils_interceptors.js b/tests/cypress/support/utils_interceptors.js new file mode 100644 index 000000000000..7fde928539e9 --- /dev/null +++ b/tests/cypress/support/utils_interceptors.js @@ -0,0 +1,14 @@ +export function stubResponseUntilCalledNtimes(response, ntimes = 1) { + let calls = 0; + function handle(req) { + if (calls === ntimes) { + calls++; + req.continue((res) => { + res.send(response); + }); + } else { + req.continue(); + } + } + return handle; +} From 5d67f16590415f9023a45325929dd6081ad8c565 Mon Sep 17 00:00:00 2001 From: Oleg Valiulin Date: Mon, 23 Dec 2024 12:46:35 +0000 Subject: [PATCH 08/15] removve useless function --- tests/cypress/support/utils_interceptors.js | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 tests/cypress/support/utils_interceptors.js diff --git a/tests/cypress/support/utils_interceptors.js b/tests/cypress/support/utils_interceptors.js deleted file mode 100644 index 7fde928539e9..000000000000 --- a/tests/cypress/support/utils_interceptors.js +++ /dev/null @@ -1,14 +0,0 @@ -export function stubResponseUntilCalledNtimes(response, ntimes = 1) { - let calls = 0; - function handle(req) { - if (calls === ntimes) { - calls++; - req.continue((res) => { - res.send(response); - }); - } else { - req.continue(); - } - } - return handle; -} From 2b599a53b004f25debb2139e42fa292b820978fc Mon Sep 17 00:00:00 2001 From: Oleg Valiulin Date: Mon, 23 Dec 2024 16:02:15 +0000 Subject: [PATCH 09/15] rename function Co-authored-by: Andrey Zhavoronkov --- ...85_Cannot_read_properties_of_undefined_reading_getUpdated.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js b/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js index 90bc0d3e9cb5..feb6a921a770 100644 --- a/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js +++ b/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js @@ -16,7 +16,7 @@ context('When saving after deleting a frame, job metadata is inconsistent.', () }); cy.closeSettings(); } - function clickDelete() { + function clickDeleteFrame() { cy.get('.cvat-player-delete-frame').click(); cy.get('.cvat-modal-delete-frame').within(() => { cy.contains('button', 'Delete').click(); From 120ef97957cbbf2f112d9018cd5aeb540c8aa300 Mon Sep 17 00:00:00 2001 From: Oleg Valiulin Date: Mon, 23 Dec 2024 17:42:46 +0000 Subject: [PATCH 10/15] move /.*env* lower to package section, add *venv*/ for Python packages --- .gitignore | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 320ed7a050c7..2c5deb225eae 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ /share/ /static/ /db.sqlite3 -/.*env* /keys /logs /profiles @@ -49,9 +48,8 @@ yarn-error.log* # Ignore all the installed packages node_modules -venv*/ -.venv/ -.env/ +/*env*/ +/.*env* # Ignore all js dists cvat-data/dist From 31eab5c2286c4d5d0f59ed3498318271fad65940 Mon Sep 17 00:00:00 2001 From: Oleg Valiulin Date: Mon, 23 Dec 2024 17:57:19 +0000 Subject: [PATCH 11/15] rename deleteFrame function, rename ctx, add assertion on response body --- ...nnot_read_properties_of_undefined_reading_getUpdated.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js b/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js index feb6a921a770..9ecc0427903d 100644 --- a/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js +++ b/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js @@ -6,7 +6,7 @@ import { taskName } from '../../support/const'; -context('When saving after deleting a frame, job metadata is inconsistent.', () => { +context('The UI remains stable even when the metadata request fails.', () => { const issueId = '8785'; function checkDeletedFrameVisibility() { @@ -39,8 +39,9 @@ context('When saving after deleting a frame, job metadata is inconsistent.', () cy.on('uncaught:exception', (err) => { expect(err.code).to.equal(badResponse.statusCode); + expect(err.message).to.include(`> ${badResponse.body}`); return false; - }); // On 502, Cypres always triggers a Node exception + }); const routeMatcher = { url: '/api/jobs/**/data/meta**', @@ -50,7 +51,7 @@ context('When saving after deleting a frame, job metadata is inconsistent.', () cy.intercept(routeMatcher, badResponse).as('patchError'); - clickDelete(); + clickDeleteFrame(); cy.get('.cvat-player-restore-frame').should('be.visible'); clickSave(); From b90538c290dc2b55d586df433825800846198190 Mon Sep 17 00:00:00 2001 From: Oleg Valiulin Date: Mon, 23 Dec 2024 18:05:38 +0000 Subject: [PATCH 12/15] factored out checking of 'Delete frames' checkbox into a support cmd, ran both tests ok --- tests/cypress/e2e/actions_objects2/case_delete_frame.js | 6 +----- ...ot_read_properties_of_undefined_reading_getUpdated.js | 9 +-------- tests/cypress/support/commands.js | 8 ++++++++ 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/tests/cypress/e2e/actions_objects2/case_delete_frame.js b/tests/cypress/e2e/actions_objects2/case_delete_frame.js index 393fbc17b207..2e8c21170e01 100644 --- a/tests/cypress/e2e/actions_objects2/case_delete_frame.js +++ b/tests/cypress/e2e/actions_objects2/case_delete_frame.js @@ -41,11 +41,7 @@ context('Delete frame from job.', () => { }); it('Change deleted frame visability.', () => { - cy.openSettings(); - cy.get('.cvat-workspace-settings-show-deleted').within(() => { - cy.get('[type="checkbox"]').should('not.be.checked').check(); - }); - cy.closeSettings(); + cy.checkDeletedFrameVisibility(); }); it('Check previous frame available and deleted.', () => { diff --git a/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js b/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js index 9ecc0427903d..b3398ff97ba2 100644 --- a/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js +++ b/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js @@ -9,13 +9,6 @@ import { taskName } from '../../support/const'; context('The UI remains stable even when the metadata request fails.', () => { const issueId = '8785'; - function checkDeletedFrameVisibility() { - cy.openSettings(); - cy.get('.cvat-workspace-settings-show-deleted').within(() => { - cy.get('[type="checkbox"]').should('not.be.checked').check(); - }); - cy.closeSettings(); - } function clickDeleteFrame() { cy.get('.cvat-player-delete-frame').click(); cy.get('.cvat-modal-delete-frame').within(() => { @@ -28,7 +21,7 @@ context('The UI remains stable even when the metadata request fails.', () => { } before(() => { - checkDeletedFrameVisibility(); + cy.checkDeletedFrameVisibility(); cy.openTaskJob(taskName); cy.goToNextFrame(1); }); diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index 9941a9b0d5c3..42b7d2772375 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -1683,6 +1683,14 @@ Cypress.Commands.add('hideTooltips', () => { }); }); +Cypress.Commands.add('checkDeletedFrameVisibility', () => { + cy.openSettings(); + cy.get('.cvat-workspace-settings-show-deleted').within(() => { + cy.get('[type="checkbox"]').should('not.be.checked').check(); + }); + cy.closeSettings(); +}); + Cypress.Commands.overwrite('visit', (orig, url, options) => { orig(url, options); cy.closeModalUnsupportedPlatform(); From adfe7559655f21059bf5fb35ac0b7bb3bb45a368 Mon Sep 17 00:00:00 2001 From: Oleg Valiulin Date: Mon, 23 Dec 2024 18:10:18 +0000 Subject: [PATCH 13/15] renam issue_8785 test file --- ...ed_reading_getUpdated.js => issue_8785_update_job_metadata.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/cypress/e2e/issues_prs2/{issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js => issue_8785_update_job_metadata.js} (100%) diff --git a/tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js b/tests/cypress/e2e/issues_prs2/issue_8785_update_job_metadata.js similarity index 100% rename from tests/cypress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.js rename to tests/cypress/e2e/issues_prs2/issue_8785_update_job_metadata.js From a1bd735ae5fb24a6ab10cebacaca9d9b955e2f13 Mon Sep 17 00:00:00 2001 From: Oleg Valiulin Date: Mon, 23 Dec 2024 18:16:58 +0000 Subject: [PATCH 14/15] spelling error in unit name --- tests/cypress/e2e/actions_objects2/case_delete_frame.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cypress/e2e/actions_objects2/case_delete_frame.js b/tests/cypress/e2e/actions_objects2/case_delete_frame.js index 2e8c21170e01..c0b3b34a0c99 100644 --- a/tests/cypress/e2e/actions_objects2/case_delete_frame.js +++ b/tests/cypress/e2e/actions_objects2/case_delete_frame.js @@ -40,7 +40,7 @@ context('Delete frame from job.', () => { cy.checkFrameNum(frame + 1); }); - it('Change deleted frame visability.', () => { + it('Change deleted frame visibility.', () => { cy.checkDeletedFrameVisibility(); }); From 27920f75aadf3c7c2dec79780814ab8dece574db Mon Sep 17 00:00:00 2001 From: Oleg Valiulin Date: Wed, 25 Dec 2024 10:38:26 +0000 Subject: [PATCH 15/15] remove extra symbols from assertion Co-authored-by: Kirill Lakhov --- tests/cypress/e2e/issues_prs2/issue_8785_update_job_metadata.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cypress/e2e/issues_prs2/issue_8785_update_job_metadata.js b/tests/cypress/e2e/issues_prs2/issue_8785_update_job_metadata.js index b3398ff97ba2..f34d3417c577 100644 --- a/tests/cypress/e2e/issues_prs2/issue_8785_update_job_metadata.js +++ b/tests/cypress/e2e/issues_prs2/issue_8785_update_job_metadata.js @@ -32,7 +32,7 @@ context('The UI remains stable even when the metadata request fails.', () => { cy.on('uncaught:exception', (err) => { expect(err.code).to.equal(badResponse.statusCode); - expect(err.message).to.include(`> ${badResponse.body}`); + expect(err.message).to.include(badResponse.body); return false; });