2019-09-25 18:46:28 +03:00
|
|
|
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 = '') =>
|
2019-05-25 10:42:21 +03:00
|
|
|
`Apic_test_trigger_${testName}_${i}`;
|
2018-09-05 14:26:46 +03:00
|
|
|
export const getTableName = (i, testName = '') =>
|
2019-05-25 10:42:21 +03:00
|
|
|
`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';
|
2019-02-14 10:37:59 +03:00
|
|
|
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: {
|
2019-09-25 18:46:28 +03:00
|
|
|
[ADMIN_SECRET_HEADER_KEY]: key,
|
2018-09-05 14:26:46 +03:00
|
|
|
},
|
|
|
|
body,
|
|
|
|
failOnStatusCode: false,
|
|
|
|
});
|