| Loop and event handler [message #1744697]
||Thu, 29 September 2016 14:35
| Jim 20100
Registered: June 2016
I have a tree component.
For one parent node, I would like to select each child, get the price and make the sum.
At the end the sum of the children price must be equal to the parent node price.
Let say I limit my case to 3 children max.
Here is my test case
Test case: Main
- Select parent node
- Store the parent node price
- Call test case: "Calculate my children price"
- Check Parent Node price = Children Node price
Test Case: "Calculate my children price"
init price child1:0
init price child2:0
init price child3:0
Select Child 1
store price Child 1
Select Child 2
store price Child 2
Select Child 3
store price Child 3
Event Handler: check: sum children price = parent price
Event type : return
Of course if I have 2 nodes only, the event handler is called.
Whatever I will do, finally, the reporting says that the test failed?
So What I do not understand is The test result report.
As you understand when the event handler is called, it is not a real error.
I want just that my test case returns.
Then I check the values, even if the check is ok, the testing report says that the test case failed, cause of course the event handler was detected.
I don't understand how to manage such simple loop, and finally get ok "Test case success, the sum of parent node = sum of chidren".
I don't understand what is the gain to use the event handlers, if finally the test is marked as failed?
|Re: Loop and event handler [message #1744930 is a reply to message #1744812]
||Mon, 03 October 2016 05:57
| Dominik Gabriel
Registered: June 2013
i had a similar problem and have no solution for that yet. but i think that this thing with build a sum of all children should be tested in unit test and in the ui test it should be at maximum one little smoke test to see if the values are shown the correct way|
i don't have a problem with a variables in event handler. you can store the initial value of the variable in the case itself and in the event handler you in-/de-crement the variable
[Updated on: Mon, 03 October 2016 05:59]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02665 seconds