ATF Jasmine "Hello World" Test fails with message Testing Incomplete (check that all asynchronous functions made their callbacks)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2019 02:49 PM
I tried the simplest test that I could conceive by uncommenting the provided code for a "Run Server Side Script" activity. It failed. What am I missing?
- Labels:
-
Automated Test Framework

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2019 06:53 PM
Hi
Jasmine executions require Jasmine tests to be present. You can refer some examples in the official document: https://jasmine.github.io/2.0/introduction.html
Here is a quick list:
- The tests are written in a callback function. The tests are written as "expect"
- The test callback needs to be passed to a function named 'it'. Its first parameter is the name of the test, e.g. "Test Assertion" and second is the callback
- All the IT's in your test can be wrapped in a test suite function called "describe"
- All of this have to be inside the IIFE block:
(function(outsputs, steps, stepResult, assertEqual) { describe('hello world', function(){ it('should match string', function() { var expectedValue = "a"; expect(a).toBe("a"); }); }); }(outpus, steps, stepResult, assertEqual)
--
Best Regards
Ankush
P.S. Please mark helpful/correct as appropriate to help the fellow community member in identifying the relevant answers.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2019 09:52 PM
Hi,
I see that your code lies outside of the function. You need to write your codes within the function. Please find the code below:
(function(outputs, steps, stepResult, assertEqual) {
// add test script here
var testAssertion = {
name: "my test assertion",
shouldbe: "2019-12-17 12:00:00",
value: "2019-12-17 12:00:00",
};
assertEqual(testAssertion);
})(outputs, steps, stepResult, assertEqual);
// uncomment the next line to execute this script as a jasmine test
jasmine.getEnv().execute();
Please find a link below for reference:
Kindly mark my answer as Correct and Helpful based on the Impact.