forked from SonicCloudOrg/sonic-driver-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
78 deletions.
There are no files selected for viewing
97 changes: 19 additions & 78 deletions
97
src/main/java/org/cloud/sonic/driver/common/service/BaseClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,33 @@ | ||
/* | ||
* Copyright (C) [SonicCloudOrg] Sonic Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http:https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
package org.cloud.sonic.driver.common.service; | ||
|
||
import com.alibaba.fastjson.JSONObject; | ||
import org.cloud.sonic.driver.ios.models.TouchActions; | ||
import org.cloud.sonic.driver.ios.models.WindowSize; | ||
import org.cloud.sonic.driver.ios.service.WebElement; | ||
import org.cloud.sonic.driver.tool.Logger; | ||
import org.cloud.sonic.driver.tool.RespHandler; | ||
import org.cloud.sonic.driver.tool.SonicRespException; | ||
|
||
import java.util.List; | ||
import org.cloud.sonic.driver.common.tool.Logger; | ||
import org.cloud.sonic.driver.common.tool.RespHandler; | ||
import org.cloud.sonic.driver.common.tool.SonicRespException; | ||
|
||
public interface BaseClient { | ||
//Client Setting | ||
void setGlobalTimeOut(int timeOut); | ||
|
||
RespHandler getRespHandler(); | ||
|
||
void setRespHandler(RespHandler respHandler); | ||
|
||
Logger getLogger(); | ||
|
||
void showLog(); | ||
|
||
void disableLog(); | ||
|
||
//Session handler. | ||
String getRemoteUrl(); | ||
|
||
void setRemoteUrl(String remoteUrl); | ||
|
||
String getSessionId(); | ||
|
||
void setSessionId(String sessionId); | ||
|
||
void newSession(JSONObject capabilities) throws SonicRespException; | ||
|
||
void closeSession() throws SonicRespException; | ||
|
||
void checkSessionId() throws SonicRespException; | ||
|
||
//window handler. | ||
WindowSize getWindowSize() throws SonicRespException; | ||
|
||
//lock handler. | ||
boolean isLocked() throws SonicRespException; | ||
|
||
void lock() throws SonicRespException; | ||
|
||
void unlock() throws SonicRespException; | ||
|
||
//perform handler. | ||
void performTouchAction(TouchActions touchActions) throws SonicRespException; | ||
|
||
//button handler. | ||
void pressButton(String buttonName) throws SonicRespException; | ||
|
||
//keyboard handler. | ||
void sendKeys(String text, Integer frequency) throws SonicRespException; | ||
|
||
void setPasteboard(String contentType, String content) throws SonicRespException; | ||
|
||
byte[] getPasteboard(String contentType) throws SonicRespException; | ||
|
||
//source handler. | ||
String pageSource() throws SonicRespException; | ||
|
||
//siri handler. | ||
void sendSiriCommand(String command) throws SonicRespException; | ||
|
||
//app handler. | ||
void appActivate(String bundleId) throws SonicRespException; | ||
|
||
boolean appTerminate(String bundleId) throws SonicRespException; | ||
|
||
void appRunBackground(int duration) throws SonicRespException; | ||
|
||
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; | ||
|
||
//screen handler. | ||
byte[] screenshot() throws SonicRespException; | ||
|
||
//appium setting handler. | ||
void setAppiumSettings(JSONObject settings) throws SonicRespException; | ||
} |