Bird
0
0

What does the Cypress command cy.get('button').should('have.css', 'color', 'rgb(255, 0, 0)') check?

easy📝 Conceptual Q11 of 15
Cypress - Assertions
What does the Cypress command cy.get('button').should('have.css', 'color', 'rgb(255, 0, 0)') check?
AIt checks if the button is clickable.
BIt checks if the button's text color is red.
CIt checks if the button has a red background.
DIt checks if the button is visible on the page.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the CSS property being checked

    The command checks the CSS property 'color', which controls the text color of the element.
  2. Step 2: Interpret the value 'rgb(255, 0, 0)'

    This RGB value represents the color red.
  3. Final Answer:

    It checks if the button's text color is red. -> Option B
  4. Quick Check:

    CSS property 'color' = text color [OK]
Quick Trick: Check the CSS property name to know what style is tested [OK]
Common Mistakes:
  • Confusing 'color' with 'background-color'
  • Assuming it checks visibility instead of style
  • Mixing RGB values with hex codes incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Cypress Quizzes