-
-
Notifications
You must be signed in to change notification settings - Fork 762
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
Repeatable annotations & HasSessionDetails API #497
Repeatable annotations & HasSessionDetails API #497
Conversation
- deprecated annotations: AndroidFindAll, AndroidFindBys, iOSFindAll, iOSFindBys, SelendroidFindAll, SelendroidFindBys. - new annotations were added: AndroidFindBySet, iOSFindBySet, SelendroidFindBySet, HowToUseLocators.
- added interface HasSessionDetails which contains methods with default implementation. It is implemented by AppiumDriver and MobileElement - AndroidDriverTest was modified.
…ionDetails API was finished
@SrinivasanTarget could you review it? :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/appium/java-client/pull/497/files#diff-73623ae00d624037c568229b4def71d6R200 should be iOSAutomation()
…epeatable_annotations # Conflicts: # src/main/java/io/appium/java_client/AppiumDriver.java
…epeatable_annotations # Conflicts: # src/main/java/io/appium/java_client/AppiumDriver.java
@SrinivasanTarget The issue which you pointed has got fixed. |
@TikhomirovSergey I like this PR. Gonna be a big change. Code LGTM 👍 Haven't run through the tests, will run through it soon. |
@TikhomirovSergey i'm finding hard to understand the use-of @HowToUseLocators(androidAutomation = CHAIN, iOSAutomation = ALL_POSSIBLE) can you please throw some light on this ? |
@saikrishna321 Please find the simple use case below,
Based on above code snippet,
Incase if we didn't mention any of |
@SrinivasanTarget yah i get this... but what does CHAIN and ALL_POSSIBLE do ? |
@saikrishna321 Have updated the comments above. Let me know if it is not clear. |
@TikhomirovSergey Have run through android tests and everything LGTM.Also @codacy is Green. |
That means that each one platform-specific locator can be a part of the chaing of the searching or it is one of possible variants to find the desired element/the desired list of elements as well. Before we have been using such annotations as @AndroidFindBys({@AndroidFindBy(1),@AndroidFindBy(2)})/@iOSFindBys({@iOSFindBy(1), @iOSFindBy(2)}) to define the searching chain and @AndroidFindAll({@AndroidFindBy(1),@AndroidFindBy(2)})/@iOSFindAll({@iOSFindBy(1), @iOSFindBy(2)}) to define possible locators for the searching. Now we are migrating to Java 8. It provides repeatable annotations: http://docs.oracle.com/javase/tutorial/java/annotations/repeating.html So I think that some annotations above are redundant now. We could define the chain like: So
If the end user needs for combined strategy for each target platform then
or
|
@SrinivasanTarget |
Have upgraded my xcode to 8 so i cant run through existing tests on XCUITest Mode. But test code for iOS looks good to me. |
@SrinivasanTarget @TikhomirovSergey I'm still on xcode 7, any help needed to run the iOS test ? |
@TikhomirovSergey well explained, i had a chat with @SrinivasanTarget on @CacheLookup will take a look on it .. |
@saikrishna321 May be you can help us with |
@TikhomirovSergey @SrinivasanTarget all tests passed( Tested on iPhone 9.3 Simulator, xcode 7) 👍 |
Change list
Migration to Java 8. Repeatable annotations for page objects:
AndroidFindAll
,AndroidFindBys
,iOSFindAll
,iOSFindBys
,SelendroidFindAll
,SelendroidFindBys
became deprecated.AndroidFindBy
,iOSFindBy
,SelendroidFindBy
became repeatable.io.appium.java_client.pagefactory.HowToUseLocators
was added to help to define the searching strategy (chain or using all possible locators) correctly.Also were added:
io.appium.java_client.HasSessionDetails
interface. It has methods implemented by default. This interface is implemented byAppiumDriver
io.appium.java_client.AppiumFieldDecorator
and related supporting tools. Now it uses session data instead of the class of the given driver for the routing between annotations.Types of changes
Details
#399 #454
The old usecase for the chained searching:
New usecases for the chained searching:
or
The old usecase for the searching by all possible locators:
The new usecase for the searching by all possible locators:
Also possible combined variants:
or