Done checkbox

Oct 5, 2011 at 8:39 PM

Upon reviewing the source, it appears the Done checkbox is not implemented on load or save. I need this feature if possible, so I'd be happy to investigate and contribute as needed.

Oct 6, 2011 at 1:40 AM
Edited Oct 6, 2011 at 1:41 AM

Hi Steffan,

The reason the Done state for each step does not save is that there is no field in the default Test Case work item that corresponds to it. It was added as a simple way to keep track of your progress as you work through steps, editing them or doing a dry run.

I can think of a couple of ways to implement this:

  • Persist a record of the Done state for each test case in the user's local application data folder. If the test case is edited elsewhere and steps are added or removed, there could be a problem with the checkboxes landing on different steps when the test is reopened.
  • Add a setting to the Test Steps Editor for the name of a field on the Test Case work item type to save the Done state in. This would probably work better in multi-user environments but would require more work on the end-user's part.

If you would like to contribute this, please feel free to pull down the source and create a new item in the Issue Tracker with a .ZIP of a patch.

Oct 6, 2011 at 5:27 PM

Seems I misunderstood the meaning of the checkbox then.  I presumed it was intended to manually manipulate the ITestStep TestStepType.  It appears that Test Manager toggles this based on ExpectedResult being valued (ValidateStep) or not (ActionStep).  That level of control is really all I need, so I can just make a small change to make Test Steps Editor consistent with Test Manager.  I'll attach a zip of the updated class when I am done. 

Oct 6, 2011 at 5:32 PM
Edited Oct 6, 2011 at 5:35 PM

I don't think current users would like it if the behavior of the Done checkbox changes.

If I understand you correctly, you're referring to the Microsoft Test Manager behavior of displaying a check mark on the icon of a test step when it has an expected result. I can't see a way to change this state in MTM other than clearing the Expected Result. Is there another way?

If it really is useful to have a separate indication of whether a step has an expected result, I would put it in the left-hand row header area by overriding OnCellPainting in the DataGridView.

Oct 6, 2011 at 5:43 PM

I'm not suggesting the existing checkbox functionality or the Test Steps Editor UI change.  I don't even think the checkmark on the icon back in VS is that useful, but I want steps saved in TSE to be more consistent with steps saved in MS TM.  Somewhat trivial, I agree, but I would think consistency would be desirable and it would be an easy change.  Just be a couple of lines in the save is all I am proposing:

// directly apply to existing ITestSteps
if (testCase.Actions[stepNumber] is ITestStep)
	((ITestStep)testCase.Actions[stepNumber]).Title = new ParameterizedString(step.Title);
	((ITestStep)testCase.Actions[stepNumber]).ExpectedResult = new ParameterizedString(step.ExpectedResult);
	((ITestStep)testCase.Actions[stepNumber]).TestStepType = string.Empty == step.ExpectedResult ? TestStepType.ActionStep : TestStepType.ValidateStep;
// current action is not ITestStep: if user-entered data is a step
else if (step.IsTestStep())
	// insert a new action at this point
	var newAction = testCase.CreateTestStep();
	newAction.Title = new ParameterizedString(step.Title);
	newAction.ExpectedResult = new ParameterizedString(step.ExpectedResult);
	newAction.TestStepType = string.Empty == step.ExpectedResult ? TestStepType.ActionStep : TestStepType.ValidateStep;

	testCase.Actions.Insert(stepNumber, newAction);
Oct 6, 2011 at 7:39 PM

Ah, thanks fo clarifying. Can you tell me what the current behavior is? Are all steps that you add in the TFS Test Steps editor set to TestStypeType.ActionStep regardless of whether they have expected result?

Oct 6, 2011 at 7:47 PM

Yes, current behavior is it remains ActionStep (presumably the default) regardless.  I've been running the app as modified above; I wouldn't say it's been fully tested, but so far it's done what I expect.

Jan 12, 2012 at 2:18 PM

Thanks for this report. I checked in the change but I don't have enough updates to warrant a new release yet.