mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 17:31:56 +03:00
2120c601d3
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5529 GitOrigin-RevId: cf487e53137cb884236bfa0a394a719506e11b1b
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import { ADMIN_SECRET_HEADER_KEY } from './constants';
|
|
|
|
export const baseUrl = Cypress.config('baseUrl');
|
|
|
|
export const getRemoteSchemaName = (i: number, schemaName: string) =>
|
|
`test-remote-schema-${schemaName}-${i}`;
|
|
|
|
export const getRemoteGraphQLURL = () =>
|
|
'https://graphql-pokemon2.vercel.app/';
|
|
|
|
export const getRemoteGraphQLURLFromEnv = () => 'GRAPHQL_URL';
|
|
|
|
export const getInvalidRemoteSchemaUrl = () => 'http://httpbin.org/post';
|
|
|
|
export const getHeaderAccessKey = (i: string) => `ACCESS_KEY-${i}`;
|
|
|
|
export const getHeaderAccessKeyValue = () => 'b94264abx98';
|
|
|
|
export const getElementFromAlias = (alias: string) => `[data-test=${alias}]`;
|
|
|
|
export const makeDataAPIUrl = (dataApiUrl: string) => `${dataApiUrl}/v1/query`;
|
|
|
|
export const makeDataAPIOptions = (
|
|
dataApiUrl: string,
|
|
key: string,
|
|
body: { [key: string]: any }
|
|
) => ({
|
|
method: 'POST',
|
|
url: makeDataAPIUrl(dataApiUrl),
|
|
headers: {
|
|
[ADMIN_SECRET_HEADER_KEY]: key,
|
|
},
|
|
body,
|
|
failOnStatusCode: false,
|
|
});
|
|
|
|
export const getRemoteSchemaRoleName = (i: number, roleName: string) =>
|
|
`test-role-${roleName}-${i}`;
|