rhyskeepence / clairvoyance

@@ -3,7 +3,6 @@
Loading
3 3
import java.util.UUID
4 4
5 5
import clairvoyance.export._
6 -
import clairvoyance.rendering.Markdown.markdownToXhtml
7 6
import clairvoyance.rendering.Reflection.tryToCreateObject
8 7
import clairvoyance.rendering.{CustomRendering, Rendering}
9 8
import clairvoyance.scalatest.ClairvoyantContext.tagNames
@@ -80,11 +79,9 @@
Loading
80 79
        ${tableOfContentsFor(suiteResult)}
81 80
        ${suiteResult.eventList
82 81
      .map {
83 -
        case ScopeOpenedOrPending(event)  => renderFragmentForBody(event)
84 82
        case event: TestSucceeded         => renderFragmentForBody(event)
85 83
        case TestFailedOrCancelled(event) => renderFragmentForBody(event)
86 84
        case TestPendingOrIgnored(event)  => renderFragmentForBody(event)
87 -
        case event: MarkupProvided        => renderFragmentForBody(event, "markup")
88 85
        // AlertProvided, InfoProvided, and NoteProvided must not show up in the HTML report
89 86
        case _ => ""
90 87
      }
@@ -93,12 +90,6 @@
Loading
93 90
    </body>
94 91
    """
95 92
96 -
  private def renderFragmentForBody(event: ScopeOpenedOrPending): String =
97 -
    stringToPrintWhenNoError(event.formatter, event.nameInfo.suiteName) match {
98 -
      case Some(string) => markdownToXhtml("# " + string)
99 -
      case None         => ""
100 -
    }
101 -
102 93
  private def renderFragmentForBody(event: TestSucceeded): String = {
103 94
    val (suiteClassName, testName, testText, duration) =
104 95
      (event.suiteClassName.get, event.testName, event.testText, event.duration)
@@ -109,12 +100,11 @@
Loading
109 100
110 101
    s"""
111 102
    <a id="${linkNameOf(testText)}"></a>
112 -
    <div class="testmethod">
113 -
      ${markdownToXhtml(s"## $testText")}
103 +
    <div class="testmethod test-passed">
114 104
      <div class="scenario" id="${testName.hashCode().toString}">
115 -
        ${renderSpecification(annotations, suiteClassName, event)}
105 +
        ${renderSpecification(testName, annotations, suiteClassName, event)}
116 106
        <h2>Execution</h2>
117 -
        <pre class="highlight results test-passed highlighted">${duration.fold("")(
107 +
        <pre class="highlight results highlighted">${duration.fold("")(
118 108
      milliseconds => s"Passed in $milliseconds ms"
119 109
    )}</pre>
120 110
        ${interestingGivensTable(testState, rendering)}
@@ -125,6 +115,7 @@
Loading
125 115
  }
126 116
127 117
  private def renderSpecification(
118 +
      testName: String,
128 119
      annotations: Set[Tag],
129 120
      suiteClassName: String,
130 121
      event: TestSucceeded
@@ -138,8 +129,8 @@
Loading
138 129
      )
139 130
140 131
      s"""
141 -
        <h2>Specification</h2>
142 -
        <pre class="highlight specification">${spec}</pre>
132 +
        <h2>$testName</h2>
133 +
        <code class="highlight specification">$spec</code>
143 134
        """
144 135
    } else ""
145 136
  }
@@ -184,8 +175,8 @@
Loading
184 175
        )
185 176
186 177
        s"""
187 -
        <h2>Specification</h2>
188 -
        <pre class="highlight specification">${spec}</pre>
178 +
        <h2>${event.testName}</h2>
179 +
        <code class="highlight specification">$spec</code>
189 180
        """
190 181
      } else
191 182
        ""
