Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Suite / test configuration overrides do not take effect in 4.9.0 #7823

Closed
kamranayub opened this issue Jun 26, 2020 · 3 comments
Closed
Labels
type: duplicate This issue or pull request already exists

Comments

@kamranayub
Copy link

kamranayub commented Jun 26, 2020

Current behavior:

According to the documentation, we should be able to override configuration per-suite or per-test but it doesn't look like 4.9.0 is taking those into effect.

This test is configured to run at 1024x768 yet it's still the default 1000x660.

2020-06-25

Desired behavior:

Test code to reproduce

https://github.com/kamranayub/cypress-bug-test-config

/// <reference types="cypress" />

describe("page", { viewportWidth: 1024, viewportHeight: 768 }, () => {
  it("works", () => {
    cy.visit("https://example.cypress.io");
  });
});

Workarounds

You can still use cy.viewport in every test but even that I've discovered has regressed in 4.9.0 as there's a very quick shift to 1000x660 between each it execution that messes with styles and will affect tests.

For this split-second viewport issue, this seems to alleviate most of my issues:

Cypress.Commands.overwrite("viewport", (originalFn, ...args) => {
  // Delegate to original fn
  originalFn(...args);

  // Seems to be needed in 4.9.0 for a split second
  cy.wait(500);
});

Versions

  • Cypress 4.9.0
  • Windows 10
  • Chrome 83
@shirotech
Copy link

+1 also facing this issue

@jennifer-shehane
Copy link
Member

Duplicate of #7631

@jennifer-shehane jennifer-shehane marked this as a duplicate of #7631 Jun 29, 2020
@jennifer-shehane jennifer-shehane added the type: duplicate This issue or pull request already exists label Jun 29, 2020
@kamranayub
Copy link
Author

Wow, GitHub search failed me, I literally searched for viewportWidth before opening this 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants