Unit testing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2015 12:07 PM
Hello,
I'm curious about what people are doing for unit testing in ServiceNow and if there are any plans to increase this capability. To me it seems like a huge hole and something that can improve the reliability and maintainability of the platform. We've created GUI tests in the past using Selenium, but It'd be hugely beneficial to have unit testing capabilities for javascript code that we create. There seems to be Qunit plugins that showed up for the developer instances, but I've failed to get them to install/work. The one discussion(Unit testing utility that seems to be out there seems to have died.
Thanks!
Dan
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2017 05:37 AM
Hi Daniel,
I am intersted in something similar and I have started to investigate it little bit. I would like to find something like JUnit for Java dev so that I could create easily tests for Script Includes where most of the logic resides and thanks to those tests being easily able to refactore existing scripts (as currently refactoring is hard if you have no fast way how to confirm you did not break it).
I have found so far this:
- Unit Test Utility - Test Driven Development as we move closer to PaaS - this is from 2012 and probably not maintained anymore
- UnitTestNOW - How to Use UnitTestNOW | Sensible ServiceNow - I did not test this yet
- Automated Test Framework (Istanbul release) - this is ootb and so far I was able to run there a test for my script include using "Run Server Side Script" step and it worked, but it does not look to be specifically designed for Unit Testing of Script Includes as you would ideally wanted to have unit test possibly linked to script include so that you can run it from Script Include directly to quickly double check your changes.
My approach for unit tests was also so far to create another Script Include with same name + Test and write all unit tests of that script include in there and provide overall function to execute all tests. I was then running it in background script. This was just a workaround for one complex script include where I needed to make sure that calculations are correct and I can quickly recheck this anytime.
I would be happy if anybody can share their experience with TDD and unit testing in ServiceNow.
Best regards,
Dominik