Cypress 屏幕截图给出类型错误无法读取未定义的属性(读取 replaceall)

问题描述 投票:0回答:0

我在使用 Windows Server 2019 Datacentre 作为操作系统的 Amazon workspace 上使用 Cypress。 我正在尝试截取网页的屏幕截图,每次在我的窗口上出现相同的错误: 无法读取未定义的属性(读取“replaceAll”) 在 Object.toPosix (https://www.iciciprulife.com/__cypress/runner/cypress_runner.js:159314:56) 和 未捕获的 TypeError:无法读取 null 的属性(读取“getBoundingClientRect”) 在 getViewPercentage (:8:39)

虽然我的截图被保存在截图文件夹中,但是截图后脚本执行失败。

enter image description here

enter image description here

enter image description here

重现测试代码

describe("example to-do app", () =\> {

    it("Signature Testing", () =\> {
    cy.viewport(1336, 720)

cy.visit("https://www.iciciprulife.com/ulip-plans/unit-linked-insurance-plans/icici-pru-signature-ulip-     calculator.html")
    cy.wait(10000)
    cy.screenshot()
    cy.on("uncaught:exception", (err, runnable) =\> {
    console.log(err)
    return false
    })
    })
    })

赛普拉斯版本 12.8.1

节点版本 16.14.0

操作系统 Windows Server 2019 数据中心

期望的行为 我只想正常保存我的屏幕截图而不会出现任何错误,脚本应该在拍摄并保存屏幕截图后成功执行。

https://github.com/cypress-io/cypress/issues/26142

cypress screenshot replaceall
© www.soinside.com 2019 - 2024. All rights reserved.