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

seeOptionIsSelected should also accept value not only text #23

Open
dwenaus opened this issue Sep 8, 2016 · 2 comments
Open

seeOptionIsSelected should also accept value not only text #23

dwenaus opened this issue Sep 8, 2016 · 2 comments

Comments

@dwenaus
Copy link

dwenaus commented Sep 8, 2016

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
Copy link
Author

dwenaus commented Jan 2, 2017

would you accept a pull request for this?

@vjandrea
Copy link

vjandrea commented Mar 22, 2017

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()

@Naktibalda Naktibalda transferred this issue from Codeception/Codeception Jan 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants