magnificent-finland-58048
07/26/2022, 8:43 AMabundant-gold-84344
07/26/2022, 10:55 AMimport { mount } from "@cypress/react";
import React from "react";
import "./test.css";
export const Test = () => {
const x = "Text";
return <button>{x}</button>;
};
describe("Test", () => {
it("Test", () => {
mount(<Test />);
cy.get("button").should("have.css", "background-color", "rgb(0, 128, 0)");
cy.get("button").realPress("Tab");
// cy.get("body").realPress("Tab");
// cy.realPress("Tab");
cy.get("button").should("have.css", "background-color", "rgb(0, 0, 255)");
});
});
test.css:
button {
background-color: rgb(0, 128, 0);
color: white;
&:focus {
background-color: rgb(0, 0, 255)
}
}
abundant-gold-84344
07/26/2022, 10:56 AM