Firing the Test_CanPost Event
There is workflow that adds the following to the test plan description field when a new test is created (i.e. via Test_New):
Test_Fields("TS_DESCRIPTION").Value = _
"<html><body><BR><b>Summar y:</b>" & _
"<br><br><br><b>Pre-Conditions:</b>" & _
"<br><br><br><b>Post-Conditions:</b>" & _
"<br><br><br><b>Test Data:</b>" & _
The requirement is that something be entered for Summary, Pre-Conditions, Post-Conditions and Test Data (Notes remains optional). This I have accomplished satisfactorily in the Test_CanPost event.
There are no problems at all when making changes to an existing test. The challenge is with a new test.
When the Test_New event fires, I set a flag so I know not to display messages about the Description field missing one of the required pieces (they are all missing until the user provides them). I must do this because the Test_CanPost method fires right after the Test_New, posting the test before the user has had an opportunity to do anything.
Once the user types just one character into the Description field, somewhere QC sets a flag that lets it know Description has changed and thus when the user navigates away from the test, the Test_CanPost event fires and any necessary messaging is displayed. All is good.
Problem: If the user does not interact with the Description field, the Test_CanPost event does not fire.
Question: Can something be done so that when the test loses focus in the test plan tree, the Test_CanPost event fires again anyway?
I hope I've described this issue clearly. If I need to post code, I can - I tried to avoid it because its a lot of code.