Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

cypress check css property value

cy.get('[data-test-id="test-example"]')
  .invoke('attr', 'data-test-id')
  .should('equal', 'test-example')

// or you can get an element's CSS property
cy.get('[data-test-id="test-example"]')
  .invoke('css', 'position')
  .should('equal', 'static')
Source by example.cypress.io #
 
PREVIOUS NEXT
Tagged: #cypress #check #css #property
ADD COMMENT
Topic
Name
8+1 =