jeudi 8 octobre 2015

Testing multiple assertions separately

I have a test where the check form (desktop application) adds a value to the form, writes, edits the form and checks again. On the first line of the code I have variables:

txtCustomText = '003'
NameTextEdit = 'B 003'
ContractNumberTextEdit = 'U 003'

When I open the form again, because I want to check the values, I use this:

current_textbox =  panel.get_control_by_name(current_form,'txtCustomText')
assert current_textbox.get_text() == txtCustomText, "wrong number"

current_textbox =  panel.get_control_by_name(current_form,'NameTextEdit')
assert current_textbox.get_text() == NameTextEdit, "wrong name"

current_textbox =  panel.get_control_by_name(current_form,'ContractNumberTextEdit')
assert current_textbox.get_text() == ContractNumberTextEdit, 'wrong agreement number'

When the test fails on the first failing assert (of 50) the whole test fails.

Can I do something so that when the first assert fails the other asserts will also be checked?

Aucun commentaire:

Enregistrer un commentaire