Skip to content

Commit

Permalink
move interception to rcommand, for better encapsulation
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Valiulin committed Feb 3, 2025
1 parent 52c2a98 commit 2f67c7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,7 @@ context('Create any track, check if track works correctly after deleting some fr
});

beforeEach(() => {
// Restore all frames by patching deleted_frames to []
cy.intercept('PATCH', '/api/jobs/**/data/meta**').as('patchMeta');
cy.headlessRestoreAllFrames(jobID);
cy.wait('@patchMeta');

// Get job meta updates from the server and reload page to bring changes to UI
cy.reload();
Expand Down
2 changes: 2 additions & 0 deletions tests/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,14 @@ Cypress.Commands.add('headlessRemoveAnnotations', (jobID) => {
});

Cypress.Commands.add('headlessRestoreAllFrames', (jobID) => {
cy.intercept('PATCH', '/api/jobs/**/data/meta**').as('patchMeta');
cy.window().then(async ($win) => {
await $win.cvat.server.request(`/api/jobs/${jobID}/data/meta`, {
method: 'PATCH',
data: { deleted_frames: [] },
});
});
cy.wait('@patchMeta');
});

Cypress.Commands.add('headlessGetJobMeta', (jobID) => {
Expand Down

0 comments on commit 2f67c7c

Please sign in to comment.