ServiceNow ATF - Mocking for outbound REST Messages
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2022 03:36 PM
Hi Community,
My team is developing a Service Portal application in ServiceNow. We have a page with a menu, two widgets, two outbound REST messages, and each widget makes an outbound REST call through oAuth profile to get the data from external source. While writing tests in ATF test suite, how can I mock the outbound REST API calls to resist actual calls to the endpoint ?
I read in a blog that Jasmine can be used to write the scripts for mocking but how can the original API call from the widget be stopped, obtain mock response through Jasmine script and data be passed back to widget while running the ATF ?
Can someone explain in detail, or suggest other methods if possible ? We are stuck at writing Test cases.
Thanks,
Ajay