Skip to content

"enableJavaScript: true" disables discovery.cookies #1146

Closed

Description

@philipp-winterle

The problem

If using enableJavaScript: true the discovery.cookies settings are ignored.

module.exports = {
  version: 2,
  snapshot: {
    widths: [1920],
    enableJavaScript: false,
  },
  discovery: {
    cookies: [
      {
        name: "MSCC",
        value: "cid=hqr4tmpjqgd1zyhujbr7etuc-c1=2-c2=2-c3=2",
      },
    ],
  }
};
- name: Dev To Cookie Test
  url: https://microsoft.com
  waitForTimeout: 3000

Environment

  • Node version: 16.14
  • @percy/cli version: 1.16.0
  • Version of Percy SDK you’re using: "@percy/puppeteer": "^2.0.2"
  • If needed, a build or snapshot ID: 23292125
  • OS version: MacOs Ventura 13.0.1
  • Type of shell command-line [interface]: zsh

Details

Iam trying to scan our pages. To get the full page screen I need to get rid of our cookie consent overlay. I can use cookies for that to simulate a already visited user.
If I set enableJavaScript to false I get the full page screen without the cookie banner. If I set it to true the same snapshot test will result in a page with cookie banner as if there are no cookies set.

Code to reproduce issue

Given the above settings just run

npx percy snapshot snapshot.yml

Activity

  1. philipp-winterle commented on Nov 29, 2022

    @philipp-winterle
    Author

    Found out the cookie seems to be set and not at the same time.

    I found things on the snapshot that only exists if cookie is set. Same time I find things on the snapshot that only exists if cookie is NOT set. Strange

    Seems like snapshots from local differ from online

  2. locked and limited conversation to collaborators on Nov 30, 2022
  3. converted this issue into a discussion #1147 on Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions