Enforce parameter validation in metadata prompt

I use metadata prompt to request user input for some important info that will go to the test report. I have validation rules for the data I request but at the moment the only consequence for the operators is a little exclamation mark next to the problematic field. It doesn’t prevent them to proceed with empty/invalid data which is not acceptable.

Ideally I want to ensure that the data is valid before the operator is even able to press OK. Is there an (easy) way to achieve that?

Alternatively, I’d like to give operators another chance to enter the data in case it’s invalid. I’m aware of ThrowOnValidationError() method and it works well but is there a way to show the prompt again?

To summarize the question, is it possible to enforce data validation in metadata prompt with some decent UX?

This was something we discussed recently, to sum it up I have just added the issue here: Warn user about running a test plan containing validation errors · Issue #849 · opentap/opentap · GitHub

We plan on implementing it in 9.20.

You could add a test step that checks for validation errors during PrePlanRun. and the use UserInput.Request() to ask the user if they want to continue or stop to edit the plan again.

If you want to give the user the chance to enter values, you can also add that in the request.

There is an example of how Userinput.Request works.

Thanks for your input. My question was actually about metadata prompt specifically. I think such functionality is highly desirable there, maybe even more than in test steps.

Anyways, I decided to stop using metadata prompt. As much as I like it, it doesn’t allow me to achieve what I want at the moment. I implemented a custom dialog in the result listener following your suggestion.

@tatiana.boye I’ve submitted an issue to support rule validation in the metadata prompt. Was that the only missing feature you saw with using the Metadata prompts or where there others?

@brennen_direnzo Thanks for following up. I believe rule validation wouldn’t be sufficient as at the moment it doesn’t prevent users from proceeding with invalid data. Being able to disable OK button in case validation is not successful might solve this issue.

1 Like

Got it. Makes sense. I’ve created this related issue as well:

2 Likes