Skip to content

Commit 6c372d7

Browse files
authored
Merge branch 'master' into readperformancedata
2 parents f525d3c + 85be19e commit 6c372d7

File tree

120 files changed

+3213
-1588
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+3213
-1588
lines changed

README.md

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#java-client
1+
# java-client
22

33
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.appium/java-client/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.appium/java-client)
44
[![Javadoc](https://javadoc-emblem.rhcloud.com/doc/io.appium/java-client/badge.svg)](http://www.javadoc.io/doc/io.appium/java-client)
@@ -9,16 +9,73 @@ This is the Java language binding for writing Appium Tests, conforms to [Mobile
99

1010
[API docs](http://appium.github.io/java-client/)
1111

12-
###Features and other interesting information###
12+
### Features and other interesting information
1313

1414
[Tech stack](https://github.com/appium/java-client/blob/master/docs/Tech-stack.md)
1515

1616
[How to install the project](https://github.com/appium/java-client/blob/master/docs/Installing-the-project.md)
1717

1818
[WIKI](https://github.com/appium/java-client/wiki)
1919

20-
##Changelog##
20+
## Changelog
21+
2122
*5.0.0 (under construction yet)*
23+
- **[REFACTOR]** **[BREAKING CHANGE]** 5.0.0 finalization. Removal of obsolete code. [#660](https://github.com/appium/java-client/pull/660)
24+
- **[ENHANCEMENT]** Enable nativeWebTap setting for iOS. [#658](https://github.com/appium/java-client/pull/658)
25+
- **[ENHANCEMENT]** The `getCurrentPackage` was added. [#657](https://github.com/appium/java-client/pull/657)
26+
- **[ENHANCEMENT]** The `toggleTouchIDEnrollment` was added. [#659](https://github.com/appium/java-client/pull/659)
27+
- **[BUG FIX]** The clearing of existing actions/parameters after perform is invoked. [#663](https://github.com/appium/java-client/pull/663)
28+
29+
*5.0.0-BETA9*
30+
- **[ENHANCEMENT]** Page factory: Mixed locator strategies were implemented. Feature request:[#565](https://github.com/appium/java-client/issues/565) Implementation: [#646](https://github.com/appium/java-client/pull/646)
31+
- **[DEPRECATED]** All the content of the `io.appium.java_client.youiengine` package was marked `Deprecated`. It is going to be removed. [#652](https://github.com/appium/java-client/pull/652)
32+
- **[UPDATE]** Update of the `com.google.code.gson:gson` to v2.8.1.
33+
34+
*5.0.0-BETA8*
35+
- **[ENHANCEMENT]** Page factory classes became which had package visibility are `public` now. [#630](https://github.com/appium/java-client/pull/630)
36+
- `io.appium.java_client.pagefactory.AppiumElementLocatorFactory`
37+
- `io.appium.java_client.pagefactory.DefaultElementByBuilder`
38+
- `io.appium.java_client.pagefactory.WidgetByBuilder`
39+
40+
- **[ENHANCEMENT]** New capabilities were added [#626](https://github.com/appium/java-client/pull/626):
41+
- `AndroidMobileCapabilityType#AUTO_GRANT_PERMISSIONS`
42+
- `AndroidMobileCapabilityType#ANDROID_NATURAL_ORIENTATION`
43+
- `IOSMobileCapabilityType#XCODE_ORG_ID`
44+
- `IOSMobileCapabilityType#XCODE_SIGNING_ID`
45+
- `IOSMobileCapabilityType#UPDATE_WDA_BUNDLEID`
46+
- `IOSMobileCapabilityType#RESET_ON_SESSION_START_ONLY`
47+
- `IOSMobileCapabilityType#COMMAND_TIMEOUTS`
48+
- `IOSMobileCapabilityType#WDA_STARTUP_RETRIES`
49+
- `IOSMobileCapabilityType#WDA_STARTUP_RETRY_INTERVAL`
50+
- `IOSMobileCapabilityType#CONNECT_HARDWARE_KEYBOARD`
51+
- `IOSMobileCapabilityType#MAX_TYPING_FREQUENCY`
52+
- `IOSMobileCapabilityType#SIMPLE_ISVISIBLE_CHECK`
53+
- `IOSMobileCapabilityType#USE_CARTHAGE_SSL`
54+
- `IOSMobileCapabilityType#SHOULD_USE_SINGLETON_TESTMANAGER`
55+
- `IOSMobileCapabilityType#START_IWDP`
56+
- `IOSMobileCapabilityType#ALLOW_TOUCHID_ENROLL`
57+
- `MobileCapabilityType#EVENT_TIMINGS`
58+
59+
- **[UPDATE]** Dependencies were updated:
60+
- `org.seleniumhq.selenium:selenium-java` was updated to 3.4.0
61+
- `cglib:cglib` was updated to 3.2.5
62+
- `org.apache.httpcomponents:httpclient` was updated to 4.5.3
63+
- `commons-validator:commons-validator` was updated to 1.6
64+
- `org.springframework:spring-context` was updated to 4.3.8.RELEASE
65+
66+
67+
*5.0.0-BETA7*
68+
- **[ENHANCEMENT]** The ability to customize the polling strategy of the waiting was provided. [#612](https://github.com/appium/java-client/pull/612)
69+
- **[ENHANCEMENT]** **[REFACTOR]** Methods which were representing time deltas instead of elementary types became `Deprecated`. Methods which use `java.time.Duration` are suugested to be used. [#611](https://github.com/appium/java-client/pull/611)
70+
- **[ENHANCEMENT]** The ability to calculate screenshots overlap was included. [#595](https://github.com/appium/java-client/pull/595).
71+
72+
73+
*5.0.0-BETA6*
74+
- **[UPDATE]** Update to Selenium 3.3.1
75+
- **[ENHANCEMENT]** iOS XCUIT mode automation: API to run application in background was added. [#593](https://github.com/appium/java-client/pull/593)
76+
- **[BUG FIX]** Issue report: [#594](https://github.com/appium/java-client/issues/594). FIX: [#597](https://github.com/appium/java-client/pull/597)
77+
- **[ENHANCEMENT]** The class chain locator was added. [#599](https://github.com/appium/java-client/pull/599)
78+
2279

2380
*5.0.0-BETA5*
2481
- **[UPDATE]** Update to Selenium 3.2.0

archive/docs/How-to-propose-a-PR.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#A good pull-request should contain
1+
# A good pull-request should contain
22

33
### Change list
44

@@ -19,6 +19,6 @@ There should be provided more details about changes if it is necessary. If there
1919
can provide code samples which show the way they work and possible use cases. Also you can create [gists](https://gist.github.com)
2020
with pasted java code samples or put them at a PR description using markdown. About markdown please read [Mastering markdown](https://guides.github.com/features/mastering-markdown/) and [Writing on GitHub](https://help.github.com/categories/writing-on-github/)
2121

22-
#Pull-request template
22+
# Pull-request template
2323

2424
There is [PULL_REQUEST_TEMPLATE.md)](https://github.com/appium/java-client/blob/master/PULL_REQUEST_TEMPLATE.md) which should help you to make a good pull request.

archive/docs/How-to-report-an-issue.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
#Be sure that it is not a server-side problem if you are facing something that looks like a bug
1+
# Be sure that it is not a server-side problem if you are facing something that looks like a bug
22

33
The Appium Java client is the thin client which just sends requests and receives responces generally.
44
Be sure that this bug is not reported [here](https://github.com/appium/appium/issues) and/or there is
55
no progress on this issue.
66

7-
#The good issue report should contain
7+
# The good issue report should contain
88

99
### Description
1010

@@ -42,9 +42,9 @@ There should be created a [gist](https://gist.github.com) which is a paste of yo
4242
If you are reporting a bug, _always_ include Appium logs as linked gists! It helps to define the problem correctly and clearly.
4343

4444

45-
#Issue template
45+
# Issue template
4646
There is [ISSUE_TEMPLATE.md](https://github.com/appium/java-client/blob/master/ISSUE_TEMPLATE.md) which should help you to make a good issue report.
4747

48-
#... And don't say that you weren't warned.
48+
# ... And don't say that you weren't warned.
4949

5050
If a report is not readable and/or there is no response from a reporter and some important details are needed then the issue will be closed after some time.

build.gradle

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ apply plugin: 'signing'
77
apply plugin: 'maven-publish'
88

99
group 'io.appium'
10-
version '5.0.0-BETA5'
10+
version '5.0.0-BETA9'
1111

1212
repositories {
1313
jcenter()
@@ -54,20 +54,22 @@ compileJava {
5454
}
5555

5656
dependencies {
57-
compile('org.seleniumhq.selenium:selenium-java:3.2.0'){
57+
compile('org.seleniumhq.selenium:selenium-java:3.4.0'){
5858
exclude module: 'cglib'
5959
exclude group: 'com.google.code.gson'
6060
}
61-
compile 'com.google.code.gson:gson:2.8.0'
62-
compile 'org.apache.httpcomponents:httpclient:4.5.2'
63-
compile 'cglib:cglib:3.2.4'
64-
compile 'commons-validator:commons-validator:1.5.1'
61+
compile 'com.google.code.gson:gson:2.8.1'
62+
compile 'org.apache.httpcomponents:httpclient:4.5.3'
63+
compile 'cglib:cglib:3.2.5'
64+
compile 'commons-validator:commons-validator:1.6'
6565
compile 'org.apache.commons:commons-lang3:3.5'
6666
compile 'commons-io:commons-io:2.5'
67-
compile 'org.springframework:spring-context:4.3.5.RELEASE'
67+
compile 'org.springframework:spring-context:4.3.8.RELEASE'
6868
compile 'org.aspectj:aspectjweaver:1.8.10'
69+
compile 'org.openpnp:opencv:3.2.0-1'
6970

7071
testCompile 'junit:junit:4.12'
72+
testCompile 'org.hamcrest:hamcrest-all:1.3'
7173
}
7274

7375
ext {

docs/Functions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Appium java client has some features based on [Java 8 Functional interfaces](https://www.oreilly.com/learning/java-8-functional-interfaces).
22

3-
#Conditions
3+
# Conditions
44

55
```java
66
io.appium.java_client.functions.AppiumFunction
@@ -58,7 +58,7 @@ private final AppiumFunction<Pattern, WebDriver> contextFunction = input -> {
5858
};
5959
```
6060

61-
##using one function as pre-condition
61+
## using one function as pre-condition
6262

6363
```java
6464
@Test public void tezt() {
@@ -70,7 +70,7 @@ private final AppiumFunction<Pattern, WebDriver> contextFunction = input -> {
7070
}
7171
```
7272

73-
##using one function as post-condition
73+
## using one function as post-condition
7474

7575
```java
7676
import org.openqa.selenium.support.ui.FluentWait;
@@ -85,7 +85,7 @@ import org.openqa.selenium.support.ui.Wait;
8585
}
8686
```
8787

88-
#Touch action supplier
88+
# Touch action supplier
8989

9090
[About touch actions](https://github.com/appium/java-client/blob/master/docs/Touch-actions.md)
9191

@@ -96,7 +96,7 @@ create gesture libraries/utils using suppliers. Appium java client provides this
9696
io.appium.java_client.functions.ActionSupplier
9797
```
9898

99-
##Samples
99+
## Samples
100100

101101
```java
102102
private final ActionSupplier<TouchAction> horizontalSwipe = () -> {

docs/How-to-propose-a-PR.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#A good pull-request should contain
1+
# A good pull-request should contain
22

33
### Change list
44

@@ -19,6 +19,6 @@ There should be provided more details about changes if it is necessary. If there
1919
can provide code samples which show the way they work and possible use cases. Also you can create [gists](https://gist.github.com)
2020
with pasted java code samples or put them at a PR description using markdown. About markdown please read [Mastering markdown](https://guides.github.com/features/mastering-markdown/) and [Writing on GitHub](https://help.github.com/categories/writing-on-github/)
2121

22-
#Pull-request template
22+
# Pull-request template
2323

2424
There is [PULL_REQUEST_TEMPLATE.md)](https://github.com/appium/java-client/blob/master/PULL_REQUEST_TEMPLATE.md) which should help you to make a good pull request.

docs/How-to-report-an-issue.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
#Be sure that it is not a server-side problem if you are facing something that looks like a bug
1+
# Be sure that it is not a server-side problem if you are facing something that looks like a bug
22

33
The Appium Java client is the thin client which just sends requests and receives responces generally.
44
Be sure that this bug is not reported [here](https://github.com/appium/appium/issues) and/or there is
55
no progress on this issue.
66

7-
#The good issue report should contain
7+
# The good issue report should contain
88

99
### Description
1010

@@ -42,9 +42,9 @@ There should be created a [gist](https://gist.github.com) which is a paste of yo
4242
If you are reporting a bug, _always_ include Appium logs as linked gists! It helps to define the problem correctly and clearly.
4343

4444

45-
#Issue template
45+
# Issue template
4646
There is [ISSUE_TEMPLATE.md](https://github.com/appium/java-client/blob/master/ISSUE_TEMPLATE.md) which should help you to make a good issue report.
4747

48-
#... And don't say that you weren't warned.
48+
# ... And don't say that you weren't warned.
4949

5050
If a report is not readable and/or there is no response from a reporter and some important details are needed then the issue will be closed after some time.

docs/Installing-the-project.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
#Requirements
1+
# Requirements
22

33
Firstly you should install appium server. [Appium getting started](http://appium.io/getting-started.html). The version 1.6.3 or greater is recommended.
44

55
Since version 5.x there many features based on Java 8. So we recommend to install JDK SE 8 and provide that source compatibility.
66

7-
#Maven
7+
# Maven
88

99
Add the following to pom.xml:
1010

@@ -40,7 +40,7 @@ If it is necessary to change the version of Selenium then you can configure pom.
4040
</dependency>
4141
```
4242

43-
#Gradle
43+
# Gradle
4444

4545
Add the following to build.gradle:
4646

docs/Page-objects.md

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ RemoteWebElement someElement;
145145
List<RemoteWebElement> someElements;
146146
```
147147

148-
## Also possible combined variants:
148+
## Also possible combined variants for target platforms:
149149

150150
```java
151151
import org.openqa.selenium.remote.RemoteWebElement;
@@ -194,6 +194,67 @@ RemoteWebElement someElement;
194194
List<RemoteWebElement> someElements;
195195
```
196196

197+
## Mixed chain/any locator strategy
198+
199+
Some locator-element could not be defined certainly sometimes. It may be defined as one of possible variants/chained locator.
200+
If the using of _xpath_ is not convenient for some reasons so there are possible use cases
201+
202+
### the chained searching
203+
204+
```java
205+
import org.openqa.selenium.remote.RemoteWebElement;
206+
import io.appium.java_client.pagefactory.*;
207+
import org.openqa.selenium.support.FindBys;
208+
import org.openqa.selenium.support.FindBy;
209+
210+
//it is necessary to define priorities at this case. The lower number means the higher priority.
211+
//The default value is 0 (the highest priority)
212+
@iOSFindBy(someStrategy1)
213+
@iOSFindAll(value = {@iOSBy(subloctor1), @iOSBy(subloctor1)}, priority = 1) //it means that the chained searching contains
214+
//the searching by all possible locators as the element of the chain
215+
@iOSFindBy(someStrategy2, priority = 2)
216+
@iOSFindBy(someStrategy3, priority = 3)
217+
RemoteWebElement someElement;
218+
219+
220+
@iOSFindBy(someStrategy1)
221+
@iOSFindAll(value = {@iOSBy(subloctor1), @iOSBy(subloctor1)}, priority = 1) //it means that the chained searching contains
222+
//the searching by all possible locators as the element of the chain
223+
@iOSFindBy(someStrategy2, priority = 2)
224+
@iOSFindBy(someStrategy3, priority = 3)
225+
List<RemoteWebElement> someElements;
226+
```
227+
228+
### all possible
229+
230+
```java
231+
import org.openqa.selenium.remote.RemoteWebElement;
232+
import io.appium.java_client.pagefactory.*;
233+
import org.openqa.selenium.support.FindBys;
234+
import org.openqa.selenium.support.FindBy;
235+
236+
//it is not necessary to define priorities at this case. But it can manage the searching.
237+
//The lower number means the higher priority.
238+
//The default value is 0 (the highest priority)
239+
@HowToUseLocators(iOSAutomation = ALL_POSSIBLE)
240+
@iOSFindBy(someStrategy1)
241+
@iOSFindBys(value = {@iOSBy(subloctor1), @iOSBy(subloctor1)}, priority = 1) //it means that the searching by all possible locators
242+
// contains the searching by chained locator as one of all possible variants
243+
@iOSFindBy(someStrategy2, priority = 2)
244+
@iOSFindBy(someStrategy3, priority = 3)
245+
RemoteWebElement someElement;
246+
247+
248+
249+
@HowToUseLocators(iOSAutomation = ALL_POSSIBLE)
250+
@iOSFindBy(someStrategy1)
251+
@iOSFindBys(value = {@iOSBy(subloctor1), @iOSBy(subloctor1)}, priority = 1) //it means that the searching by all possible locators
252+
// contains the searching by chained locator as one of all possible variants
253+
@iOSFindBy(someStrategy2, priority = 2)
254+
@iOSFindBy(someStrategy3, priority = 3)
255+
List<RemoteWebElement> someElements;
256+
```
257+
197258
# Appium Java client is integrated with Selenium PageFactory by AppiumFieldDecorator.
198259

199260
Object fields are populated as below:

docs/Tech-stack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Also tech stack includes [Spring framework](https://projects.spring.io/spring-fr
1212
It is the client framework. It is the thin client which just sends requests to Appium server and receives responses. Also it has some
1313
high-level features which were designed to simplify user's work.
1414

15-
#It supports:
15+
# It supports:
1616

1717
![](https://cloud.githubusercontent.com/assets/4927589/21467612/4b6b3f70-ca05-11e6-9a31-d3820e98dac6.png)
1818
![](https://cloud.githubusercontent.com/assets/4927589/21467614/73883828-ca05-11e6-846d-3ed8847a7e08.jpg)

0 commit comments

Comments
 (0)