-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check UI does not crash if to activate an object while frame fetching #7873
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
// Copyright (C) 2024 CVAT.ai Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
/// <reference types="cypress" /> | ||
|
||
// import { taskName, labelName } from '../../support/const'; | ||
|
||
context('Regression tests', () => { | ||
let taskID = null; | ||
let jobID = null; | ||
|
||
const taskPayload = { | ||
name: 'Test annotations actions', | ||
labels: [{ | ||
name: 'label 1', | ||
attributes: [], | ||
type: 'any', | ||
}], | ||
project_id: null, | ||
source_storage: { location: 'local' }, | ||
target_storage: { location: 'local' }, | ||
}; | ||
|
||
const dataPayload = { | ||
server_files: ['archive.zip'], | ||
image_quality: 70, | ||
use_zip_chunks: true, | ||
use_cache: true, | ||
sorting_method: 'lexicographical', | ||
}; | ||
|
||
const createRectangleShape2Points = { | ||
points: 'By 2 Points', | ||
type: 'Shape', | ||
labelName: 'label 1', | ||
firstX: 250, | ||
firstY: 350, | ||
secondX: 350, | ||
secondY: 450, | ||
}; | ||
|
||
before(() => { | ||
cy.visit('auth/login'); | ||
cy.login(); | ||
}); | ||
|
||
describe('Regression tests', () => { | ||
it('UI does not crash if to activate an object while frame fetching', () => { | ||
cy.headlessCreateTask(taskPayload, dataPayload).then((response) => { | ||
taskID = response.taskID; | ||
[jobID] = response.jobIDs; | ||
|
||
cy.visit(`/tasks/${taskID}/jobs/${jobID}`); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That has to be in |
||
|
||
cy.get('.cvat-player-last-button').click(); | ||
cy.createRectangle(createRectangleShape2Points); | ||
cy.get('#cvat_canvas_shape_1').trigger('mousemove'); | ||
cy.get('#cvat_canvas_shape_1').should('have.class', 'cvat_canvas_shape_activated'); | ||
cy.saveJob(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also should be in Additionally I will recommend to create annotations using headless method. Now we do not have such cypress command, but it would be nice to create and use in the future. |
||
|
||
cy.reload(); | ||
cy.get('.cvat-player-last-button').click(); | ||
|
||
cy.intercept('GET', '/api/jobs/**/data?**', (req) => { | ||
req.continue((res) => { | ||
res.setDelay(3000); | ||
}); | ||
}).as('delayedRequest'); | ||
|
||
cy.get('#cvat_canvas_shape_1').trigger('mousemove'); | ||
cy.get('#cvat_canvas_shape_1').should('not.have.class', 'cvat_canvas_shape_activated'); | ||
|
||
cy.wait('@delayedRequest'); | ||
cy.get('#cvat_canvas_shape_1').trigger('mousemove'); | ||
cy.get('#cvat_canvas_shape_1').should('have.class', 'cvat_canvas_shape_activated'); | ||
}); | ||
}); | ||
}); | ||
|
||
after(() => { | ||
cy.logout(); | ||
cy.getAuthKey().then((response) => { | ||
const authKey = response.body.key; | ||
cy.request({ | ||
method: 'DELETE', | ||
url: `/api/tasks/${taskID}`, | ||
headers: { | ||
Authorization: `Token ${authKey}`, | ||
}, | ||
}); | ||
}); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.