Adding settings to the testplan

Hello everyone,

how can I add settings to the testplan so they are generally available then in the editor? I want them to be like for example a field like the testplan name or the description. I saw that it was possible to do it, because the Runner package also adds a new field there called Capabilities. I could not figure out though how this could work.

Hi @mavo1,

There are a few different ways you could do this.

In Runner it is done using a custom “IStackedTypeDataProvider”. In essence what it does is creating a new virtual type that wraps the regular TestPlan type and adds additional members.

There is an example of that in the SDK Examples: opentap/sdk/Examples/PluginDevelopment/Advanced Examples/AttachedPropertyExample.cs at main · opentap/opentap · GitHub

However, I would probably recommend creating a mixin for it instead. That is a bit easier provided that you are ok with the user having to manually add it.

You can read about mixins in the developer guide: Test Step | OpenTAP

You could also do a hybrid approach where you don’t build type wrapper but just use the ITypeDataProvider as a place to programatically inject the mixin into test plans that does not already have it.

Thanks a lot for your answer. I got it to work with the IStackedTypeDataProvider now. I needed it to be there by default instead of added by the user, which is why unfortunately I couldnt use mixins for this case.