Skip to content

cy.within followed by cy.screenshot capture runner does not capture runner #14253

Closed
@bahmutov

Description

@bahmutov

Cypress v6.1.0

The following test

describe('page', () => {
  it('works', () => {
    cy.visit('https://example.cypress.io')
    cy.get('.banner').within(() => {
      // should capture the entire test runner
      cy.screenshot('hello-world', {
        capture: 'runner'
      })
    })
  })
})

I expect the screenshot to be of the entire runner, like this

Screen Shot 2020-12-20 at 10 51 19 PM

But it takes only the .banner

hello-world

The devtools console shows the subject of the within affects the screenshot command, ignoring capture: runner option

Screen Shot 2020-12-20 at 10 52 51 PM

Desired result

when using capture: runner we should ignore the subject instead

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions