diff --git a/cypress/integration/list/list.spec.js b/cypress/integration/list/list.spec.js index 011b489ec..3d85375a3 100644 --- a/cypress/integration/list/list.spec.js +++ b/cypress/integration/list/list.spec.js @@ -361,10 +361,7 @@ describe('Lists', () => { }) cy.visit('/lists/1/kanban') - cy.get('.kanban .bucket .tasks') - .should('contain', tasks[0].title) - - cy.get('.kanban .bucket .tasks .task') + cy.getAttached('.kanban .bucket .tasks .task') .contains(tasks[0].title) .click() diff --git a/cypress/integration/sharing/team.spec.js b/cypress/integration/sharing/team.spec.js index 0359af91a..094556355 100644 --- a/cypress/integration/sharing/team.spec.js +++ b/cypress/integration/sharing/team.spec.js @@ -23,8 +23,6 @@ describe('Team', () => { .contains('Create') .click() - cy.get('.fullpage') - .should('not.exist') cy.url() .should('contain', '/edit') cy.get('input#teamtext') diff --git a/cypress/support/commands.js b/cypress/support/commands.js new file mode 100644 index 000000000..ccdc6f366 --- /dev/null +++ b/cypress/support/commands.js @@ -0,0 +1,17 @@ +/** + * getAttached(selector) + * getAttached(selectorFn) + * + * Waits until the selector finds an attached element, then yields it (wrapped). + * selectorFn, if provided, is passed $(document). Don't use cy methods inside selectorFn. + * + * Source: https://github.com/cypress-io/cypress/issues/5743#issuecomment-650421731 + */ +Cypress.Commands.add('getAttached', selector => { + const getElement = typeof selector === 'function' ? selector : $d => $d.find(selector); + let $el = null; + return cy.document().should($d => { + $el = getElement(Cypress.$($d)); + expect(Cypress.dom.isDetached($el)).to.be.false; + }).then(() => cy.wrap($el)); +}); diff --git a/cypress/support/index.js b/cypress/support/index.js index a51369df0..74c1400d7 100644 --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -1,2 +1,3 @@ +import './commands' import 'cypress-file-upload' diff --git a/src/components/input/editor.vue b/src/components/input/editor.vue index d5ccf95b2..6df9de8b4 100644 --- a/src/components/input/editor.vue +++ b/src/components/input/editor.vue @@ -442,7 +442,7 @@ export default { \ No newline at end of file diff --git a/src/components/misc/user.vue b/src/components/misc/user.vue index 4e9c8e63f..bcd76e078 100644 --- a/src/components/misc/user.vue +++ b/src/components/misc/user.vue @@ -40,7 +40,7 @@ export default { diff --git a/src/components/tasks/edit-task.vue b/src/components/tasks/edit-task.vue index 1904c4300..c259f74d0 100644 --- a/src/components/tasks/edit-task.vue +++ b/src/components/tasks/edit-task.vue @@ -284,6 +284,6 @@ export default { \ No newline at end of file diff --git a/src/components/tasks/partials/priorityLabel.vue b/src/components/tasks/partials/priorityLabel.vue index d47ae0457..d9d9eb4a2 100644 --- a/src/components/tasks/partials/priorityLabel.vue +++ b/src/components/tasks/partials/priorityLabel.vue @@ -44,7 +44,7 @@ export default { diff --git a/src/views/user/RequestPasswordReset.vue b/src/views/user/RequestPasswordReset.vue index b6c17d9ad..72e1bc716 100644 --- a/src/views/user/RequestPasswordReset.vue +++ b/src/views/user/RequestPasswordReset.vue @@ -85,6 +85,6 @@ export default {