Cypress: [Cypress 6.0.0] cy.screenshot marked as deprecated

Created on 24 Nov 2020  路  3Comments  路  Source: cypress-io/cypress

Current behavior

When using cy.screenshot my editor warns me that it's deprecated and refers to cy.intercept. I tried looking at the release blog post and the docs for these two function but it doesn't seem this should be deprecated.

Diving into the type definitions it looks like this:

/**
 * @deprecated Use `cy.intercept()` instead.
 *
 * Take a screenshot of the application under test and the Cypress Command Log.
 *
 * @see https://on.cypress.io/screenshot
 * @example
 *    cy.screenshot()
 *    cy.get(".post").screenshot()
 */
screenshot(options?: Partial<Loggable & Timeoutable & ScreenshotOptions>): Chainable<null>### Desired behavior

To not have this flagged as deprecated or instructions in the docs on how to use intercept for screenshots.

Test code to reproduce

/// <reference types="Cypress" />

context('e2e', () => {
  it('can render', () => {
    cy.visit('/');
    cy.screenshot();
  });
});

Versions

6.0.0

internal-priority pending release typings v6.0.0

Most helpful comment

All 3 comments

Yah, this warning is supposed to be on cy.route, but likely got associated with the wrong command鈥檚 types.

The code for this is done in cypress-io/cypress#9323, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

Was this page helpful?
0 / 5 - 0 ratings