Is it possible to call assert with my own test result (Pass or Fail)?
I would like to know if it's possible if I validate the test results with my own logics then call the assertion script to either pass/true or fail/false based on my own reasoning? thanks
Solved! Go to Solution.
Are you trying to validate each testcase with 'Script Assertion (groovy script)'?
If so, then you can pass or fail that script by using 'assert' then pass a true or false (boolean) condition on it, true (passed), false (failed)
e.g. def getTotalNumbers = totalNumbersFromResponse; def expectedTotal = 10; assert getTotalNumbers == expectedTotal; // if both matches, your testcase will pass, else fail
thanks. I didn't know why I didn't do this "assert true"
The reason I want to validate my own test result because I test one of the features that member requires license to perform the operation. Since the license team hasn't fixed their defects and I cant fail that tested feature because the developer who owns that feature says it's not the functionality fault, it's the requirement does not meet so he wants me to pass the test case rather fail or block it. Sometimes developers just have their own reasoning when deciding whether to pass or fail the test.