yandex-qatools / htmlelements

Html Elements is a Java framework providing easy-to-use way of interaction with web-page elements in web-page tests.
Other
271 stars 116 forks source link

Changes from pull request #121 #122

Open emaks opened 8 years ago

emaks commented 8 years ago

Changes from pull request #121 have removed difference between TypifiedElement.class and HtmlElement.class. Now we can do all actions that provides selenium api using TypifiedElement.class while this class has been implemented not to provide this possibility

ham1 commented 8 years ago

This is correct. What do you see the disadvantages of being able to access the WebElement API with TypifiedElements? Do you know why it was different in the first place?

I found the major advantage being able to explicitly wait for it like a normal WebElement. It also reduces code duplication, often you want to perform actions which are identical to the WebElement API and before the PR they were been passed through, without modification, to the wrapped WebElement.

emaks commented 8 years ago

Because when I use Button.class I mustn't have functionality like sendKeys(), getText() etc.

ham1 commented 8 years ago

Why must the functionality not be there?

Is already is there as you can still get access to the API using .getWrappedElement() - so easy to get around.

You can chose just not to use it.

Whereas, if it's not there, .getWrappedElement() has to be called or things such as explicit "wait for (in)visibility of all in" a List cannot be done without a custom ExpectedConditions.

In your example, you might want getText() on a button to check it has the expected text, also you might want to send the enter key on the button to test keyboard navigation.

emaks commented 8 years ago

Why must the functionality not be there?

because it looks like https://hsto.org/getpro/habr/post_images/9b8/71b/a0b/9b871ba0b4fe575aa9d896a6d642c55a.jpg

lanwen commented 8 years ago

TypifiedElements is a architect fail. So in most cases we have more troubles than profit from using it. So its just a step to make unification of this classes

emaks commented 8 years ago

@lanwen in that case TypifiedElements have to be removed

ham1 commented 8 years ago

I totally agree. As well as being more 'correct' it will simplify the code base, which is always good, but what of backward compatibility?

lanwen commented 8 years ago

yep, we can't just remove this class without set of small steps which are: unification - deprecation - removing.

ham1 commented 6 years ago

Can this be closed or are we going to look to deprecate TypifiedElements?

artkoshelev commented 6 years ago

i would vote for deleting it