Skip to content

Commit

Permalink
Add the new assertions to the sample code in the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
squatto committed May 26, 2023
1 parent e7a164a commit 9c906c1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,27 @@ it('gets elements matching a selector', function () {
->toHaveCount(5);
});

it("throws an exception when the selector doesn't have any matches", function () {
$this->expectException(AssertionFailedError::class);

$this->get('/')
->assertSelectorContains('main div.single .does-not-exist', 'a value');
});

it('asserts that the selector exists')
->get('/')
->assertSelectorExists('main div.single .item');

it('asserts that the selector does not exist')
->get('/')
->assertSelectorNotExists('main div.single .does-not-exist');

it("asserts that the selector matches the expected count")
->get('/')
->assertSelectorCount('main div.single .item', 1)
->assertSelectorCount('main div.multiple-same .item', 3)
->assertSelectorCount('main div.multiple-same .does-not-exist', 0);

it("asserts that any of a selector's matches contains a value")
->get('/')
->assertSelectorContains('main div.single .item', 'a value');
Expand Down

0 comments on commit 9c906c1

Please sign in to comment.