Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

Hiding custom field in test cases


#1

Hello,

is it possible to hide custom fields in test cases in certain projects?
I want to use the custom field as a unique key for each test case and use the REST API to update test cases from a master project to other other projects that use the same test cases. Basically I want to maintain the tests in one project and use them in several other projects and run scripts for automatic updates. The custom field that I want to use as a key then needs to be hidden in all projects and for all users except in the master project where I maintain the tests.
Thanks,
Petter


#2

It seems this issue has been discussed in a related form:

Suppose I have created a field called ´test-key´. How can I hide it in edit/add mode of the test case?


#3

I figured this out myself - after having researched JavaScript and jQuery a bit:
name: Hide field
description: Hides a field when editing or adding test cases
author: Gurock Software
version: 1.0
includes: ^cases/(add|edit|view)
excludes:

js:
(document).ready(function() { if (uiscripts.context.user.role_id != 1) { (’#custom_testkey’).parent(‘td’).hide();
}
}
);

css:
div.some-class {
}


#4

Hello Petter,

Thanks for your posting and great to hear that you solved it already. There are other places where the custom field would still be displayed (reports, print views, three-pane view) and it’s not really possible to hide this via UI scripts. I still think this approach makes sense and the fields are hidden from the most relevant pages with the UI script.

Cheers,
Tobias