2018-07-25 09:44:27 +03:00
|
|
|
import {
|
|
|
|
openAPIExplorer,
|
|
|
|
checkQuery,
|
|
|
|
checkMutation,
|
|
|
|
createTestTable,
|
|
|
|
insertValue,
|
|
|
|
checkSub,
|
|
|
|
delTestTable,
|
|
|
|
} from './spec';
|
2018-06-28 07:57:37 +03:00
|
|
|
|
|
|
|
import { setMetaData } from '../../validators/validators';
|
2018-07-11 15:02:29 +03:00
|
|
|
import { testMode } from '../../../helpers/common';
|
2018-06-28 07:57:37 +03:00
|
|
|
|
|
|
|
const setup = () => {
|
|
|
|
describe('Setup route', () => {
|
|
|
|
it('Visit the index route', () => {
|
|
|
|
// Visit the index route
|
|
|
|
cy.visit('/');
|
|
|
|
// Get and set validation metadata
|
|
|
|
setMetaData();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
export const runApiExplorerTests = () => {
|
|
|
|
describe('API Explorer', () => {
|
2018-07-25 09:44:27 +03:00
|
|
|
it('Create test table', createTestTable);
|
|
|
|
it('Insert row into test table', insertValue);
|
2018-06-28 07:57:37 +03:00
|
|
|
it('Open API Explorer', openAPIExplorer);
|
2018-07-25 09:44:27 +03:00
|
|
|
it('Check query result', checkQuery);
|
|
|
|
it('Check mutation result', checkMutation);
|
|
|
|
it('Check subscription result', checkSub);
|
|
|
|
it('Delete test table', delTestTable);
|
2018-06-28 07:57:37 +03:00
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2018-07-11 15:02:29 +03:00
|
|
|
if (testMode !== 'cli') {
|
|
|
|
setup();
|
|
|
|
runApiExplorerTests();
|
|
|
|
}
|