Skip to main content

B4A.UTIL.DOCU.BODY-PM-COMPLIANCE

Description

Details

PropertyValue
TypeDOCU
FolderPACKAGES/BEST4AUTOMIC/B4A.UTIL/CONFIG
Titlemail body for pm.Compliance
Archive Key 1-
Archive Key 2-
CreatedAndreas Büsching am: 2022-02-19 15:53:17
Last ModifiedTimon Schnakenberg am: 2024-01-04 11:34:17 10 x
Last Used-

Text Documentation

%{XML2ATTR,PREFIX=xml:%(custom.variable):}

%{SCRIPT:groovy:
def result = [
Succeeded : 0,
Warned : 0,
Failed : 0
]

def variable = $attributes.xml
for ( String testName : variable.keySet() ) {
println( "TEST: " + testName )
def testReport = variable[ testName ].best4Automic.pm.compliance.tests.test
result[ testReport.result ] = result[ testReport.result ] + 1
}
def errors = result.Warned + result.Failed > 0

$output.append( """\
<h1>Summary</h1><table><tr><th>Status</th><th>Count</th></tr><tr><td>Succeeded</td><td>$result.Succeeded</td></tr><tr><td>Warned</td><td>$result.Warned</td></tr><tr><td>Failed</td><td>$result.Failed</td></tr></table>""" )

if ( result.Failed > 0 ) {
$output.append( "<h1>Failed Tests</h1>" )

for ( String testName : variable.keySet() ) {
def testReport = variable[ testName ].best4Automic.pm.compliance.tests.test
if ( testReport.result != "Failed" )
continue;
$output.append( """\
<h2>Test: $testReport.title</h2><pre>$testReport.details</pre>""")
}
}

if ( result.Warned > 0 ) {
$output.append( "<h1>Warned Tests</h1>" )

for ( String testName : variable.keySet() ) {
def testReport = variable[ testName ].best4Automic.pm.compliance.tests.test
if ( testReport.result != "Warned" )
continue;
$output.append( """\
<h2>Test: $testReport.title</h2><pre>$testReport.details</pre>""")
}
}
}

XML Documentation

<Content>

</Content>