【问题标题】:Cypress net::ERR_EMPTY_RESPONSE 6.8.0赛普拉斯网::ERR_EMPTY_RESPONSE 6.8.0
【发布时间】:2021-04-06 01:43:20
【问题描述】:

当我加载页面时,它会调用我的 api https://<apiurl>/products。在柏树中,此请求失败:

GET https://<apiurl>/products net::ERR_EMPTY_RESPONSE

如果我复制 cURL 请求,响应会正常返回。我仔细检查了从 api 返回的标头,没有 cors 问题。没有任何东西被存根这是整个测试:

describe('Plans page', () => {
  it('should load', () => {
    cy.visit('http://localhost:8001/plans')
    expect(1).to.eq(1)
  })
})
"cypress": "6.8.0",

【问题讨论】:

标签: cypress


【解决方案1】:

在我的情况下,问题是由公司代理引起的。我必须添加proxy configuration。 (我有完全相同的错误:net::ERR_EMPTY_RESPONSE

Linux:

export http_proxy=http://...
export https_proxy=http://...
export NO_PROXY=...

cypress open

【讨论】:

    猜你喜欢
    • 2019-01-23
    • 2020-12-23
    • 1970-01-01
    • 2020-08-15
    • 1970-01-01
    • 1970-01-01
    • 2018-04-28
    • 2023-01-12
    • 1970-01-01
    相关资源
    最近更新 更多