diff --git a/cypress/e2e/list/list-view-kanban.spec.ts b/cypress/e2e/list/list-view-kanban.spec.ts index ffa4cca9a..52b4db2ea 100644 --- a/cypress/e2e/list/list-view-kanban.spec.ts +++ b/cypress/e2e/list/list-view-kanban.spec.ts @@ -38,7 +38,7 @@ describe('List View Kanban', () => { }) cy.visit('/lists/1/kanban') - cy.getSettled('.kanban .bucket') + cy.get('.kanban .bucket') .contains(buckets[0].title) .get('.bucket-footer .button') .contains('Add another task') @@ -70,7 +70,7 @@ describe('List View Kanban', () => { it('Can set a bucket limit', () => { cy.visit('/lists/1/kanban') - cy.getSettled('.kanban .bucket .bucket-header .dropdown.options .dropdown-trigger') + cy.get('.kanban .bucket .bucket-header .dropdown.options .dropdown-trigger') .first() .click() cy.get('.kanban .bucket .bucket-header .dropdown.options .dropdown-menu .dropdown-item') @@ -91,7 +91,7 @@ describe('List View Kanban', () => { it('Can rename a bucket', () => { cy.visit('/lists/1/kanban') - cy.getSettled('.kanban .bucket .bucket-header .title') + cy.get('.kanban .bucket .bucket-header .title') .first() .type('{selectall}New Bucket Title{enter}') cy.get('.kanban .bucket .bucket-header .title') @@ -102,7 +102,7 @@ describe('List View Kanban', () => { it('Can delete a bucket', () => { cy.visit('/lists/1/kanban') - cy.getSettled('.kanban .bucket .bucket-header .dropdown.options .dropdown-trigger') + cy.get('.kanban .bucket .bucket-header .dropdown.options .dropdown-trigger') .first() .click() cy.get('.kanban .bucket .bucket-header .dropdown.options .dropdown-menu .dropdown-item') @@ -129,7 +129,7 @@ describe('List View Kanban', () => { }) cy.visit('/lists/1/kanban') - cy.getSettled('.kanban .bucket .tasks .task') + cy.get('.kanban .bucket .tasks .task') .contains(tasks[0].title) .first() .drag('.kanban .bucket:nth-child(2) .tasks') @@ -148,7 +148,7 @@ describe('List View Kanban', () => { }) cy.visit('/lists/1/kanban') - cy.getSettled('.kanban .bucket .tasks .task') + cy.get('.kanban .bucket .tasks .task') .contains(tasks[0].title) .should('be.visible') .click() @@ -170,7 +170,7 @@ describe('List View Kanban', () => { const task = tasks[0] cy.visit('/lists/1/kanban') - cy.getSettled('.kanban .bucket .tasks .task') + cy.get('.kanban .bucket .tasks .task') .contains(task.title) .should('be.visible') .click() @@ -217,7 +217,7 @@ describe('List View Kanban', () => { const task = tasks[0] cy.visit('/lists/1/kanban') - cy.getSettled('.kanban .bucket .tasks .task') + cy.get('.kanban .bucket .tasks .task') .contains(task.title) .should('be.visible') .click() @@ -234,7 +234,7 @@ describe('List View Kanban', () => { cy.get('.global-notification') .should('contain', 'Success') - cy.getSettled('.kanban .bucket .tasks') + cy.get('.kanban .bucket .tasks') .should('not.contain', task.title) }) }) \ No newline at end of file diff --git a/cypress/e2e/task/task.spec.ts b/cypress/e2e/task/task.spec.ts index 2752e651b..d087677f4 100644 --- a/cypress/e2e/task/task.spec.ts +++ b/cypress/e2e/task/task.spec.ts @@ -421,10 +421,10 @@ describe('Task', () => { cy.visit(`/tasks/${tasks[0].id}`) - cy.getSettled('.task-view .details.labels-list .multiselect .input-wrapper') + cy.get('.task-view .details.labels-list .multiselect .input-wrapper') .should('be.visible') .should('contain', labels[0].title) - cy.getSettled('.task-view .details.labels-list .multiselect .input-wrapper') + cy.get('.task-view .details.labels-list .multiselect .input-wrapper') .children() .first() .get('[data-cy="taskDetail.removeLabel"]') diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index aa0c8be97..698b01a42 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -34,38 +34,4 @@ // visit(originalFn: CommandOriginalFn, url: string, options: Partial): Chainable // } // } -// } - -/** - * Recursively gets an element, returning only after it's determined to be attached to the DOM for good. - * - * Source: https://github.com/cypress-io/cypress/issues/7306#issuecomment-850621378 - */ -Cypress.Commands.add('getSettled', (selector, opts = {}) => { - const retries = opts.retries || 3 - const delay = opts.delay || 100 - - const isAttached = (resolve, count = 0) => { - const el = Cypress.$(selector) - - // is element attached to the DOM? - count = Cypress.dom.isAttached(el) ? count + 1 : 0 - - // hit our base case, return the element - if (count >= retries) { - return resolve(el) - } - - // retry after a bit of a delay - setTimeout(() => isAttached(resolve, count), delay) - } - - // wrap, so we can chain cypress commands off the result - return cy.wrap(null).then(() => { - return new Cypress.Promise((resolve) => { - return isAttached(resolve, 0) - }).then((el) => { - return cy.wrap(el) - }) - }) -}) +// } \ No newline at end of file