From c3435f46652e6a738bb802901f7fd64a7df7d271 Mon Sep 17 00:00:00 2001 From: David Fugate <dfugate@microsoft.com> Date: Mon, 15 Nov 2010 09:52:07 -0800 Subject: [PATCH] Changed the case of a couple of files. --- .../enginereports/testsreportdetailstable.xsl | 152 ++++++++++++++++++ .../testsreportindividualtestdetailstable.xsl | 90 +++++++++++ 2 files changed, 242 insertions(+) create mode 100644 website/enginereports/testsreportdetailstable.xsl create mode 100644 website/enginereports/testsreportindividualtestdetailstable.xsl diff --git a/website/enginereports/testsreportdetailstable.xsl b/website/enginereports/testsreportdetailstable.xsl new file mode 100644 index 0000000000..3dab7b2e5b --- /dev/null +++ b/website/enginereports/testsreportdetailstable.xsl @@ -0,0 +1,152 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" +> + <xsl:output method="html" indent="yes"/> + <xsl:variable name="RED_LIMIT" select="50"/> + <xsl:variable name="YELLOW_LIMIT" select="75"/> + <xsl:variable name="GREEN_LIMIT" select="99.9"/> + <xsl:param name="sectionID" select="14"/> + <xsl:template match="testReport"> + <table id="section-{$sectionID}" width="100%" class="results-data-table" border="0" cellSpacing="0" cellPadding="0"> + <tbody> + <!-- Header --> + <tr class="reportTblHeader"> + <td width="20%" style="text-align:right;"> + Browser: + <br/> + Tests executed: + <br/> + Test Suite Ver.: + <br/> + Test Suite Date: + </td> + <xsl:for-each select="testRun"> + <td> + <xsl:value-of select="browserName"/> + <br/> + <xsl:value-of select="Date"/> + <br/> + <xsl:value-of select="targetTestSuiteVersion"/> + <br/> + <xsl:value-of select="targetTestSuiteDate"/> + </td> + </xsl:for-each> + </tr> + <!-- end Header --> + <xsl:variable name="sec" select="//section[(@id = $sectionID)]"/> + <tr> + <xsl:if test="count($sec/test) > 0"> + <td width="10%"> + <xsl:element name="a"> + <xsl:attribute name="href"> + <xsl:value-of select="concat('javascript:createTestListTable("', $sec/@id ,'");')"/> + </xsl:attribute> + <xsl:value-of select="$sec/@id"/> - <xsl:value-of select="$sec/@name"/> + </xsl:element> + </td> + <xsl:for-each select="$sec"> + + <xsl:variable name="passRate" select="floor((count(test/res[text() ='pass'])) div (count(test)) * 100)"/> + <xsl:variable name="tdClass" select="'reportGreen'"/> + <xsl:call-template name="passRateCell"> + <xsl:with-param name="passRate" select="$passRate"/> + <xsl:with-param name="pass" select="count(test/res[text() ='pass'])"/> + <xsl:with-param name="total" select="count(test)"/> + </xsl:call-template> + </xsl:for-each> + </xsl:if> + </tr> + <xsl:for-each select="$sec//section[not(@id = preceding::section/@id)]"> + <xsl:if test="count(test) > 0"> + <tr> + <td width="10%"> + <xsl:element name="a"> + <xsl:attribute name="href"> + <xsl:value-of select="concat('javascript:createTestListTable("',@id,'");')"/> + </xsl:attribute> + <xsl:value-of select="@id"/> - <xsl:value-of select="@name"/> + </xsl:element> + </td> + + <xsl:variable name="id" select="@id"/> + <xsl:for-each select="//section[@id = $id]"> + <xsl:variable name="passRate" select="floor((count(test/res[text() ='pass'])) div (count(test)) * 100)"/> + <xsl:variable name="tdClass" select="'reportGreen'"/> + <xsl:call-template name="passRateCell"> + <xsl:with-param name="passRate" select="$passRate"/> + <xsl:with-param name="pass" select="count(test/res[text() ='pass'])"/> + <xsl:with-param name="total" select="count(test)"/> + </xsl:call-template> + </xsl:for-each> + </tr> + </xsl:if> + </xsl:for-each> + + + </tbody> + </table> + </xsl:template> + <xsl:template name="passRateCell"> + <xsl:param name="passRate"/> + <xsl:param name="pass"/> + <xsl:param name="total"/> + + <xsl:choose> + <xsl:when test="string($passRate) = 'NaN'"> + <td></td> + </xsl:when> + <xsl:when test="$passRate > $GREEN_LIMIT"> + <xsl:element name="td"> + <xsl:attribute name="class"> + <xsl:value-of select="'reportGreen'"/> + </xsl:attribute> + <!--CSS class are not reflecting in Chrome and Safari because of dynamic generation of table that is why inline style attribute is used--> + <xsl:attribute name="style"> + <xsl:value-of select="' background-color: #63be00;color: #fff;'"/> + </xsl:attribute> + <xsl:value-of select="$passRate"/> % - + <xsl:value-of select="$pass"/>/<xsl:value-of select="$total"/> + </xsl:element> + </xsl:when> + <xsl:when test="$passRate >= $YELLOW_LIMIT"> + <xsl:element name="td"> + <xsl:attribute name="class"> + <xsl:value-of select="'reportLightGreen'"/> + </xsl:attribute> + <!--CSS class are not reflecting in Chrome and Safari because of dynamic generation of table that is why inline style attribute is used--> + <xsl:attribute name="style"> + <xsl:value-of select="' background-color: #63be7b;color: #fff;'"/> + </xsl:attribute> + <xsl:value-of select="$passRate"/> % - + <xsl:value-of select="$pass"/>/<xsl:value-of select="$total"/> + </xsl:element> + </xsl:when> + <xsl:when test="$passRate > $RED_LIMIT"> + <xsl:element name="td"> + <xsl:attribute name="class"> + <xsl:value-of select="'reportYellow'"/> + </xsl:attribute> + <xsl:attribute name="style"> + <xsl:value-of select="'background-color: #f7ba44;color: #fff;'"/> + </xsl:attribute> + <xsl:value-of select="$passRate"/> % - + <xsl:value-of select="$pass"/>/<xsl:value-of select="$total"/> + </xsl:element> + </xsl:when> + <xsl:otherwise> + <xsl:element name="td"> + <xsl:attribute name="class"> + <xsl:value-of select="'reportRed'"/> + </xsl:attribute> + <!--CSS class are not reflecting in Chrome and Safari because of dynamic generation of table that is why inline style attribute is used--> + <xsl:attribute name="style"> + <xsl:value-of select="'background-color: #f85050;color: #fff;'"/> + </xsl:attribute> + <xsl:value-of select="$passRate"/> % - + <xsl:value-of select="$pass"/>/<xsl:value-of select="$total"/> + </xsl:element> + </xsl:otherwise> + </xsl:choose> + </xsl:template> +</xsl:stylesheet> diff --git a/website/enginereports/testsreportindividualtestdetailstable.xsl b/website/enginereports/testsreportindividualtestdetailstable.xsl new file mode 100644 index 0000000000..59fb7889fb --- /dev/null +++ b/website/enginereports/testsreportindividualtestdetailstable.xsl @@ -0,0 +1,90 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" +> + <xsl:output method="html" indent="yes"/> + <xsl:variable name="RED_LIMIT" select="50"/> + <xsl:variable name="YELLOW_LIMIT" select="75"/> + <xsl:variable name="GREEN_LIMIT" select="99.9"/> + <xsl:param name="sectionID" select="'7'" /> + + <xsl:template match="testReport"> + <xsl:variable name="testReport" select="."/> + <xsl:variable name="tableID" select="concat('TestList_',translate($sectionID,'.','_'))"/> + <table id="{$tableID}" width="100%" class="results-data-table" border="0" cellSpacing="0" cellPadding="0"> + <tbody> + <!-- Header --> + <tr class="reportTblHeader"> + <td width="20%" style="text-align:right;"> + Browser: + <br/> + Tests executed: + <br/> + Test Suite Ver.: + <br/> + Test Suite Date: + </td> + <xsl:for-each select="testRun"> + <td> + <xsl:value-of select="browserName"/> + <br/> + <xsl:value-of select="Date"/> + <br/> + <xsl:value-of select="targetTestSuiteVersion"/> + <br/> + <xsl:value-of select="targetTestSuiteDate"/> + </td> + </xsl:for-each> + </tr> + <!-- end Header --> + + <!-- Find all unique testids that belongs to $sectionID --> + <xsl:for-each select="//section[@id = $sectionID]/test[not(./testId = preceding::test/testId)]/testId"> + <xsl:variable name="testId" select="."/> + <tr> + <td> + <xsl:value-of select="$testId"/> + </td> + + <!-- Show test result for each browser --> + <xsl:for-each select="$testReport/testRun"> + <xsl:variable name="test" select="./Tests//section[@id = $sectionID]/test[testId = $testId]"/> + <xsl:call-template name="resCell"> + <xsl:with-param name="test" select="$test"/> + </xsl:call-template> + </xsl:for-each> + </tr> + </xsl:for-each> + </tbody> + </table> + </xsl:template> + + <xsl:template name="resCell"> + <xsl:param name="test"/> + <xsl:element name="td"> + <xsl:if test="$test/res"> + <xsl:choose> + <xsl:when test="$test/res = 'pass'"> + <xsl:attribute name="class"> + <xsl:value-of select="'reportGreen'"/> + </xsl:attribute> + <!--CSS class are not reflecting in Chrome and Safari because of dynamic generation of table that is why inline style attribute is used--> + <xsl:attribute name="style"> + <xsl:value-of select="' background-color: #63be00;color: #fff;'"/> + </xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:attribute name="class"> + <xsl:value-of select="'reportRed'"/> + </xsl:attribute> + <!--CSS class are not reflecting in Chrome and Safari because of dynamic generation of table that is why inline style attribute is used--> + <xsl:attribute name="style"> + <xsl:value-of select="'background-color: #f85050;color: #fff;'"/> + </xsl:attribute> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="$test/res"/> + </xsl:if> + </xsl:element> + </xsl:template> +</xsl:stylesheet> -- GitLab