Add cypress command to wait for specific GraphQL query
This commit is contained in:
parent
59495d13c8
commit
be7259403e
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue