Testcafe: Fetching an absolute CORS url is treated as relative

Created on 19 Jul 2017  路  3Comments  路  Source: DevExpress/testcafe

Are you requesting a feature or reporting a bug?

Bug

What is the current behavior?

When running tests, client fetches resources from https://some.api.com/foo (cors) and the requested url becomes http://192.168.109.1:9625/Byhu2n2Hb/https://some.api.com/foo.

What is the expected behavior?

Fetching https://some.api.com/foo normally.

How would you reproduce the current behavior (if this is a bug)?

Use the following test code, open chrome devtools Networks tab before the test controller clicks 'CREATE A NEW ACCOUNT', and see a POST request made to
http://192.168.109.1:10247/Hk50pnnrW/https://api.futurenda.com/Chain
instead of https://api.futurenda.com/Chain

Provide the test code and the tested page URL (if applicable)

Tested page URL: https://app.futurenda.com

Test code

fixture `Login view`
    .page('https://app.futurenda.com')

test('Register with email', async t => {
    await t
        .expect(Selector('#loading-screen').exists).notOk('Loading screen stuck', { timeout: 10000 })
        .click(Selector('[md-button]').withText('Sign up with email'))
        .typeText(Selector('.form > [md-text-field]').nth(0), `test+test${Date.now()}@gmail.com`)
        .typeText(Selector('.form > [md-text-field]').nth(1), 'testpassword')
        .typeText(Selector('.form > [md-text-field]').nth(2), 'testpassword')
        .wait(2000) // wait before clicking submit so you can open devtools Networks tab
        .click(Selector('[md-button].login'))
        .debug()

    let location = t.eval(() => location.href)

    await t.expect(location).contains('/agenda')
})

Specify your

  • operating system: Windows 10
  • testcafe version: 0.16.2
  • node.js version: 8.1.0
  • chrome version: 59.0.3071.115
!IMPORTANT! Auto-locked hammerhead bug

Most helpful comment

All 3 comments

Hi @fnlctrl,

TestCafe works via own proxy (https://github.com/DevExpress/testcafe-hammerhead). It's ok that the browser sends requests not directly to the target server but through the proxy.
It seems there is an issue in the proxy which breaks the behavior. We'll investigate it and notify you about any progress
/cc @LavrovArtem

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests. For TestCafe API, usage and configuration inquiries, we recommend asking them on StackOverflow.

Was this page helpful?
0 / 5 - 0 ratings