Skip to content

screenshots are not accurately captured when test replay is enabled (with capture: viewport as default with --no-runner-ui) #28073

Closed as not planned
@pablosmalys

Description

@pablosmalys

Current behavior

I have set viewport in my cypress config file to 1920x1200, but whenever test fails it sends screenshot in wrong viewports (looks for me that in default values for viewports). Test are running like from local machine via CLI and so from GitLab pipelines. In both situations result is same.

If I disable test replay report, then issue with screenshots disappear.

image

image

Desired behavior

The screenshot must be always send in define viewports.

Test code to reproduce

test:

it("visit google", () => {
  cy.visit("https://www.google.com/");
  cy.get(".pavel"); // this will fail, cause there is no such class
});

cypress config:

import { defineConfig } from "cypress";

export default defineConfig({
  e2e: {
    viewportWidth: 1920,
    viewportHeight: 1200,
    chromeWebSecurity: false,
    requestTimeout: 30000,
    responseTimeout: 30000,
    experimentalRunAllSpecs: true,
    projectId: "", //put your projectId 
    setupNodeEvents(on, config) {
      return require("./cypress/plugins/index.js")(on, config);
    },
  },
  // video: true,
  // retries: 1,
});

Cypress Version

13.3.1

Node version

v16.20.0

Operating System

macOS 13.6

Debug Logs

No response

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions