Colorfulstan

Automated end-to-end tests using protractor / selenium

Recommended Posts

Hey guys, following general problem scenario lingers around since quite some time, maybe some of you got some ideas about that:

I would like to be able to write acceptance-tests for an overwolf app using protractor (selenium based JS testing framework). 
I don't know about the internal technicalities of protractor or selenium yet but how it works for regular browsers is something like this: 

  1. It starts a web-server which the framework hooks into using selenium
  2. it runs the app under test + the test-suite within that web-server

With overwolf this should theoretically also be possible, since the apps are browser-based


So the actual question is:

Does anyone know how to approach writing a runner for this?
The more specific problems facing are:

  1. starting overwolf and a specific app from the console
  2. hooking into the app with protractor / selenium to run tests

Of course would be awesome if someone already knows how to archieve this.

If not I would need some hints how to approach this, since I have zero experience with other languages then JS/Java and need to dig into the protractor / selenium docs then.

 

A nice side-effect of solving this problem would be to be able to create a karma-runner for the overwolf browser instead of using chrome, so it more accurately represents the ayctual environment of the app.

Edited by Colorfulstan

Share this post


Link to post
Share on other sites
1 hour ago, Colorfulstan said:

Sounds promising :)

You got any experience with selenium or browser automation?

Yeah, I've become an expert last night.

After spending all day studying how it works, I've come to the conclusion that It can be done.

You've to create you own ChromeDriver ( https://github.com/scheib/chromium/tree/master/chrome/test/chromedriver ) in order to it to work with the Chromium version of Overwolf, then get Overwolf to expose some command line arguments, like the ability to launch an app by its UID, then start the selenium-standalone server refering the custom chrome driver (-Dwebdriver.chrome.driver=./path).
From there, everything should work the same, with a couple tweaks here and there, and maybe a Protractor plugin to improve the syntax as well.

You'll need the help of Overwolf, there is a lot of work to be done.
Good luck.

Share this post


Link to post
Share on other sites

Thanks for your effort, good starting point for a constructive discussion. I'll dig into the topic myself once I get the time and know if the project is officially approved / supported.

Since the overwolf-browser runs on the chromium-engine wouldn't that mean the chrome driver might just be compatible as is?
Did any obvious things became apparent during your investigation that would need to be reworked regarding the chromedriver, or is it just a general assumption for now?

I already thought, that it's propably not possible as is to start apps from the command-line without some collaboration on overwolf's side.

Maybe we can get @tomwolfgang in on this topic to get his thoughts?

Share this post


Link to post
Share on other sites
5 hours ago, Colorfulstan said:

Since the overwolf-browser runs on the chromium-engine wouldn't that mean the chrome driver might just be compatible as is?

I didn't mean you have to create a new one from scratch, in the most part, yes, it's practicaly identical, but the driver is responsible even for opening the testing platform, in this case chrome.exe, you'll have to change that, among other things, and then re compile it, it's not that complicated.

Share this post


Link to post
Share on other sites

While I don't have any experience with selenium or browser automation here's what I can offer to help.

Two things to note:

OverwolfExtensions.launch("<insert uid here>");

And probably more useful although doesn't actually seem to quite work: (more than just bolded will probably change as the channel and prefetch numbers seem to change each time I launch overwolf.

From ProcessExplorer overwolf.exe seems to launch apps using overwolfbrowser.exe:

"C:\Program Files (x86)\Overwolf\0.99.303.0\OverwolfBrowser.exe" --type=renderer --enable-begin-frame-scheduling --no-sandbox --enable-deferred-image-decoding --lang=en-US --lang=en-US --locales-dir-path="C:\Program Files (x86)\Overwolf\0.99.303.0\Locales" --log-file="C:\Users\<username>\AppData\Local\Overwolf\Log\OverwolfCEF_5424.log" --log-severity=error --user-agent="Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36 OverwolfClient/0.99.303.0" --ppapi-flash-path="C:\Program Files (x86)\Overwolf\0.99.303.0\PepperFlash\pepflashplayer32.dll" --ppapi-flash-version=22.0.0.209 --uncaught-exception-stack-size=20 --enable-pinch --device-scale-factor=1 --font-cache-shared-mem-suffix=5424 --enable-pinch-virtual-viewport --enable-delegated-renderer --num-raster-threads=2 --use-image-texture-target=3553 --channel="5424.2.413453342\550881265" --owapp="<appname> - <windowname>" /prefetch:673131151

 

Hope this helps.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now