cy.focused()

To get the DOM element that has focus, use the cy.focused() command.

cy.get('.misc-form').find('#name').click()
cy.focused().should('have.id', 'name')

cy.get('.misc-form').find('#description').click()
cy.focused().should('have.id', 'description')

cy.screenshot()

To take a screenshot, use the cy.screenshot() command.

cy.screenshot('my-image')
cypress/screenshots/my-image.png

cy.wrap()

To wrap an object, use the cy.wrap() command.

cy.wrap({foo: 'bar'})
  .should('have.property', 'foo')
  .and('include', 'bar')
{foo: bar}