Trying to test hover styles on table rows but encountering issues:
Here is the code snippet I am testing:
it("Table rows should display correct hover styles", () => {
cy.get("table>tbody>tr").each(($el, index, $list) => {
$el.trigger("mouseover");
expect($el).to.have.css("background-color", "rgb(242, 242, 242)");
});
});
However, the background-color
value remains unchanged after hover.
Cypress throws this error:
expected '<tr>' to have CSS property 'background-color' with the value 'rgb(242, 242, 242)', but the value was 'rgba(0, 0, 0, 0)'