Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def clearProperties(obj) {
- /* clear values for all properties where name ends with '*' and value is not a property expansion
- 'obj' can be project, testSuite, testCase, testStep /*/
- for (prop in obj.propertyList) {
- if (prop.getName().endsWith('*') && (prop.getValue() && !prop.getValue().startsWith('$'))) // value doesn't contain property expansion
- prop.setValue("")
- }
- }
- // clear project level properties
- def project = testRunner.testCase.testSuite.project
- clearProperties(project)
- log.info("Clearing project level properties")
- log.info('')
- // for all test suites in the project, clear suite level properties, all test case level properties and test step level properties
- for (testSuite in project.getTestSuiteList()) {
- clearProperties(testSuite)
- log.info("Clearing test suite level properties for: --------------------- ${testSuite.getName()} --------------------")
- log.info('')
- // clear all test case level properties for testSuite
- for (testCase in testSuite.getTestCaseList()) {
- clearProperties(testCase)
- log.info("Clearing test case level properties for: ${testCase.getName()}")
- // clear all test step level properties for testSCase
- for (testStep in testCase.getTestStepList()) {
- clearProperties(testStep)
- log.info("Clearing test step level properties for: ${testStep.getName()}")
- }
- log.info('')
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement