- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
an hour ago
There's no reliable out-of-box way to capture an existing Automated Test Framework (ATF) Test or Suite into an update set. The supported workaround is manual and tedious. See KB0825608 — Capture an existing ATF Test or Suite in a new update set.
I have created a tool that automates the basic functionality, but does not actually change the files as described in the KB.
https://github.com/jon-lind-sn/atf-adder
What it does
Adds a link to the ATF Test and ATF Test Suite forms, and a bulk list choice and context menu action to the ATF Test and ATF Test Suite lists. Using either will add the selected record(s) and their dependencies to the currently selected update set.
Possible uses include transferring existing update sets between instances or forcing existing tests into an update set to guarantee that it is available for execution by your deployment pipeline (e.g. a custom solution that will execute all included ATF tests in an update set).
How to use it
On a single record:
- Make an update set current, matching the scope of the test/suite you're capturing.
- Open the ATF Test or Test Suite.
- Use the
Add Test to Update SetorAdd Suite to Update Set. You'll get a message confirming what was captured, or an error if something didn't make it in (e.g. wrong update set scope selected). - Alternatively you can right click on a Test or Suite and choose to add it to the current update set.
On multiple records:
- Make an update set current, matching the scope of the tests/suites you're capturing.
- From the ATF Test or ATF Test Suite list, select the records you want to capture.
- Use the
Add Tests to Update SetorAdd Suites to Update Setchoice from "Actions on selected rows...".
Testing
The app ships two ATF tests (of course, right?!) covering the capture logic: "Verify Add Test to Update Set" and "Verify Add Test Suite to Update Set". Run them from ATF like any other test, or via the SDK, e.g.:
npx @servicenow/sdk cicd test run --test-name "Verify Add Test to Update Set"
How to Install
Go to https://github.com/jon-lind-sn/atf-adder and the readme will explain three options to install--Retrieved Update Set, directly from Git via Studio, or using Now-SDK locally.
