Complete the code to take a screenshot of the current page.
cy.[1]()The cy.screenshot() command captures a screenshot of the current page.
Complete the code to take a screenshot with a custom file name 'home-page'.
cy.screenshot({ name: '[1]' })Setting the name option to 'home-page' names the screenshot file accordingly.
Fix the error in the code to correctly capture a screenshot of an element with selector '#submit-btn'.
cy.get('#submit-btn').[1]()
The screenshot() command can be chained after cy.get() to capture a screenshot of a specific element.
Fill both blanks to take a screenshot with the name 'login-form' and capture only the element with selector '.form-container'.
cy.get('[1]').screenshot({ name: '[2]' })
We select the element '.form-container' and name the screenshot 'login-form'.
Fill all three blanks to take a full-page screenshot named 'full-home' with the option to capture beyond the viewport.
cy.screenshot('[1]', { [2]: 'fullPage', [3]: 500 })
The first blank is the screenshot name 'full-home'. The second blank is the option 'capture' set to 'fullPage' to capture the entire page. The third blank is 'timeout' set to 500 milliseconds.