赛普拉斯的 modifyObstructiveCode 仅在全球范围内有效?

Cypress' modifyObstructiveCode works only globally?

在我的测试中,设置配置选项 modifyObstructiveCode 似乎只有在 cypress.json 中全局设置时才有效。但是,如果我在特定的测试文件中设置它:

Cypress.config('modifyObstructiveCode', false)

尽管 console.log(Cypress.config()) 的输出似乎符合设置,但似乎没有任何效果。文档似乎没有明确说明此配置选项只能全局设置...

是这样吗?是否有可能在文件级别控制它?

这是在 2018 年的赛普拉斯问题中提出的

Add ability to use Cypress.config to set 'modifyObstructiveCode'. #1668

Yeah for all kinds of reasons this is to be expected. Even though this is a valid configuration value - it affects the proxy layer of Cypress in node - which has nothing to do changing it at runtime in the browser. There are many other options like this and maybe we should throw an error if you try to change them.