检查前:
<li style="text-decoration: none;">test</li>
检查后:
<li style="text-decoration: line-through;">test</li>
cy.get('li').should('have.css', 'text-decoration', 'line-through')
assertexpected <li> to have CSS property text-decoration with the value line-through, but the value was line-through solid rgb(0, 0, 0)
你需要部分检查。
Cypress.$(e).css('text-decoration').includes('line-through')
cy.get('li') .invoke('css', 'text-decoration') .should('include', 'line-through')