不久前,测试脚本运行得非常完美。据我所知,唯一的更改是 URL。
这是有问题的测试之一。请注意,我们已将 URL 替换为假 URL。
我们尝试全新安装 Cypress。我们的支持文件等中没有任何内容。
我在代码中没有尝试设置属性。不管怎样,它似乎在运行我的测试之前抛出错误。
错误是:
"cannot set property name of which has only a getter"
Run Code Online (Sandbox Code Playgroud)
"cannot set property name of which has only a getter"
Run Code Online (Sandbox Code Playgroud)
堆栈跟踪:
TypeError: Cannot set property name of which has only a getter
at onError (https://[MY_WEBSITE]/__cypress/runner/cypress_runner.js:156647:18) From previous event:
at Object.run (https://[MY_WEBSITE]/__cypress/runner/cypress_runner.js:170479:13)
at Object.run (https://[MY_WEBSITE]/__cypress/runner/cypress_runner.js:156658:15)
at $Cy.cy.<computed> [as visit] (https://[MY_WEBSITE]/__cypress/runner/cypress_runner.js:157812:17)
at __stackReplacementMarker (https://[MY_WEBSITE]/__cypress/runner/cypress_runner.js:157121:13)
at Context.runnable.fn (https://[MY_WEBSITE]/__cypress/runner/cypress_runner.js:158036:21)
at callFn (https://[MY_WEBSITE]/__cypress/runner/cypress_runner.js:112788:21)
at Test.../driver/node_modules/mocha/lib/runnable.js.Runnable.run (https://[MY_WEBSITE]/__cypress/runner/cypress_runner.js:112775:7)
at https://[MY_WEBSITE]/__cypress/runner/cypress_runner.js:164502:28 From previous event:
at Object.onRunnableRun (https://[MY_WEBSITE]/__cypress/runner/cypress_runner.js:164487:17)
at …Run Code Online (Sandbox Code Playgroud) cypress ×1