TestR is an automation testing framework. It allows you to automate testing of desktop and web applications.
I was updating support for markdown text editing support in OmniShell and thought it would be nice to add a preview window. If you are not familiar with markdown it's an easy simple way to mark up text that will later become HTML.
Ex. If you had the following markdown.
That would translate into the following HTML.
Back to the feature being added. I started to implement the preview window inside the OmniShell application but was running into some issue. I decide to stop and rethink my approach. The goal is to allow the user to preview the final HTML output.
Hey! Why not just let OmniShell automate a browser via TestR and just send the content over. This way the user could use any browser (coming soon™) and see the final output as it would appear.
I implemented the preview feature to use TestR to launch Internet Explorer and show the final document. In future releases I will add the ability to select any browser. There will also be a feature to point to a website and inherit it style (css) so the content can be viewed render as HTML and styled using the final stylesheets.
Here is how we connected?
_browser = InternetExplorer.AttachOrCreate(); _browser.Application.Refresh(); _browser.NavigateTo("about:blank");
Here is how we update the browser.
var body = _browser?.FirstOrDefault<Body>(); body?.SetHtml(TextPreview);
Very simple and not much code but it brings a lot of value. I hope you can see that TestR not only can help you test and ensure the highest quality product but you can also embed it to provide some pretty awesome value.
Rock On and Become EPIC!