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

Consider adding "does" to SeleneElement #167

Open
kylefix opened this issue Feb 15, 2018 · 4 comments
Open

Consider adding "does" to SeleneElement #167

kylefix opened this issue Feb 15, 2018 · 4 comments

Comments

@kylefix
Copy link
Contributor

kylefix commented Feb 15, 2018

You could add this:

def does(self: SeleneElement, condition) -> bool:
    return is_matched(condition, self)

SeleneElement.does = does

In order to be able to do things like this:

s(HomeLocators.CURRENT_LANGUAGE).does(
            have.exact_text("FR"))
@SergeyPirogov
Copy link
Contributor

SergeyPirogov commented Feb 16, 2018

@kylefix Hi, I don't see any real profit for this. We have should methods and all checks and assertions should be performed like

s("locator").should(have.text("hello"))

@ibalagurov
Copy link

@SergeyPirogov sometimes you don't want to wait element. just to know is it exist or visible. Example: if you want to implement visit page by direct link if it don't open and you use one browser session for better performance so you don't know state of previous test.

@kylefix
Copy link
Contributor Author

kylefix commented Feb 27, 2018

Yes, and should throws an exception if false right? This is just a boolean.

@SergeyPirogov
Copy link
Contributor

I think we can add .has(), so that it will look like

if(s("locator").has(text("")))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants