Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. def clearProperties(obj) {
  2. /* clear values for all properties where name ends with '*' and value is not a property expansion
  3. 'obj' can be project, testSuite, testCase, testStep /*/
  4. for (prop in obj.propertyList) {
  5. if (prop.getName().endsWith('*') && (prop.getValue() && !prop.getValue().startsWith('$'))) // value doesn't contain property expansion
  6. prop.setValue("")
  7. }
  8. }
  9.  
  10.  
  11. // clear project level properties
  12. def project = testRunner.testCase.testSuite.project
  13. clearProperties(project)
  14. log.info("Clearing project level properties")
  15. log.info('')
  16.  
  17.  
  18. // for all test suites in the project, clear suite level properties, all test case level properties and test step level properties
  19. for (testSuite in project.getTestSuiteList()) {
  20. clearProperties(testSuite)
  21. log.info("Clearing test suite level properties for: --------------------- ${testSuite.getName()} --------------------")
  22. log.info('')
  23.  
  24. // clear all test case level properties for testSuite
  25. for (testCase in testSuite.getTestCaseList()) {
  26. clearProperties(testCase)
  27. log.info("Clearing test case level properties for: ${testCase.getName()}")
  28.  
  29. // clear all test step level properties for testSCase
  30. for (testStep in testCase.getTestStepList()) {
  31. clearProperties(testStep)
  32. log.info("Clearing test step level properties for: ${testStep.getName()}")
  33. }
  34. log.info('')
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement