【发布时间】:2022-06-18 21:00:21
【问题描述】:
我正在为一个网页编写 cypress 测试,该网页显示顶部带有过滤器的帖子列表。
但是要显示帖子列表,数据库中必须存在一些文档,以便我可以检查它们是否按要求显示。
如何在测试文件中添加一些文档,例如在beforeEach() 函数中?
这是posts-summary-test.ts文件的代码:
describe('posts summary page', () => {
beforeEach(() => {
cy.visit('/postssummary');
cy.wait(2000);
});
it('posts must be displayed in descending order of posted time',() => {
cy.findByLabelText(.......
......
......
......
)};
)};
在这个文件中,我可以在哪里添加一些文档来测试网页?
【问题讨论】:
标签: mongodb spring-boot cypress cypress-component-test-runner cypress-testing-library