为什么 cypress 看不到 border * 属性 的 css 值?
Why doesn't cypress see the css value of the border * property?
cy.get("[data-e2e='dispatcher-checkbox'] i[data-e2e='checkbox']").should(
"have.css",
"border-radius",
convertToRGB(theme("colors.greys.2")),
)
所有其他属性值都看到了,但是以border和border本身开头的属性的值,表示value = ""
我找到了解决方案,原来是因为jQuery的行为,它不理解快捷方式属性,需要完整指定“border-top-radius”。
示例:
cy.get("[data-e2e='dispatcher-checkbox'] i[data-e2e='checkbox']").should(
"have.css",
"border-top-radius",
convertToRGB(theme("colors.greys.2")),
)
更新:
“border-radius”也有效,但前提是你不调用“它”,其中“border-radius”功能是“仅”。奇怪...
cy.get("[data-e2e='dispatcher-checkbox'] i[data-e2e='checkbox']").should(
"have.css",
"border-radius",
convertToRGB(theme("colors.greys.2")),
)
所有其他属性值都看到了,但是以border和border本身开头的属性的值,表示value = ""
我找到了解决方案,原来是因为jQuery的行为,它不理解快捷方式属性,需要完整指定“border-top-radius”。
示例:
cy.get("[data-e2e='dispatcher-checkbox'] i[data-e2e='checkbox']").should(
"have.css",
"border-top-radius",
convertToRGB(theme("colors.greys.2")),
)
更新: “border-radius”也有效,但前提是你不调用“它”,其中“border-radius”功能是“仅”。奇怪...