We at 2GIS have also faced problem of Windows Phone automation and tried to come up with a solution.
First we developed Selenium-based driver for Windows Phone 8.1 automation that required modification of app under test (it is already working driver that we use in our company, it can be found here https://github.com/2gis/Winium.StoreApps).
But what we really wanted was to develop driver that will allow testing of any application without any modification, just like Appium does. Recently we were working on a prototype of Appium like driver. I've recently discovered your repository https://github.com/appium/windows-phone-8-bootstrap.
Our solution is based on ideas similar to yours. But instead of compiling test project on each command use coded ui test with infinite loop and running http server (based on socket server).
You can find repository here https://github.com/2gis/Winium.StoreApps
It is in early prototype stage, requiring you to manually deploy tested app to emulator or device and determine ip address of emulator or device. But we already have code base from our previous project that can help us automate it.
The solution consits of two main parts: Winium.StoreApps.CodedUITestProject and Winium.StoreApps.Driver.
Winium.StoreApps.CodedUITestProject is main worker, it is looped coded ui test with http server.
Winium.StoreApps.Driver is driver that listens for JsonWireProtocol commands and forwards most of them to Winium.StoreApps.CodedUITestProject, also it would be responsible for deploying app under test to emulator or device, determining ip address of coded ui test server, and other stuff that can only be done outside windows phone.
To clarify process:
- Winium.StoreApps.Driver (Driver) starts to listen for JsonWireProtocol commands
- When NewSession command is accepted
2.1. Driver deploys app to emulator or device (starting emulatr if needed). Not implemented in prototype at the moment
2.2. Driver runs Winium.StoreApps.CodedUITestProject (which contains HTTP server) using vs.test.console
2.3. CodedUITestProject sarts to listen for commands on predefined port
2.3. Driver discovers emulator or device ip adress
Now we have driver running on a Windows desktop, and your app under test and CodedUITestProject running on Windows Phone. Back to driver.
- Driver receives some command, like FindElement or ClickElement
3.1. Driver forwards this command using http request to the ip address
3.2. CodedUITestProject receives command
3.3. CodedUITestProject processes command
3.4. CodedUITestProject returns command result in HTTP response
3.5 Driver forwards response back to test client/user
Step 3 repeats as many times as needed/defined by tests
- Driver receive Close command
4.1. Driver kills vs.test.console process, essentially killing running CodedUITestProject server on Windows Phone