test(cypress-github-backend): optionally record tests and run using recorded data (#2776)

This commit is contained in:
Erez Rokah
2019-10-22 19:59:13 +03:00
committed by Shawn Erquhart
parent 0f60a559c1
commit b869ce05ae
59 changed files with 57725 additions and 146 deletions

View File

@ -10,28 +10,25 @@ import {
} from '../../utils/steps';
import { workflowStatus } from '../../utils/constants';
import { entry1, entry2 } from './entries';
import * as specUtils from './spec_utils';
export default function({ use_graphql }) {
let taskResult = { data: {} };
const backend = 'github';
before(() => {
Cypress.config('taskTimeout', 1200000);
Cypress.config('defaultCommandTimeout', 60000);
cy.task('setupBackend', { backend }).then(data => {
taskResult.data = data;
});
cy.task('updateBackendOptions', { backend, options: { use_graphql, open_authoring: true } });
specUtils.before(taskResult, { use_graphql, open_authoring: true });
});
after(() => {
cy.task('teardownBackend', { backend, ...taskResult.data });
cy.task('restoreDefaults');
specUtils.after(taskResult);
});
beforeEach(() => {
specUtils.beforeEach(taskResult);
});
afterEach(() => {
cy.task('teardownBackendTest', { backend, ...taskResult.data });
specUtils.afterEach(taskResult);
});
it('successfully loads', () => {