graphql-engine/console/cypress/helpers/eventHelpers.js

24 lines
894 B
JavaScript
Raw Normal View History

import { ADMIN_SECRET_HEADER_KEY } from '../../src/constants';
2018-09-05 14:26:46 +03:00
export const baseUrl = Cypress.config('baseUrl');
export const queryTypes = ['insert', 'update', 'delete'];
export const getTriggerName = (i, testName = '') =>
`Apic_test_trigger_${testName}_${i}`;
2018-09-05 14:26:46 +03:00
export const getTableName = (i, testName = '') =>
`Apic_test_table_${testName}_${i}`;
2018-09-05 14:26:46 +03:00
export const getWebhookURL = () => 'http://httpbin.org/post';
export const getNoOfRetries = () => '5';
export const getIntervalSeconds = () => '10';
export const getTimeoutSeconds = () => '25';
2018-09-05 14:26:46 +03:00
export const getElementFromAlias = alias => `[data-test=${alias}]`;
export const makeDataAPIUrl = dataApiUrl => `${dataApiUrl}/v1/query`;
export const makeDataAPIOptions = (dataApiUrl, key, body) => ({
method: 'POST',
url: makeDataAPIUrl(dataApiUrl),
headers: {
[ADMIN_SECRET_HEADER_KEY]: key,
2018-09-05 14:26:46 +03:00
},
body,
failOnStatusCode: false,
});