Reputation: 222
we have a wpf application that uses cefsharp browser to host web site (AngularJS) - in other words - hybrid application.
We're interested to run an automation test (especially on the angular part). From a small research we saw that TestComplete supports cef browser hooking in native code, but we want to see all the possibilities.
Also as we saw that there is "Protractor" framework that is very suitable to test Angular based applications. The problems, for us, are that it can test only the web-part and it tests it by opening a web-browser. Anyway, we would like to run a protractor tests on the browser instance that is running inside the native code(wpf). Is it possible? Do you have another alternatives/ideas? Thanks.
Upvotes: 2
Views: 2253
Reputation: 222
Thanks to amaitland
I took his suggestion and succeeded to run a protractor tests on CefSharp hosted web browser.
In order to do this you have to do 2 things:
Define debugging port in .net application (on start up) that hosts embedded cef web browser:
var settings = new CefSettings { RemoteDebuggingPort = 8088 };
Cef.Initialize(settings);
In protractor configuration file this full debugging address "ip:port" should be defined under capabilities:
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['./tests.spec.js'],
capabilities: {
'browserName': 'chrome',
'chromeOptions': {'debuggerAddress': "127.0.0.1:8088" }
}
Run .net application and enter the screen with the hosted web browser
Upvotes: 5