Commits

Bob Swift committed 98d9369

GINT-50: Put documentation after test for Confluence macro tests

Comments (0)

Files changed (1)

src/main/groovy/org/swift/tools/GintCmdGenerator.groovy

         if (!isStorageFormat) { // don't want to handle conversion here, so just ignore the end for now
             content.append (parameters?.macroPageBegin ?: '')
         }
+        content.append "\n\nh4. Test"
+        content.append('\n')
+
+        if ((testcase.wiki == true) || ((parameters?.wiki == true) && (testcase.wiki != false))) {  // legacy wiki support
+            content.append "\n{wiki}"
+        }
+        content.append getMacroContent(testcase, parameters, isStorageFormat)
+        if ((testcase.wiki == true) || ((parameters?.wiki == true) && (testcase.wiki != false))) {
+            content.append "\n{wiki}"
+        }
 
         // Add documentation section unless specifically requested to omit - usually because noformat is used in body
         if (testcase.omitDocumentation != true) {
                 content.append getMacroPageContentHeadSection(testcase, parameters, isStorageFormat)
             }
         }
-        if ((testcase.wiki == true) || ((parameters?.wiki == true) && (testcase.wiki != false))) {  // legacy wiki support
-            content.append "\n{wiki}"
-        }
-        content.append getMacroContent(testcase, parameters, isStorageFormat)
-        if ((testcase.wiki == true) || ((parameters?.wiki == true) && (testcase.wiki != false))) {
-            content.append "\n{wiki}"
-        }
+
         content.append('\n')
         if (!isStorageFormat) { // don't want to handle conversion here, so just ignore the end for now
             content.append (parameters?.macroPageEnd ?: '')
     protected getMacroPageContentHeadSection(final Map testcase, final Map parameters, final boolean isStorageFormat = false) {
         def content = new StringBuilder()
 
+        content.append "\n\nh4. Documentation"
+        content.append('\n')
         content.append "\n || Macro | ${testcase.macro} |"
         if (testcase.description) {
             content.append "\n || Description | ${testcase.description} |"
         if (testcase.afterText) {
             content.append "\n || After text | {noformat:nopanel=true} ${testcase.afterText} {noformat} |"
         }
-        content.append "\n\nh4. Test"
-        content.append('\n')
         return content.toString()
     }