Skip to content

Commit dced132

Browse files
committed
Merge pull request #206 from TikhomirovSergey/#201
#201 fix update to Selenium 2.46 + Some improvements.
2 parents dafa378 + 25f14fe commit dced132

File tree

4 files changed

+196
-193
lines changed

4 files changed

+196
-193
lines changed

README.md

Lines changed: 175 additions & 175 deletions
Original file line numberDiff line numberDiff line change
@@ -1,175 +1,175 @@
1-
java-client
2-
===========
3-
4-
Java language binding for writing Appium Tests, conforms to [Mobile JSON Wire Protocol](https://code.google.com/p/selenium/source/browse/spec-draft.md?repo=mobile)
5-
6-
Depends upon the Selenium Java client library, available [here](http://docs.seleniumhq.org/download/)
7-
8-
[Download the jar from Maven](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22io.appium%22%20AND%20a%3A%22java-client%22) or add the following to pom.xml:
9-
10-
```
11-
<dependency>
12-
<groupId>io.appium</groupId>
13-
<artifactId>java-client</artifactId>
14-
<version>2.2.0</version>
15-
</dependency>
16-
```
17-
18-
It currently depends on selenium-java 2.43.1. If it is necessary to use another version of Selenium then you can configure pom.xml as follows:
19-
20-
```
21-
<dependency>
22-
<groupId>io.appium</groupId>
23-
<artifactId>java-client</artifactId>
24-
<version>2.2.0</version>
25-
<exclusions>
26-
<exclusion>
27-
<groupId>org.seleniumhq.selenium</groupId>
28-
<artifactId>selenium-java</artifactId>
29-
</exclusion>
30-
</exclusions>
31-
</dependency>
32-
33-
<dependency>
34-
<groupId>org.seleniumhq.selenium</groupId>
35-
<artifactId>selenium-java</artifactId>
36-
<version>${selenium.version.you.require}</version>
37-
</dependency>
38-
```
39-
40-
Javadocs: http://appium.github.io/java-client/
41-
42-
###Structure###
43-
44-
There is an abstract _AppiumDriver_ class which inherits from the Selenium Java Client.
45-
The _AppiumDriver_ class contains all methods shared by iOS and Android.
46-
_IOSDriver_ and _AndroidDriver_ both extend _AppiumDriver_ and provide more methods, and specific implementations for some methods.
47-
48-
###Added functions###
49-
More can be found in the docs, but here's a quick list of features which this project has added to the usual selenium binding.
50-
51-
52-
- startActivity()
53-
- resetApp()
54-
- getAppString()
55-
- sendKeyEvent()
56-
- currentActivity()
57-
- pullFile()
58-
- pushFile()
59-
- pullFolder()
60-
- hideKeyboard()
61-
- runAppInBackground()
62-
- performTouchAction()
63-
- performMultiTouchAction()
64-
- tap()
65-
- swipe()
66-
- pinch()
67-
- zoom()
68-
- getNamedTextField()
69-
- isAppInstalled()
70-
- installApp()
71-
- removeApp()
72-
- launchApp()
73-
- closeApp()
74-
- endTestCoverage()
75-
- lockScreen()
76-
- isLocked()
77-
- shake()
78-
- complexFind()
79-
- scrollTo()
80-
- scrollToExact()
81-
- openNotifications()
82-
- Context Switching: .context(), .getContextHandles(), getContext())
83-
- getNetworkConnection(), setNetworkConnection()
84-
- ignoreUnimportantViews(), getSettings()
85-
- toggleLocationServices()
86-
87-
Locators:
88-
- findElementByAccessibilityId()
89-
- findElementsByAccessibilityId()
90-
- findElementByIosUIAutomation()
91-
- findElementsByIosUIAutomation()
92-
- findElementByAndroidUIAutomator()
93-
- findElementsByAndroidUIAutomator()
94-
95-
##Changelog##
96-
97-
*2.2.0*
98-
- Added new TouchAction methods for LongPress, on an element, at x,y coordinates, or at an offset from within an element
99-
- SwipeElementDirection changed. Read the documentation, it's now smarter about how/where to swipe
100-
- Added APPIUM_VERSION MobileCapabilityType
101-
- `sendKeyEvent()` moved from AppiumDriver to AndroidDriver
102-
- `linkText` and `partialLinkText` locators added
103-
- setValue() moved from MobileElement to AndroidElement
104-
- Fixed Selendroid PageAnnotations
105-
106-
*2.1.0*
107-
- Moved hasAppString() from AndroidDriver to AppiumDriver
108-
- Fixes to PageFactory
109-
- Added @AndroidFindAll and @iOSFindAll
110-
- Added toggleLocationServices() to AndroidDriver
111-
- Added touchAction methods to MobileElement, so now you can do `element.pinch()`, `element.zoom()`, etc.
112-
- Added the ability to choose a direction to swipe over an element. Use the `SwipeElementDirection` enums: `UP, DOWN, LEFT, RIGHT`
113-
114-
*2.0.0*
115-
- AppiumDriver is now an abstract class, use IOSDriver and AndroidDriver which both extend it. You no longer need to include the `PLATFORM_NAME` desired capability since it's automatic for each class. Thanks to @TikhomirovSergey for all their work
116-
- ScrollTo() and ScrollToExact() methods reimplemented
117-
- Zoom() and Pinch() are now a little smarter and less likely to fail if you element is near the edge of the screen. Congratulate @BJap on their first PR!
118-
119-
*1.7.0*
120-
- Removed `scrollTo()` and `scrollToExact()` methods because they relied on `complexFind()`. They will be added back in the next version!
121-
- Removed `complexFind()`
122-
- Added `startActivity()` method
123-
- Added `isLocked()` method
124-
- Added `getSettings()` and `ignoreUnimportantViews()` methods
125-
126-
*1.6.2*
127-
- Added MobilePlatform interface (Android, IOS, FirefoxOS)
128-
- Added MobileBrowserType interface (Safari, Browser, Chromium, Chrome)
129-
- Added MobileCapabilityType.APP_WAIT_ACTIVITY
130-
- Fixed small Integer cast issue (in Eclipse it won't compile)
131-
- Set -source and -target of the Java Compiler to 1.7 (for maven compiler plugin)
132-
- Fixed bug in Page Factory
133-
134-
*1.6.1*
135-
- Fixed the logic for checking connection status on NetworkConnectionSetting objects
136-
137-
*1.6.0*
138-
- Added @findBy annotations. Explanation here: https://github.com/appium/java-client/pull/68 Thanks to TikhomirovSergey
139-
- Appium Driver now implements LocationContext interface, so setLocation() works for setting GPS coordinates
140-
141-
*1.5.0*
142-
- Added MobileCapabilityType enums for desired capabilities
143-
- `findElement` and `findElements` return MobileElement objects (still need to be casted, but no longer instantiated)
144-
- new appium v1.2 `hideKeyboard()` strategies added
145-
- `getNetworkConnection()` and `setNetworkConnection()` commands added
146-
147-
*1.4.0*
148-
- Added openNotifications() method, to open the notifications shade on Android
149-
- Added pullFolder() method, to pull an entire folder as a zip archive from a device/simulator
150-
- Upgraded Selenium dependency to 2.42.2
151-
152-
*1.3.0*
153-
- MultiGesture with a single TouchAction fixed for Android
154-
- Now depends upon Selenium java client 2.42.1
155-
- Cleanup of Errorcode handling, due to merging a change into Selenium
156-
157-
*1.2.1*
158-
- fix dependency issue
159-
160-
*1.2.0*
161-
- complexFind() now returns MobileElement objects
162-
- added scrollTo() and scrollToExact() methods for use with complexFind()
163-
164-
*1.1.0*
165-
- AppiumDriver now implements Rotatable. rotate() and getOrientation() methods added
166-
- when no appium server is running, the proper error is thrown, instead of a NullPointerException
167-
168-
*1.0.2*
169-
- recompiled to include some missing methods such as shake() and complexFind()
170-
171-
## Running tests
172-
173-
Run a test using
174-
175-
> mvn -Dtest=io.appium.java_client.MobileDriverAndroidTest clean test
1+
java-client
2+
===========
3+
4+
Java language binding for writing Appium Tests, conforms to [Mobile JSON Wire Protocol](https://code.google.com/p/selenium/source/browse/spec-draft.md?repo=mobile)
5+
6+
Depends upon the Selenium Java client library, available [here](http://docs.seleniumhq.org/download/)
7+
8+
[Download the jar from Maven](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22io.appium%22%20AND%20a%3A%22java-client%22) or add the following to pom.xml:
9+
10+
```
11+
<dependency>
12+
<groupId>io.appium</groupId>
13+
<artifactId>java-client</artifactId>
14+
<version>2.2.0</version>
15+
</dependency>
16+
```
17+
18+
It currently depends on selenium-java 2.46.0. If it is necessary to use another version of Selenium then you can configure pom.xml as follows:
19+
20+
```
21+
<dependency>
22+
<groupId>io.appium</groupId>
23+
<artifactId>java-client</artifactId>
24+
<version>2.2.0</version>
25+
<exclusions>
26+
<exclusion>
27+
<groupId>org.seleniumhq.selenium</groupId>
28+
<artifactId>selenium-java</artifactId>
29+
</exclusion>
30+
</exclusions>
31+
</dependency>
32+
33+
<dependency>
34+
<groupId>org.seleniumhq.selenium</groupId>
35+
<artifactId>selenium-java</artifactId>
36+
<version>${selenium.version.you.require}</version>
37+
</dependency>
38+
```
39+
40+
Javadocs: http://appium.github.io/java-client/
41+
42+
###Structure###
43+
44+
There is an abstract _AppiumDriver_ class which inherits from the Selenium Java Client.
45+
The _AppiumDriver_ class contains all methods shared by iOS and Android.
46+
_IOSDriver_ and _AndroidDriver_ both extend _AppiumDriver_ and provide more methods, and specific implementations for some methods.
47+
48+
###Added functions###
49+
More can be found in the docs, but here's a quick list of features which this project has added to the usual selenium binding.
50+
51+
52+
- startActivity()
53+
- resetApp()
54+
- getAppString()
55+
- sendKeyEvent()
56+
- currentActivity()
57+
- pullFile()
58+
- pushFile()
59+
- pullFolder()
60+
- hideKeyboard()
61+
- runAppInBackground()
62+
- performTouchAction()
63+
- performMultiTouchAction()
64+
- tap()
65+
- swipe()
66+
- pinch()
67+
- zoom()
68+
- getNamedTextField()
69+
- isAppInstalled()
70+
- installApp()
71+
- removeApp()
72+
- launchApp()
73+
- closeApp()
74+
- endTestCoverage()
75+
- lockScreen()
76+
- isLocked()
77+
- shake()
78+
- complexFind()
79+
- scrollTo()
80+
- scrollToExact()
81+
- openNotifications()
82+
- Context Switching: .context(), .getContextHandles(), getContext())
83+
- getNetworkConnection(), setNetworkConnection()
84+
- ignoreUnimportantViews(), getSettings()
85+
- toggleLocationServices()
86+
87+
Locators:
88+
- findElementByAccessibilityId()
89+
- findElementsByAccessibilityId()
90+
- findElementByIosUIAutomation()
91+
- findElementsByIosUIAutomation()
92+
- findElementByAndroidUIAutomator()
93+
- findElementsByAndroidUIAutomator()
94+
95+
##Changelog##
96+
97+
*2.2.0*
98+
- Added new TouchAction methods for LongPress, on an element, at x,y coordinates, or at an offset from within an element
99+
- SwipeElementDirection changed. Read the documentation, it's now smarter about how/where to swipe
100+
- Added APPIUM_VERSION MobileCapabilityType
101+
- `sendKeyEvent()` moved from AppiumDriver to AndroidDriver
102+
- `linkText` and `partialLinkText` locators added
103+
- setValue() moved from MobileElement to AndroidElement
104+
- Fixed Selendroid PageAnnotations
105+
106+
*2.1.0*
107+
- Moved hasAppString() from AndroidDriver to AppiumDriver
108+
- Fixes to PageFactory
109+
- Added @AndroidFindAll and @iOSFindAll
110+
- Added toggleLocationServices() to AndroidDriver
111+
- Added touchAction methods to MobileElement, so now you can do `element.pinch()`, `element.zoom()`, etc.
112+
- Added the ability to choose a direction to swipe over an element. Use the `SwipeElementDirection` enums: `UP, DOWN, LEFT, RIGHT`
113+
114+
*2.0.0*
115+
- AppiumDriver is now an abstract class, use IOSDriver and AndroidDriver which both extend it. You no longer need to include the `PLATFORM_NAME` desired capability since it's automatic for each class. Thanks to @TikhomirovSergey for all their work
116+
- ScrollTo() and ScrollToExact() methods reimplemented
117+
- Zoom() and Pinch() are now a little smarter and less likely to fail if you element is near the edge of the screen. Congratulate @BJap on their first PR!
118+
119+
*1.7.0*
120+
- Removed `scrollTo()` and `scrollToExact()` methods because they relied on `complexFind()`. They will be added back in the next version!
121+
- Removed `complexFind()`
122+
- Added `startActivity()` method
123+
- Added `isLocked()` method
124+
- Added `getSettings()` and `ignoreUnimportantViews()` methods
125+
126+
*1.6.2*
127+
- Added MobilePlatform interface (Android, IOS, FirefoxOS)
128+
- Added MobileBrowserType interface (Safari, Browser, Chromium, Chrome)
129+
- Added MobileCapabilityType.APP_WAIT_ACTIVITY
130+
- Fixed small Integer cast issue (in Eclipse it won't compile)
131+
- Set -source and -target of the Java Compiler to 1.7 (for maven compiler plugin)
132+
- Fixed bug in Page Factory
133+
134+
*1.6.1*
135+
- Fixed the logic for checking connection status on NetworkConnectionSetting objects
136+
137+
*1.6.0*
138+
- Added @findBy annotations. Explanation here: https://github.com/appium/java-client/pull/68 Thanks to TikhomirovSergey
139+
- Appium Driver now implements LocationContext interface, so setLocation() works for setting GPS coordinates
140+
141+
*1.5.0*
142+
- Added MobileCapabilityType enums for desired capabilities
143+
- `findElement` and `findElements` return MobileElement objects (still need to be casted, but no longer instantiated)
144+
- new appium v1.2 `hideKeyboard()` strategies added
145+
- `getNetworkConnection()` and `setNetworkConnection()` commands added
146+
147+
*1.4.0*
148+
- Added openNotifications() method, to open the notifications shade on Android
149+
- Added pullFolder() method, to pull an entire folder as a zip archive from a device/simulator
150+
- Upgraded Selenium dependency to 2.42.2
151+
152+
*1.3.0*
153+
- MultiGesture with a single TouchAction fixed for Android
154+
- Now depends upon Selenium java client 2.42.1
155+
- Cleanup of Errorcode handling, due to merging a change into Selenium
156+
157+
*1.2.1*
158+
- fix dependency issue
159+
160+
*1.2.0*
161+
- complexFind() now returns MobileElement objects
162+
- added scrollTo() and scrollToExact() methods for use with complexFind()
163+
164+
*1.1.0*
165+
- AppiumDriver now implements Rotatable. rotate() and getOrientation() methods added
166+
- when no appium server is running, the proper error is thrown, instead of a NullPointerException
167+
168+
*1.0.2*
169+
- recompiled to include some missing methods such as shake() and complexFind()
170+
171+
## Running tests
172+
173+
Run a test using
174+
175+
> mvn -Dtest=io.appium.java_client.MobileDriverAndroidTest clean test

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
</dependency>
1515
<dependency>
1616
<groupId>org.seleniumhq.selenium</groupId>
17-
<artifactId>selenium-java</artifactId>
18-
<version>2.45.0</version>
17+
<artifactId>selenium-java</artifactId>
18+
<version>2.46.0</version>
1919
</dependency>
2020
<dependency>
2121
<groupId>junit</groupId>

src/main/java/io/appium/java_client/pagefactory/AppiumAnnotations.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ private static void checkDisallowedAnnotationPairs(Annotation a1,
171171
}
172172
}
173173

174-
private void assertValidAnnotations() {
174+
@Override
175+
protected void assertValidAnnotations() {
175176
AndroidFindBy androidBy = mobileField
176177
.getAnnotation(AndroidFindBy.class);
177178
AndroidFindBys androidBys = mobileField
@@ -201,6 +202,7 @@ private void assertValidAnnotations() {
201202
checkDisallowedAnnotationPairs(iOSBy, iOSBys);
202203
checkDisallowedAnnotationPairs(iOSBy, iOSFindAll);
203204
checkDisallowedAnnotationPairs(iOSBys, iOSFindAll);
205+
super.assertValidAnnotations();
204206
}
205207

206208
private static Method[] prepareAnnotationMethods(

0 commit comments

Comments
 (0)