Skip to content

Commit

Permalink
fix log done
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhouYixun committed Aug 3, 2022
1 parent 17eb8b8 commit 97a2d52
Show file tree
Hide file tree
Showing 9 changed files with 154 additions and 84 deletions.
7 changes: 4 additions & 3 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.9</version>
<version>1.0.10</version>
</dependency>
```

#### Gradle

```
implementation 'io.github.soniccloudorg:sonic-driver-core:1.0.9'
implementation 'io.github.soniccloudorg:sonic-driver-core:1.0.10'
```

### Code
Expand All @@ -80,7 +80,8 @@ public class MyTest {

public void test() throws SonicRespException {
IOSDriver iosDriver = new IOSDriver("http://localhost:8100");

iosDriver.showLog();

//touch
iosDriver.swipe(100, 256, 50, 256);
iosDriver.tap(150, 81);
Expand Down
5 changes: 3 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.9</version>
<version>1.0.10</version>
</dependency>
```
#### Gradle
```
implementation 'io.github.soniccloudorg:sonic-driver-core:1.0.9'
implementation 'io.github.soniccloudorg:sonic-driver-core:1.0.10'
```

### 代码
Expand All @@ -72,6 +72,7 @@ public class MyTest {

public void test() throws SonicRespException {
IOSDriver iosDriver = new IOSDriver("http://localhost:8100");
iosDriver.showLog();

//touch
iosDriver.swipe(100, 256, 50, 256);
Expand Down
15 changes: 4 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.github.soniccloudorg</groupId>
<artifactId>sonic-driver-core</artifactId>
<version>1.0.9</version>
<version>1.0.10</version>

<name>sonic-driver-core</name>
<description>The Sonic Project UIAutomation Driver Core for Android, iOS, Windows, Mac and so on.</description>
Expand All @@ -15,8 +15,11 @@
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>


<scm>
<tag>main</tag>
<url>/~https://github.com/SonicCloudOrg/sonic-driver-core</url>
Expand Down Expand Up @@ -59,16 +62,6 @@
</developers>

<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.32</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.32</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/org/cloud/sonic/core/ios/IOSDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,20 @@ public void closeDriver() throws SonicRespException {
wdaClient.closeSession();
}

/**
* show log.
*/
public void showLog() {
wdaClient.showLog();
}

/**
* disable log.
*/
public void disableLog() {
wdaClient.disableLog();
}

/**
* get device window size.
*
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/org/cloud/sonic/core/ios/service/WdaClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.cloud.sonic.core.ios.RespHandler;
import org.cloud.sonic.core.ios.models.TouchActions;
import org.cloud.sonic.core.ios.models.WindowSize;
import org.cloud.sonic.core.tool.Logger;
import org.cloud.sonic.core.tool.SonicRespException;

import java.util.List;
Expand All @@ -36,6 +37,12 @@ public interface WdaClient {

void setRespHandler(RespHandler respHandler);

Logger getLogger();

void showLog();

void disableLog();

//Session handler.
String getRemoteUrl();

Expand Down
Loading

0 comments on commit 97a2d52

Please sign in to comment.