Skip to content

Commit

Permalink
feat: update global interval
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhouYixun committed Sep 10, 2022
1 parent 691c36c commit 30d1aa6
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
java-version: '8'
distribution: 'temurin'
cache: maven
- run: sed -i "s/SONIC_REMOTE_TEST_URL/${{ secrets.REMOTE_TEST_URL }}/g" src/test/java/org/cloud/sonic/core/ios/IOSDriverTest.java
- run: sed -i "s/SONIC_REMOTE_TEST_URL/${{ secrets.REMOTE_TEST_URL }}/g" src/test/java/org/cloud/sonic/core/ios/service/WdaClientTest.java
- run: sed -i "s/SONIC_REMOTE_TEST_URL/${{ secrets.REMOTE_TEST_URL }}/g" src/test/java/org/cloud/sonic/driver/ios/IOSDriverTest.java
- run: sed -i "s/SONIC_REMOTE_TEST_URL/${{ secrets.REMOTE_TEST_URL }}/g" src/test/java/org/cloud/sonic/driver/ios/service/WdaClientTest.java
- name: Validate and Compile with Maven
run: mvn cobertura:cobertura
- name: upload codecov
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: update readme doc

on:
release:
types: [published]
push:
tags:
- "*.*.*"

jobs:
release:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ sonic-driver-core can be separated from appium and interact directly with webdri
<dependency>
<groupId>io.github.soniccloudorg</groupId>
<artifactId>sonic-driver-core</artifactId>
<version>1.0.16</version>
<version>1.0.17</version>
</dependency>
```

#### Gradle

```
implementation 'io.github.soniccloudorg:sonic-driver-core:1.0.16'
implementation 'io.github.soniccloudorg:sonic-driver-core:1.0.17'
```

### Code
Expand Down
4 changes: 2 additions & 2 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ sonic-driver-core可以脱离Appium,直接与WebDriverAgent或UIautomator2交
<dependency>
<groupId>io.github.soniccloudorg</groupId>
<artifactId>sonic-driver-core</artifactId>
<version>1.0.16</version>
<version>1.0.17</version>
</dependency>
```
#### Gradle
```
implementation 'io.github.soniccloudorg:sonic-driver-core:1.0.16'
implementation 'io.github.soniccloudorg:sonic-driver-core:1.0.17'
```

### 代码
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/org/cloud/sonic/driver/ios/IOSDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,16 @@ public void appAuthReset(AuthResource authResource) throws SonicRespException {
appAuthReset(authResource.getResource());
}

/**
* set default FindElement retry time and interval.
*
* @param retry
* @param interval
*/
public void setDefaultFindElementInterval(Integer retry, Integer interval) {
wdaClient.setDefaultFindElementInterval(retry, interval);
}

/**
* find element in device.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ public interface WdaClient {
void appAuthReset(int resource) throws SonicRespException;

//element handler.
void setDefaultFindElementInterval(Integer retry, Integer interval);

WebElement findElement(String selector, String value, Integer retry, Integer interval) throws SonicRespException;

List<WebElement> findElementList(String selector, String value, Integer retry, Integer interval) throws SonicRespException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,16 @@ public void appAuthReset(int resource) throws SonicRespException {
}
}

@Override
public void setDefaultFindElementInterval(Integer retry, Integer interval) {
if (retry != null) {
FIND_ELEMENT_RETRY = retry;
}
if (interval != null) {
FIND_ELEMENT_INTERVAL = interval;
}
}

@Override
public WebElement findElement(String selector, String value, Integer retry, Integer interval) throws SonicRespException {
WebElement webElement = null;
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/org/cloud/sonic/driver/ios/IOSDriverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ public void testFindElement() throws SonicRespException, InterruptedException, I
imageOutput.close();
output.delete();
iosDriver.findElement(IOSSelector.ACCESSIBILITY_ID, "取消").click();
iosDriver.setDefaultFindElementInterval(null, 3000);
iosDriver.setDefaultFindElementInterval(5, null);
iosDriver.pressButton(SystemButton.HOME);
}

Expand Down

0 comments on commit 30d1aa6

Please sign in to comment.