Codeception / lib-innerbrowser

InnerBrowser
MIT License
80 stars 20 forks source link

seeOptionIsSelected should also accept value not only text #23

Open dwenaus opened 8 years ago

dwenaus commented 8 years ago

At present this will work for PHP Browser module:

$I->seeOptionIsSelected('#select', 'My Option Text');

but this will not:

$I->seeOptionIsSelected('#select', 'my-option-value');

It would AMAZING if the second worked.

dwenaus commented 7 years ago

would you accept a pull request for this?

vjandrea commented 7 years ago

I'm trying to implement this but i'm struggling to find the best approach. What i'm thinking about is to add a third parameter when used for <option value="option value">option text</option> tag to specify if option text OR option value should be evaluated.

I find it hard to analyze both at the same time because in either case an assertEquals() would fail. If both are false it would be impossible to discriminate which of the two is the correct failing assertion.

Another way could be a brand new method, something like seeOptionValueIsSelected()