browser icon indicating copy to clipboard operation
browser copied to clipboard

Selector API

Open kbond opened this issue 2 years ago • 0 comments

Fixes #15, Fixes #12. Fixes #37.

The idea is any method that accepts a $selector would allow string|Selector. Example:

$browser
    ->assertSeeElement(Selector::css('value'))
    ->assertSeeElement(Selector::id('value'))
    ->assertSeeElement(Selector::xpath('value'))
    ->assertSeeElement(Selector::link('value'))
    ->assertSeeElement(Selector::button('value'))
    ->assertSeeElement(Selector::field('value')) // form field

    /**
     * Plain string is an "auto" selector:
     * 1. Try css
     * 2. Try xpath
     * 3. Try id
     * 4. Try link
     * 5. Try button
     * 6. Try form field
     */
    ->assertSeeElement('value')
;

kbond avatar Apr 06 '22 17:04 kbond