Testcafe-hammerhead: Support聽the "headers" option of the聽"fetch" function wrapper聽provided as an array

Created on 16 Jan 2019  路  3Comments  路  Source: DevExpress/testcafe-hammerhead

What is your Test Scenario?

The test scenario is doing an api call to validate a coupon. This api call can only be done by an authenticated user.

What is the Current behavior?

The coupon is not validated because the api call fails with an authentication error

What is the Expected behavior?

In testcafe 0.22.0 this api call works and correctly returns that the coupon code is invalid

What is聽your web application and聽your TestCafe聽test code?

The following code can be successfully run in testcafe 0.22.0 but fails in 0.23.3: https://gist.github.com/feikegeerts/4b6e28fdda55b3681df59f387d472b17

Steps to Reproduce:

Run the provided code with testcafe version 0.22.0 and see that the test runs successful.
Then run the provided code with the latest testcafe version and the test fails.

If you run the test with debug you will see that one of the invocations fails with the following error message:
image

Your Environment details:

  • testcafe version: 0.23.3
  • node.js version: v8.14.0
  • command-line arguments: yarn run testcafe chrome test
  • browser name and version: chrome 71
  • platform and version: macOS 10.14.2
client Auto-locked bug

Most helpful comment

@feikegeerts,
Thank you for your detailed description. I've reproduced this issue.聽 It seems to be connected to聽the following commit:聽

// [7177efe] Bump version (v0.23.3-alpha.2)
- 聽聽聽"testcafe-hammerhead": "14.4.2",
+ 聽聽聽"testcafe-hammerhead": "14.4.4",

Our team will research it and check for a suitable solution.

All 3 comments

@feikegeerts,
Thank you for your detailed description. I've reproduced this issue.聽 It seems to be connected to聽the following commit:聽

// [7177efe] Bump version (v0.23.3-alpha.2)
- 聽聽聽"testcafe-hammerhead": "14.4.2",
+ 聽聽聽"testcafe-hammerhead": "14.4.4",

Our team will research it and check for a suitable solution.

Currently, our fetch function wrapper does not support the headers option provided as an array.
We will consider addressing this limitation in future sprints.

Fetch Standard:
https://fetch.spec.whatwg.org/#example-headers-class

var meta = [
聽 [ "Content-Type", "text/xml" ],
聽 [ "Breaking-Bad", "<3" ]
]

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

miherlosev picture miherlosev  路  4Comments

ameyakoshti picture ameyakoshti  路  3Comments

matthias-b picture matthias-b  路  8Comments

madroneropaulo picture madroneropaulo  路  3Comments

rafaelaazevedo picture rafaelaazevedo  路  8Comments