我正在寻找一个选项来获取每个测试的名称和结果(失败/通过),以将其保存到外部文件中。
我怎样才能轻松获得这些信息?
目前,我只能获得该it()
部分中的标题:
cy.log(this.test.title)
但是,我无法在那里得到结果。
从afterEach()
部分中获得此选项将是理想的。这样我就可以在一个地方保存标题和结果。
我做不到,this.test.state
因为Cannot read property 'test' of undefined
我无法使用 Cypress.on('test:after:run', (test)) 因为这部分代码没有启动。我不知道为什么。
谢谢!