@@ -193,20 +184,19 @@
Loading
193 184
194 185
    s"""
195 186
    <a id="${linkNameOf(event.testText)}"></a>
196 -
    <div class="testmethod">
197 -
      ${markdownToXhtml("## " + event.testText)}
187 +
    <div class="testmethod test-failed">
198 188
      <div class="scenario" id="${event.testName.hashCode().toString}">
199 -
        ${specification}
200 -
        <h2>Execution</h2>
201 -
        <div class="highlight results test-failed highlighted" style="margin-bottom: 1em">
189 +
        $specification
190 +
        <h2>${event.testName}</h2>
191 +
        <div class="highlight results highlighted" style="margin-bottom: 1em">
202 192
          ${event.duration
203 -
      .map(milliseconds => s"<span>${event.name} after ${milliseconds} ms</span><br/>")
193 +
      .map(milliseconds => s"<span>${event.name} after $milliseconds ms</span><br/>")
204 194
      .getOrElse("")}
205 195
          <pre>&gt; ${event.message}</pre>
206 196
          <span class="detailstoggle">
207 -
            <a id="${linkId}" href="#" onclick="{ toggleDetails('$contentId', '$linkId'); return false; }">[ show stacktrace ]</a>
197 +
            <a id="$linkId" href="#" onclick="{ toggleDetails('$contentId', '$linkId'); return false; }">[ show stacktrace ]</a>
208 198
          </span>
209 -
          <div id="${contentId}" style="display: none; margin-top: 1em">
199 +
          <div id="$contentId" style="display: none; margin-top: 1em">
210 200
            ${grayStackTraceElements.map(
211 201
      ste => s"""<div style="color: #CCADAD">${ste.toString}</div>)"""
212 202
    )}
@@ -254,7 +244,7 @@
Loading
254 244
    )
255 245
256 246
    s"""
257 -
        <div style="${interactionStyle}">${interactions.mkString("\n")}</div>
247 +
        <div style="$interactionStyle">${interactions.mkString("\n")}</div>
258 248
        <div style="display: inline">${diagrams.mkString("\n")}</div>
259 249
      """
260 250
  }
@@ -262,8 +252,7 @@
Loading
262 252
  private def renderFragmentForBody(event: TestPendingOrIgnored): String =
263 253
    s"""
264 254
    <a id={linkNameOf(event.testText)}></a>
265 -
    <div class="testmethod">
266 -
      ${markdownToXhtml("## " + event.testText)}
255 +
    <div class="testmethod test-not-run">
267 256
      <div class="scenario" id=${event.testName.hashCode().toString}>
268 257
        <h2>Specification</h2>
269 258
        <pre class="highlight specification">${SpecificationFormatter.format(
@@ -273,25 +262,11 @@
Loading
273 262
      codeFormatFor(event.suiteClassName)
274 263
    )}</pre>
275 264
        <h2>Execution</h2>
276 -
        <pre class="highlight specification test-not-run">${event.name}</pre>
265 +
        <pre class="highlight specification">${event.name}</pre>
277 266
      </div>
278 267
    </div>
279 268
  """
280 269
281 -
  private def renderFragmentForBody(event: MarkupProvided, cssClass: String): String =
282 -
    markdownToXhtml(event.text)
283 -
284 -
  private def stringToPrintWhenNoError(
285 -
      formatter: Option[Formatter],
286 -
      suiteName: String
287 -
  ): Option[String] = {
288 -
    formatter match {
289 -
      case Some(IndentedText(_, rawText, _)) => Some(rawText)
290 -
      case Some(MotionToSuppress)            => None
291 -
      case _                                 => Some(suiteName)
292 -
    }
293 -
  }
294 -
295 270
  private def renderingFor(className: String): Rendering =
296 271
    new Rendering(tryToCreateObject[CustomRendering](className))
297 272
Files Coverage
core/src/main/scala/clairvoyance 74.69%
scalatest/src/main/scala/clairvoyance/scalatest 58.21%
Project Totals (29 files) 67.19%
139.1
TRAVIS_JDK_VERSION=openjdk11
TRAVIS_OS_NAME=linux
139.2
TRAVIS_JDK_VERSION=openjdk11
TRAVIS_OS_NAME=linux

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading