简体   繁体   中英

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")),
      )

All other property values ​​are seen, but the values ​​of properties starting with border and the border itself, says that the value = ""

在此处输入图片说明

I found a solution, it turns out it's because of jQuery's behavior, it doesn't understand shortcut properties, it needs to specify "border-top-radius" in full.

Example:

cy.get("[data-e2e='dispatcher-checkbox'] i[data-e2e='checkbox']").should(
        "have.css",
        "border-top-radius",
        convertToRGB(theme("colors.greys.2")),
      )

UPD: "border-radius" also works, but only if you do not call "it" in which the "border-radius" function is "only". Strange ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM