Skip to content

Commit

Permalink
TECH-1852 : provide switch apollo helper
Browse files Browse the repository at this point in the history
  • Loading branch information
dgriffon committed Jul 8, 2024
1 parent 5a60afa commit da9339a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/support/apollo/apolloClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ export type ApolloClientOptions = Cypress.Loggable & {
setCurrentApolloClient: boolean
}

export const switchApolloClient = function (authMethod: AuthMethod = {url: Cypress.config().baseUrl}, options: ApolloClientOptions = {
log: true,
setCurrentApolloClient: true
}): void {
// Switch context to apollo client
cy.visit(authMethod.url, {failOnStatusCode: false});
return apolloClient(authMethod, options);
};

export const apolloClient = function (authMethod: AuthMethod = {url: Cypress.config().baseUrl}, options: ApolloClientOptions = {
log: true,
setCurrentApolloClient: true
Expand Down

0 comments on commit da9339a

Please sign in to comment.