msilori
msilori

Reputation: 39

Is there a way to pass a string in the userAgent through testcaferc config file

I am trying to pass a string as a part of userAgent from the testcaferc config file. I cant see it working somehow:

I have the following line of code in my testcaferc.json file:

 "browsers": [
        "Chrome:emulation:userAgent=TEST"
    ]

And in the test file, I have the following test:

test.page(`https://www.whatismybrowser.com/detect/what-is-my-user-agent/`)(`testing the user agent`, async t => {
        await t.debug()
    });

I cant see the userAgent getting set up by doing the above.

Upvotes: 0

Views: 199

Answers (1)

Alex Kamaev
Alex Kamaev

Reputation: 6318

It looks like you just have a typo in the browser name. You need to write Chrome in lowercase. Take a look at my config that works as expected:

{
  "browsers": [
    "chrome:emulation:userAgent=TEST"
  ]
}

Upvotes: 1

Related Questions