yesod-test-1.6.19: integration testing for WAI/Yesod Applications

Safe Haskell | Safe-Inferred
Language | Haskell2010

Yesod.Test.CssQuery

Description

Parsing CSS selectors into queries.

Synopsis

- data SelectorGroup
  - = DirectChildren [Selector]
  - | DeepChildren [Selector]
- data Selector
  - = ById Text
  - | ByClass Text
  - | ByTagName Text
  - | ByAttrExists Text
  - | ByAttrEquals Text Text
  - | ByAttrContains Text Text
  - | ByAttrStarts Text Text
  - | ByAttrEnds Text Text
- parseQuery :: Text -> Either String [[SelectorGroup]]

# Documentation

data SelectorGroup Source #

Constructors

DirectChildren [Selector] |
DeepChildren [Selector] |

#### Instances

Instances details

Show SelectorGroup Source # |
Instance details Defined in Yesod.Test.CssQuery Methods showsPrec :: Int -> SelectorGroup -> ShowS Source # show :: SelectorGroup -> String Source # showList :: [SelectorGroup] -> ShowS Source #
Eq SelectorGroup Source # |
Instance details Defined in Yesod.Test.CssQuery Methods (==) :: SelectorGroup -> SelectorGroup -> Bool Source # (/=) :: SelectorGroup -> SelectorGroup -> Bool Source #

data Selector Source #

Constructors

ById Text |
ByClass Text |
ByTagName Text |
ByAttrExists Text |
ByAttrEquals Text Text |
ByAttrContains Text Text |
ByAttrStarts Text Text |
ByAttrEnds Text Text |

#### Instances

Instances details

Show Selector Source # |
Instance details Defined in Yesod.Test.CssQuery Methods showsPrec :: Int -> Selector -> ShowS Source # show :: Selector -> String Source # showList :: [Selector] -> ShowS Source #
Eq Selector Source # |
Instance details Defined in Yesod.Test.CssQuery Methods (==) :: Selector -> Selector -> Bool Source # (/=) :: Selector -> Selector -> Bool Source #

parseQuery :: Text -> Either String [[SelectorGroup]] Source #

Parses a query into an intermediate format which is easy to feed to HXT

- The top-level lists represent the top level comma separated queries.
- SelectorGroup is a group of qualifiers which are separated with spaces or > like these three: table.main.odd tr.even > td.big
- A SelectorGroup as a list of Selector items, following the above example the selectors in the group are: table, .main and .odd