【发布时间】:2019-05-03 09:08:34
【问题描述】:
我有一个使用 QraphQL 的 Angular 应用程序。 我在 cypress 中写了一个测试,看起来像这样:
it('should do something', () => {
cy.server();
cy.route('POST', '/graphql', 'fixture:data1.json');
// data is loaded from the endpoint to populate the page
cy.visit('http://localhost:3000/#/something/somethingElse');
// when the button is clicked, the same endpoint is called again,
// but now I need it to deliver some other data.
cy.get('button')
.click();
});
谁能为我提供一种设置方法? 提前致谢
【问题讨论】:
标签: javascript testing graphql integration-testing cypress