ContentCoverage

io.github.frikit.twirlspec.quality.ContentCoverage

What a page puts on screen that a spec never asked about.

Rules answer "is this page sound". This answers the other question: "did the spec actually look at it". A view can pass every standard while half of it goes unasserted, because rendering a page is not the same as testing it.

Attributes

Source
ContentCoverage.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

final case class Anchor(kind: String, name: String, path: String)

Something a reader can see or act on, so something a spec ought to assert.

Something a reader can see or act on, so something a spec ought to assert.

Value parameters

kind

id, link or tracking

name

what it is called: an id, a link's words, a tracked attribute and value

path

what tells it from every other anchor, and how it is reported: the name, and for a link where it goes too

Attributes

Source
ContentCoverage.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def anchors(page: Page, trackedAttributes: Set[String] = ..., scope: String = ...): List[Anchor]

Everything on the page, within the scope, that a spec ought to assert.

Everything on the page, within the scope, that a spec ought to assert.

Attributes

Source
ContentCoverage.scala
def report(unasserted: List[Anchor]): String

The unasserted anchors as a readable list, grouped by kind.

The unasserted anchors as a readable list, grouped by kind.

Attributes

Source
ContentCoverage.scala
def unasserted(page: Page, ignored: Set[String] = ..., trackedAttributes: Set[String] = ..., scope: String = ...): List[Anchor]

The anchors on this page that no assertion has touched.

The anchors on this page that no assertion has touched.

Attributes

Source
ContentCoverage.scala
def unassertedOutside(page: Page, selectors: Set[String], ignored: Set[String] = ..., trackedAttributes: Set[String] = ..., scope: String = ...): List[Anchor]

As unasserted, leaving out whatever sits inside something these CSS selectors match: a block a page inherits, which may have no id to name it by and whose words change with the language.

As unasserted, leaving out whatever sits inside something these CSS selectors match: a block a page inherits, which may have no id to name it by and whose words change with the language.

Attributes

Source
ContentCoverage.scala

Concrete fields

val defaultScope: String

A view spec answers for the page's own content, not for the header, footer and cookie banner every page inherits from the layout.

A view spec answers for the page's own content, not for the header, footer and cookie banner every page inherits from the layout.

Attributes

Source
ContentCoverage.scala
val defaultTrackedAttributes: Set[String]

Attributes that mark an element as worth asserting, beyond ids and links.

Attributes that mark an element as worth asserting, beyond ids and links.

Attributes

Source
ContentCoverage.scala