Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.x] Add new assert methods for Dusk #5906

Merged
merged 1 commit into from
Mar 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions dusk.md
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,9 @@ Dusk provides a variety of assertions that you may make against your application
[assertVueIsNot](#assert-vue-is-not)
[assertVueContains](#assert-vue-contains)
[assertVueDoesNotContain](#assert-vue-does-not-contain)
[assertAttribute](#assert-attribute)
[assertAriaAttribute](#assert-aria-attribute)
[assertDataAttribute](#assert-data-attribute)
</div>

<a name="assert-title"></a>
Expand Down Expand Up @@ -1131,6 +1134,35 @@ Assert that a given Vue component data property is an array and does not contain

$browser->assertVueDoesNotContain($property, $value, $componentSelector = null);

<a name="assert-attribute"></a>
#### assertAttribute

Assert that the element matching the given selector has the given value in the provided attribute:

$browser->assertAttribute($selector, $attribute, $value);

<a name="assert-aria-attribute"></a>
#### assertArriaAttribute

Assert that the element matching the given selector has the given value in the provided aria attribute:

$browser->assertAriaAttribute($selector, $attribute, $value);

For example, with `<button aria-label="Add"></>` you can assert the `aria-label` attribute with

$browser->assertAriaAttribute('button', 'label', 'Add')

<a name="assert-data-attribute"></a>
#### assertDataAttribute

Assert that the element matching the given selector has the given value in the provided data attribute:

$browser->assertDataAttribute($selector, $attribute, $value);

For example, with `<tr id="row-1" data-content="attendees"></>` you can assert the `data-label` attribute with

$browser->assertDataAttribute('#row-1', 'content', 'attendees')

<a name="pages"></a>
## Pages

Expand Down