Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No working workaround for : Native Automation requires https protocol #8330

Open
wombatka opened this issue Oct 31, 2024 · 2 comments
Open
Labels
STATE: Issue accepted An issue has been reproduced. TYPE: bug The described behavior is considered as wrong (bug).

Comments

@wombatka
Copy link

What is your Scenario?

I cannot run my tests over http using native automation and chrome 130,
I tried using workaround from: #8133
The url seems to be loaded via http but it is not which can be seen in the browser console
image

What is the Current behavior?

automatic redirect to https occurs and page is not loaded

What is the Expected behavior?

page should be loaded via http

What is the public URL of the test page? (attach your complete example)

example.js:

import {Selector, t} from "testcafe";

fixture('MWE')
test('Website served only by HTTP is tried to be opened with HTTPS', async () => {
await t.navigateTo('http://www.testingmcafeesites.com/')
await t.debug()
})

What is your TestCafe test code?

example.js:

import {Selector, t} from "testcafe";

fixture('MWE')
test('Website served only by HTTP is tried to be opened with HTTPS', async () => {
await t.navigateTo('http://www.testingmcafeesites.com/')
await t.debug()
})

package.json

{
"name": "testcafeexample",
"version": "1.0.0",
"description": "",
"main": "example.js",
"scripts": {
"test": "testcafe chrome example.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"testcafe": "3.7.0-rc.2"

}
}

customRequestHook.js

const RequestHook = require('testcafe').RequestHook
class CustomRequestHook extends RequestHook {
constructor (requestFilterRules) {
super(requestFilterRules);
}

onRequest(e) {
    console.log("Changing protocol")
    e.requestOptions.protocol = 'http:';
}

.testcaferc.cjs

let CustomRequestHook = require('./customRequestHook.js').CustomRequestHook
const hook = new CustomRequestHook(/https?://.*/);
module.exports = {
hooks: {
request: hook
},
skipJsErrors : true
}

onResponse(e) {
}

}

module.exports = {
CustomRequestHook
}

Your complete configuration file

let CustomRequestHook = require('./customRequestHook.js').CustomRequestHook
const hook = new CustomRequestHook(/https?://.*/);
module.exports = {
hooks: {
request: hook
},
skipJsErrors : true
}

Your complete test report

No response

Screenshots

image

Steps to Reproduce

1.run test
2.open browser console
3.you will see that requet was sent with https not http

TestCafe version

3.7.0-rc.2

Node.js version

21.7.1

Command-line arguments

npm test

Browser name(s) and version(s)

chrome 130

Platform(s) and version(s)

Ubuntu 22.04.2 LTS

Other

No response

@wombatka wombatka added the TYPE: bug The described behavior is considered as wrong (bug). label Oct 31, 2024
@testcafe-need-response-bot testcafe-need-response-bot bot added the STATE: Need response An issue that requires a response or attention from the team. label Oct 31, 2024
@wombatka
Copy link
Author

you can see in network console that origin is set to url with https, despite custom hook i used
image

@Bayheck Bayheck added STATE: Issue accepted An issue has been reproduced. and removed STATE: Need response An issue that requires a response or attention from the team. labels Nov 5, 2024
Copy link

github-actions bot commented Nov 5, 2024

We appreciate you taking the time to share information about this issue. We reproduced the bug and added this ticket to our internal task queue. We'll update this thread once we have news.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATE: Issue accepted An issue has been reproduced. TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

2 participants