SeleniumHQ is a free set of tools and APIs that allow you to simulate user actions in a browser, locate html elements such as buttons, inputs, send clicks and so on... This is what our development team is using, among other tools, to automate tests with the viewer.
I'm a big Node.js addict, so I tested again Node. The steps involved to set it up on your machine are very easy:
1/ Download the Selenium server from their download section
2/ The version at the time of this writing (2.48.2) requires Java SDK7 to be installed, so you may need to update your Java setup
3/ Run the Selenium server: Java -jar path-to-selenium-srv.jar
4/ Write your test and run it based on the framework you selected. If you are using Node, an npm package is available: selenium-webdriver
I created a basic test which already does a bit of work:
- It will start a web browser using the url of my gallery at http://gallery.autodesk.io. My test supports firefox and chrome (an additional chromedriver package is required for chrome and the setup is slightly different).
- It will then wait for the model buttons to appear and will open a specific one: Engine
- Once the model is loaded, it will open the extension manager dialog and successively toggle each extension On and OFF. Some extensions are displaying an alert dialog, so a specific handling in that case is needed
That's it. Obviously each extension would require to write a specific test in order to be tested properly and some maybe tricky, but this is already a decent start. I'm also attempting to access the browser console output but I couldn't get it to work properly so far... Work in progress.
Here is the full node.js script of my selenium test: