Fix some tests for antd4. (#2552)

* Fix tests

* Some fix

Co-authored-by: Kruchinin <dmitryx.kruchinin@intel.com>
main
Dmitry Kruchinin 5 years ago committed by GitHub
parent 8ae83c7b02
commit 565020cce2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -78,10 +78,7 @@ context('Multiple users. Assign task, job.', () => {
});
it('Assign the task to the second user and logout', () => {
cy.openTask(taskName);
cy.get('.cvat-task-details').within(() => {
cy.get('.cvat-user-search-field').click({ force: true });
});
cy.contains(secondUserName).click();
cy.assignTaskToUser(secondUserName);
cy.logout();
});
it('Second user login. The task can be opened. Logout', () => {
@ -98,10 +95,7 @@ context('Multiple users. Assign task, job.', () => {
it('First user login and assign the job to the third user. Logout', () => {
cy.login();
cy.openTask(taskName);
cy.get('.cvat-task-job-list').within(() => {
cy.get('.cvat-job-assignee-selector').click({ force: true });
});
cy.contains(thirdUserName).click();
cy.assignJobToUser(thirdUserName);
cy.logout();
});
it('Third user login. The task can be opened.', () => {

@ -480,6 +480,18 @@ Cypress.Commands.add('assignTaskToUser', (user) => {
});
});
Cypress.Commands.add('assignJobToUser', (user) => {
cy.get('.cvat-task-job-list').within(() => {
cy.get('.cvat-job-assignee-selector').click().type(user);
cy.wait(300);
});
cy.get('.ant-select-dropdown')
.not('.ant-select-dropdown-hidden')
.within(() => {
cy.get(`.ant-select-item-option[title="${user}"]`).click();
});
});
Cypress.Commands.add('getScaleValue', () => {
cy.get('#cvat_canvas_background')
.should('have.attr', 'style')

@ -16,7 +16,7 @@ before(() => {
}
});
const resizeObserverLoopErrRe = /^ResizeObserver loop limit exceeded/;
const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/;
Cypress.on('uncaught:exception', (err) => {
if (resizeObserverLoopErrRe.test(err.message)) {
// the exception is generated by cypress in some browsers

Loading…
Cancel
Save