Closed ferrx closed 5 years ago
Still getting this error -- however I was trying to get away from PhantomJS because of errors it was throwing. It turned out those errors were because I was pulling in Jasmine 2.99 -- I switched in the jasmine bits that came with the chutzpah nuget and no more errors, so sticking with that for now.
I am unable to repo this issue. I was able to specify the chrome path and it works with this json
{
"Engine": "Chrome",
"Framework": "Jasmine",
"EngineOptions": {
"ChromeBrowserPath": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"
},
"TestHarnessLocationMode": "SettingsFileAdjacent",
"Tests": [
{ "Includes": [ "*test.js" ] }
]
}
You can also try leaving off the engineOptions and see if it will find the chrome instance via its built in detection
Thanks. Here's a hint -- I noticed you have a js file in your Tests.Includes, but I'm using *.html in mine.
If I switch to .js it works, but using .html does not work. Maybe there's some extra setup in the html harness to get chrome-headless working?
I don't support directly running your own HTML test file under Chrome or JsDom.
Any plans for that? I have a project that is jQuery heavy and needs that. I'll stick with Phantom for now.
No plans, there are technical reasons why I don't support it. However, you can usually get chutzpah to work with jquery and let it generate the html file itself
Can you provide an example w/ chutzpah running tests on JS files that have jQuery dependencies? I'm just a little lost, the idea is to be able to interact and manipulate with the "DOM" (whatever you want to call that within a headless browser) with jQuery.. meaning execute jQuery selectors, etc.
Take a look at this example
It uses jquery and it also uses HTML files that get injected into the dom and then queried on.
I duplicated that example, it didn't work for me until I took out this includes from chutzpah.json:
"Tests": [
{ "Includes": [ "*.js" ] }
]
It was complaining that it couldn't find the $
variable, as if it couldn't load the inline referenced jquery.js file.
Edit: Sorry to add on like this, but does Tests.Includes override inline references? I also got it working by removing the inline ref and adding a ref in chutzpah.json to include jquery.js (unlike the example..):
"Tests": [
{ "Includes": [ "*.js" ] }
],
"References": [
{ "Path": "../wwwroot/lib/jquery/dist/jquery.js" }
]
Perfect!
Are you unblocked now?
Unblocked when using PhantomJS and html files as an entry point, yes. Definitely the "not detecting Chrome" issue is clarified and resolved.
I'm setting the chutzpah.json options for Engine and EngineOptions.ChromeBrowserPath to use chrome headless, but the trace logs indicate it's still trying to use PhantomJS. It gives me a "timeout occurred" error after about 10s. If I remove the engine properties (leaving it to default to PhantomJS), everything runs smoothly.
I don't see any reference to Chrome in the logs. I see my chutzpah.json references, but it doesn't seem to catch my engine properties.
Using chutzpah 4.4.5 and Chrome 74.0.3729.169.