graphql-engine/console/cypress/e2e/api-explorer/graphql/test.ts
Stefano Magni fc753ffb42 console: Update Cypress to v10 and run the migration guide
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4849
GitOrigin-RevId: 10e0fd62344a0c5c7028ad480b747b7f64c9c773
2022-07-05 08:51:35 +00:00

41 lines
954 B
TypeScript

import {
openAPIExplorer,
checkQuery,
checkMutation,
createTestTable,
insertValue,
checkSub,
delTestTable,
} from './spec';
import { setMetaData } from '../../validators/validators';
import { testMode } from '../../../helpers/common';
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', () => {
it('Create test table', createTestTable);
it('Insert row into test table', insertValue);
it('Open API Explorer', openAPIExplorer);
it('Check query result', checkQuery);
it('Check mutation result', checkMutation);
it('Check subscription result', checkSub);
it('Delete test table', delTestTable);
});
};
if (testMode !== 'cli') {
setup();
runApiExplorerTests();
}