diff --git a/client/cypress/support/commands.js b/client/cypress/support/commands.js index 2a0fa5f9..66477c4a 100644 --- a/client/cypress/support/commands.js +++ b/client/cypress/support/commands.js @@ -59,3 +59,12 @@ Cypress.Commands.add('loginByCsrf', (username, password, csrftoken) => { } }); }); + +// from https://stackoverflow.com/questions/53814647/how-can-i-alias-specific-graphql-requests-in-cypress +Cypress.Commands.add('waitFor', operationName => { + cy.wait('@graphQL').then(({request}) => { + if(request.body.operationName !== operationName) { + return cy.waitFor(operationName); + } + }); +});