io.github.frikit.twirlspec.page

Members list

Type members

Classlikes

The name an assistive technology announces for an element.

The name an assistive technology announces for an element.

A working subset of the accessible name computation: the parts that a server-rendered page can actually be judged on. It does not resolve aria-labelledby chains beyond one hop, and knows nothing that depends on CSS or JavaScript.

This is the one answer to "what is this element called". Every rule that asks the question asks it here, so the same markup cannot pass one check and fail another.

Attributes

Source
AccessibleName.scala
Supertypes
class Object
trait Matchable
class Any
Self type
object Anchors

What makes something on a page worth asserting, and what to call it.

What makes something on a page worth asserting, and what to call it.

Identity is the id, the link, or the tracking attribute rather than a position in the document, so a view asserted in one state still counts as asserted when the same view is rendered in another.

Attributes

Source
Anchors.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Anchors.type

Remembers which elements a spec's assertions actually looked at.

Remembers which elements a spec's assertions actually looked at.

A spec renders the same page many times over — once per test — so the record is kept per coverage group rather than per page instance. A page rendered through the DSL belongs to its spec and, within it, to the renders that produce exactly its markup, unless the spec names a group with coveredAs. The key is spec#group, so a spec's records can be dropped together. A page built directly belongs to no spec and keeps its record on itself, so it never appears here.

Attributes

Source
CoverageRegistry.scala
Supertypes
class Object
trait Matchable
class Any
Self type
object Outline

A readable skeleton of a rendered page.

A readable skeleton of a rendered page.

Attributes

Source
Outline.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Outline.type
object Page

Ways to build a page from rendered HTML.

Ways to build a page from rendered HTML.

Attributes

Companion
class
Source
Page.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Page.type
final class Page(val document: Document, val lang: Lang, val messages: Messages, val source: String, val parseErrors: List[String] = ...)

A rendered page, ready to be asked questions.

A rendered page, ready to be asked questions.

The accessors know GOV.UK and HMRC markup, so a page from another design system is still readable through css, byId, byRole and doc.

Value parameters

document

the parsed markup, repaired where the parser had to

lang

the language the page was rendered in

messages

the messages for that language, used to resolve message keys

parseErrors

what the parser had to repair, up to fifty entries

source

the markup as rendered, before any repair

Attributes

Companion
object
Source
Page.scala
Supertypes
class Object
trait Matchable
class Any
object Roles

Finding elements the way an assistive technology does: by role and accessible name.

Finding elements the way an assistive technology does: by role and accessible name.

Attributes

Source
Roles.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Roles.type
final class Selection

A named set of elements pulled out of a page.

A named set of elements pulled out of a page.

Value parameters

elements

the matches, in document order

name

what the selection is called in failure messages

selector

the CSS selector that produced it, also for failure messages

Attributes

Companion
object
Source
Selection.scala
Supertypes
class Object
trait Matchable
class Any
object Selection

Ways to build a selection.

Ways to build a selection.

Attributes

Companion
class
Source
Selection.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Selection.type
object Text

Whitespace and punctuation normalisation.

Whitespace and punctuation normalisation.

Attributes

Source
Text.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Text.type