I need to check the orientation of a div with Cypress.
This is the test:
cy
.get('data-test="vertical"')
.should('have.css', 'transform', 'translate(-100%, 0) rotate(270deg)')
The div behaviour is standard in a scenario, or it's rotated with css transform: translate(-100%, 0) rotate(270deg);
in the other scenario.
I need a way to check the orientation, but transform
is difficult to check, because for example in Cypress test what happens is:
when I expect transform: rotateX(180deg)
I actually receive transform: matrix3d(1, 0, 0, 0, 0, -1, 1.22465e-16, 0, 0, -1.22465e-16, -1, 0, 0, 0, 0, 1)
.
I need to find a smart way to detect the orientation. Suggestions? Tips?
question from:
https://stackoverflow.com/questions/65642522/how-to-check-orientation-based-on-css-transform-rotate270deg-in-cypress 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…