Skip to content

Commit

Permalink
1. Added docs for methods
Browse files Browse the repository at this point in the history
2. Added remaining unit tests
3. Removed redundant spaces.
  • Loading branch information
vineeth Hanumanthu committed Jul 30, 2019
1 parent 56091eb commit a5fe993
Show file tree
Hide file tree
Showing 10 changed files with 425 additions and 405 deletions.
83 changes: 3 additions & 80 deletions src/Microsoft.TestPlatform.Extensions.HtmlLogger/Html.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

xmlns:tp="http://schemas.datacontract.org/2004/07/Microsoft.VisualStudio.TestPlatform.Extensions.HtmlLogger"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxs tp"
>
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxs tp">
<xsl:output method="html" indent="yes"/>
<xsl:template match="/">
<html>
Expand Down Expand Up @@ -37,12 +36,9 @@

<xsl:template match="/tp:TestResults">
<h2>Summary</h2>

<xsl:apply-templates select ="/tp:TestResults/tp:Summary"/>

<h2>Results</h2>
<xsl:apply-templates select ="/tp:TestResults/tp:Results"/>

</xsl:template>

<xsl:template match="/tp:TestResults/tp:Results">
Expand All @@ -51,136 +47,78 @@
</xsl:template>

<xsl:template match="tp:TestResults/tp:Summary">
<!--<table id="testtable">
<tr>
<th>Total Tests</th>
<th>Failed Tests</th>
<th>Passed Tests</th>
</tr>
<tr>
<td>
<xsl:value-of select="tp:TotalTests"/>
</td>
<td>
<xsl:value-of select="tp:FailedTests"/>
</td>
<td>
<xsl:value-of select="tp:PassedTests"/>
</td>
</tr>
</table>-->
<xsl:apply-templates select ="/tp:TestResults/tp:Summary/tp:TotalTests"/>
<xsl:apply-templates select ="/tp:TestResults/tp:Summary/tp:FailedTests"/>
<xsl:apply-templates select ="/tp:TestResults/tp:Summary/tp:PassedTests"/>

</xsl:template>






<xsl:template match="tp:TestResult">
<div onclick="ToggleClass('{generate-id()}')" style="border:3px solid grey;cursor:pointer; width:100%;">

<div>

<xsl:apply-templates select = "tp:resultOutcome" />
<xsl:apply-templates select = "tp:FullyQualifiedName" />
<div style="float:right;">
<xsl:apply-templates select = "tp:Duration" />
</div>

</div>


<!--<div style="width:60%;">
<xsl:apply-templates select = "tp:FullyQualifiedName" />
</div>-->

<!--<xsl:apply-templates select = "tp:DisplayName" />-->
<xsl:if test ="tp:ErrorMessage!=''">
<xsl:apply-templates select = "tp:ErrorMessage" />
</xsl:if>
<xsl:if test ="tp:ErrorStackTrace!=''">
<xsl:apply-templates select = "tp:ErrorStackTrace" />
</xsl:if>


<xsl:if test ="tp:innerTestResults!=''">
<a Id="{generate-id()}" style="display:none;">
<h3>innerTestResults:</h3>
<h3>Child Test Results:</h3>
<xsl:apply-templates select = "tp:innerTestResults" />
</a>
<!--<br/>-->
</xsl:if>
<br />
</div>
</xsl:template>


<xsl:template match="tp:innerTestResults/tp:TestResult">
<div onclick="ToggleClass('{generate-id()}')" style="border:3px solid grey;cursor:pointer; width:100%;">

<div>

<xsl:apply-templates select = "tp:resultOutcome" />
<xsl:apply-templates select = "tp:FullyQualifiedName" />
<div style="float:right;">
<xsl:apply-templates select = "tp:Duration" />
</div>

</div>


<!--<div style="width:60%;">
<xsl:apply-templates select = "tp:FullyQualifiedName" />
</div>-->

<!--<xsl:apply-templates select = "tp:DisplayName" />-->
<xsl:if test ="tp:ErrorMessage!=''">
<xsl:apply-templates select = "tp:ErrorMessage" />
</xsl:if>
<xsl:if test ="tp:ErrorStackTrace!=''">
<xsl:apply-templates select = "tp:ErrorStackTrace" />
</xsl:if>


<xsl:if test ="tp:innerTestResults!=''">
<a Id="{generate-id()}" style="display:none;">
<h3>innerTestResults:</h3>
<xsl:apply-templates select = "tp:innerTestResults" />
</a>
<!--<br/>-->
</xsl:if>
<br />
</div>
</xsl:template>


<xsl:template match = "tp:ErrorMessage">
ErrorMessage: <span style = "color:brown;">
<xsl:value-of select = "." />
</span>
<br />
</xsl:template>

<xsl:template match = "tp:ErrorStackTrace">
ErrorStackTrace: <span style = "color:brown;">
<xsl:value-of select = "." />
</span>
<br />
</xsl:template>

<xsl:template match = "tp:FailedTests">
<span style = "width:10%">
FailedTests:
</span>
<span style = "color:brown;padding-right:10px;">
<xsl:value-of select = "." />
</span>

<br />
</xsl:template>
<xsl:template match = "tp:PassedTests">
Expand All @@ -201,16 +139,13 @@
</span>
<br />
</xsl:template>

<xsl:template match = "tp:DisplayName">
DisplayName:<span style = "color:brown;">
<xsl:value-of select = "." />
</span>
<br />
</xsl:template>

<xsl:template match = "tp:resultOutcome">
<!--<xsl:text> &#x2714; </xsl:text>-->
<xsl:if test ="tp:resultOutcome!='Passed'">
<xsl:text> &#x2714; </xsl:text>
</xsl:if>
Expand All @@ -220,38 +155,26 @@
<span style = "color:brown;padding-right:10px;">
<xsl:value-of select = "." />
</span>

</xsl:template>

<xsl:template match = "pass">
<span style = "color:brown;padding-right:10px;">
&#x2714;
</span>
</xsl:template>

<xsl:template match = "fail">
<span style = "color:brown;padding-right:10px;">
&#x2718;
</span>
</xsl:template>

<xsl:template match = "tp:Duration">
Duration:<span style = "color:brown;">
<span style = "color:brown;">
<xsl:value-of select = "." />
</span>
<br />
</xsl:template>

<xsl:template match = "tp:FullyQualifiedName">
<span style = "color:brown">
<xsl:value-of select = "." />
</span>
</xsl:template>


<!--<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>-->
</xsl:stylesheet>
Loading

0 comments on commit a5fe993

Please sign in to comment.