It would be cool to add custom Jest matchers by default to this lib. An example would be expect(page/element).toContainText('some text'), taking into account somehow the 3 different kind of text matchers text=example one (case-insensitive, substring matching), text="example 2" (exact matching), text=/^\\s*Some text$/i (regex matching).
Either in 3 separate functions, or just one matcher with all variants.
Also an expect(page/element).toContainElement (or expect(page/element).toContainSelector which underneath calls waitForSelector.
I think this is the same core idea as #41. Definitely a good idea. Let's keep high level discussion in that issue, and file new issues for specific api proposals.
It would be cool to add custom Jest matchers by default to this lib. An example would be
expect(page/element).toContainText('some text')
, taking into account somehow the 3 different kind of text matcherstext=example one
(case-insensitive, substring matching),text="example 2"
(exact matching),text=/^\\s*Some text$/i
(regex matching).Either in 3 separate functions, or just one matcher with all variants.
Also an
expect(page/element).toContainElement
(orexpect(page/element).toContainSelector
which underneath callswaitForSelector
.