Complete the code to check if the element has the correct background color.
cy.get('.button').should('have.css', 'background-color', [1]);
The correct CSS value for red in rgba format is 'rgba(255, 0, 0, 1)'. Cypress returns computed styles in rgba format.
Complete the code to assert that the element is visible and has the correct font size.
cy.get('#title').should('be.visible').and('have.css', 'font-size', [1]);
Cypress returns computed font sizes in pixels, so '16px' is the correct value to assert.
Fix the error in the code to correctly assert the element's border style.
cy.get('.card').should('have.css', 'border-style', [1]);
The 'border-style' CSS property only expects the style part like 'solid'. The other options include width and color which are incorrect here.
Fill both blanks to assert the element's text color and font weight.
cy.get('.header').should('have.css', 'color', [1]).and('have.css', 'font-weight', [2]);
Cypress returns computed colors in rgb format, so 'rgb(0, 0, 0)' is correct for black. Font weight is returned as a numeric string like '700' for bold.
Fill all three blanks to assert the element's margin, padding, and display properties.
cy.get('.container').should('have.css', 'margin', [1]).and('have.css', 'padding', [2]).and('have.css', 'display', [3]);
Margin is set to '16px', padding to '0px', and display to 'flex' as per the computed styles Cypress returns.