Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Aniona
java-client
提交
2c2141ec
J
java-client
项目概览
Aniona
/
java-client
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
java-client
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2c2141ec
编写于
4月 02, 2020
作者:
T
titusfortner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: create android and ios driver option classes
上级
cc4003f8
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
288 addition
and
1 deletion
+288
-1
src/main/java/io/appium/java_client/android/AndroidOptions.java
...in/java/io/appium/java_client/android/AndroidOptions.java
+32
-0
src/main/java/io/appium/java_client/ios/IOSOptions.java
src/main/java/io/appium/java_client/ios/IOSOptions.java
+32
-0
src/main/java/io/appium/java_client/remote/MobileCapabilityType.java
...va/io/appium/java_client/remote/MobileCapabilityType.java
+1
-1
src/main/java/io/appium/java_client/remote/MobileOptions.java
...main/java/io/appium/java_client/remote/MobileOptions.java
+223
-0
未找到文件。
src/main/java/io/appium/java_client/android/AndroidOptions.java
0 → 100644
浏览文件 @
2c2141ec
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
* You may obtain a copy of the License at
*
* http://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
io.appium.java_client.android
;
import
io.appium.java_client.remote.MobileOptions
;
import
io.appium.java_client.remote.MobilePlatform
;
import
org.openqa.selenium.Capabilities
;
public
class
AndroidOptions
extends
MobileOptions
<
AndroidOptions
>
{
public
AndroidOptions
()
{
setPlatformName
(
MobilePlatform
.
ANDROID
);
}
public
AndroidOptions
(
Capabilities
source
)
{
this
();
merge
(
source
);
}
}
src/main/java/io/appium/java_client/ios/IOSOptions.java
0 → 100644
浏览文件 @
2c2141ec
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
* You may obtain a copy of the License at
*
* http://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
io.appium.java_client.ios
;
import
io.appium.java_client.remote.MobileOptions
;
import
io.appium.java_client.remote.MobilePlatform
;
import
org.openqa.selenium.Capabilities
;
public
class
IOSOptions
extends
MobileOptions
<
IOSOptions
>
{
public
IOSOptions
()
{
setPlatformName
(
MobilePlatform
.
IOS
);
}
public
IOSOptions
(
Capabilities
source
)
{
this
();
merge
(
source
);
}
}
src/main/java/io/appium/java_client/remote/MobileCapabilityType.java
浏览文件 @
2c2141ec
...
@@ -120,7 +120,7 @@ public interface MobileCapabilityType extends CapabilityType {
...
@@ -120,7 +120,7 @@ public interface MobileCapabilityType extends CapabilityType {
String
EVENT_TIMINGS
=
"eventTimings"
;
String
EVENT_TIMINGS
=
"eventTimings"
;
/**
/**
* This is the flag which forces server to switch to the mobile
W
SONWP.
* This is the flag which forces server to switch to the mobile
J
SONWP.
* If {@code false} then it is switched to W3C mode.
* If {@code false} then it is switched to W3C mode.
*/
*/
String
FORCE_MJSONWP
=
"forceMjsonwp"
;
String
FORCE_MJSONWP
=
"forceMjsonwp"
;
...
...
src/main/java/io/appium/java_client/remote/MobileOptions.java
0 → 100644
浏览文件 @
2c2141ec
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
* You may obtain a copy of the License at
*
* http://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
io.appium.java_client.remote
;
import
org.openqa.selenium.Capabilities
;
import
org.openqa.selenium.MutableCapabilities
;
import
org.openqa.selenium.ScreenOrientation
;
import
org.openqa.selenium.remote.CapabilityType
;
import
java.net.URL
;
import
java.time.Duration
;
public
class
MobileOptions
<
T
extends
MobileOptions
<
T
>>
extends
MutableCapabilities
{
public
MobileOptions
()
{
}
public
MobileOptions
(
Capabilities
source
)
{
merge
(
source
);
}
public
T
setPlatformName
(
String
platform
)
{
return
amend
(
CapabilityType
.
PLATFORM_NAME
,
platform
);
}
public
String
getPlatformName
()
{
return
(
String
)
getCapability
(
CapabilityType
.
PLATFORM_NAME
);
}
public
T
setApp
(
String
path
)
{
return
amend
(
MobileCapabilityType
.
APP
,
path
);
}
public
T
setApp
(
URL
url
)
{
return
setApp
(
url
.
toString
());
}
public
String
getApp
()
{
return
(
String
)
getCapability
(
MobileCapabilityType
.
APP
);
}
public
T
setAutomationName
(
String
name
)
{
return
amend
(
MobileCapabilityType
.
AUTOMATION_NAME
,
name
);
}
public
String
getAutomationName
()
{
return
(
String
)
getCapability
(
MobileCapabilityType
.
AUTOMATION_NAME
);
}
public
T
setAutoWebview
()
{
return
setAutoWebview
(
true
);
}
public
T
setAutoWebview
(
boolean
bool
)
{
return
amend
(
MobileCapabilityType
.
AUTO_WEBVIEW
,
bool
);
}
public
boolean
doesAutoWebview
()
{
return
(
boolean
)
getCapability
(
MobileCapabilityType
.
AUTO_WEBVIEW
);
}
public
T
setClearSystemFiles
()
{
return
setClearSystemFiles
(
true
);
}
public
T
setClearSystemFiles
(
boolean
bool
)
{
return
amend
(
MobileCapabilityType
.
CLEAR_SYSTEM_FILES
,
bool
);
}
public
boolean
doesClearSystemFiles
()
{
return
(
boolean
)
getCapability
(
MobileCapabilityType
.
CLEAR_SYSTEM_FILES
);
}
public
T
setDeviceName
(
String
deviceName
)
{
return
amend
(
MobileCapabilityType
.
DEVICE_NAME
,
deviceName
);
}
public
String
getDeviceName
()
{
return
(
String
)
getCapability
(
MobileCapabilityType
.
DEVICE_NAME
);
}
public
T
setEnablePerformanceLogging
()
{
return
setEnablePerformanceLogging
(
true
);
}
public
T
setEnablePerformanceLogging
(
boolean
bool
)
{
return
amend
(
MobileCapabilityType
.
ENABLE_PERFORMANCE_LOGGING
,
bool
);
}
public
boolean
isEnablePerformanceLogging
()
{
return
(
boolean
)
getCapability
(
MobileCapabilityType
.
ENABLE_PERFORMANCE_LOGGING
);
}
public
T
setEventTimings
()
{
return
setEventTimings
(
true
);
}
public
T
setEventTimings
(
boolean
bool
)
{
return
amend
(
MobileCapabilityType
.
EVENT_TIMINGS
,
bool
);
}
public
boolean
doesEventTimings
()
{
return
(
boolean
)
getCapability
(
MobileCapabilityType
.
EVENT_TIMINGS
);
}
public
T
setFullReset
()
{
return
setFullReset
(
true
);
}
public
T
setFullReset
(
boolean
bool
)
{
return
amend
(
MobileCapabilityType
.
FULL_RESET
,
bool
);
}
public
boolean
doesFullReset
()
{
return
(
boolean
)
getCapability
(
MobileCapabilityType
.
FULL_RESET
);
}
public
T
setLanguage
(
String
language
)
{
return
amend
(
MobileCapabilityType
.
LANGUAGE
,
language
);
}
public
String
getLanguage
()
{
return
(
String
)
getCapability
(
MobileCapabilityType
.
LANGUAGE
);
}
public
T
setLocale
(
String
locale
)
{
return
amend
(
MobileCapabilityType
.
LOCALE
,
locale
);
}
public
String
getLocale
()
{
return
(
String
)
getCapability
(
MobileCapabilityType
.
LOCALE
);
}
public
T
setNewCommandTimeout
(
Duration
duration
)
{
return
amend
(
MobileCapabilityType
.
NEW_COMMAND_TIMEOUT
,
duration
.
getSeconds
());
}
public
Duration
getNewCommandTimeout
()
{
Object
duration
=
getCapability
(
MobileCapabilityType
.
NEW_COMMAND_TIMEOUT
);
return
Duration
.
ofSeconds
(
Long
.
parseLong
(
""
+
duration
));
}
public
T
setNoReset
()
{
return
setNoReset
(
true
);
}
public
T
setNoReset
(
boolean
bool
)
{
return
amend
(
MobileCapabilityType
.
NO_RESET
,
bool
);
}
public
boolean
doesNoReset
()
{
return
(
boolean
)
getCapability
(
MobileCapabilityType
.
NO_RESET
);
}
public
T
setOrientation
(
ScreenOrientation
orientation
)
{
return
amend
(
MobileCapabilityType
.
ORIENTATION
,
orientation
);
}
public
ScreenOrientation
getOrientation
()
{
return
(
ScreenOrientation
)
getCapability
(
MobileCapabilityType
.
ORIENTATION
);
}
public
T
setOtherApps
(
String
apps
)
{
return
amend
(
MobileCapabilityType
.
OTHER_APPS
,
apps
);
}
public
String
getOtherApps
()
{
return
(
String
)
getCapability
(
MobileCapabilityType
.
OTHER_APPS
);
}
public
T
setPlatformVersion
(
String
version
)
{
return
amend
(
MobileCapabilityType
.
PLATFORM_VERSION
,
version
);
}
public
String
getPlatformVersion
()
{
return
(
String
)
getCapability
(
MobileCapabilityType
.
PLATFORM_VERSION
);
}
public
T
setPrintPageSourceOnFindFailure
()
{
return
setPrintPageSourceOnFindFailure
(
true
);
}
public
T
setPrintPageSourceOnFindFailure
(
boolean
bool
)
{
return
amend
(
MobileCapabilityType
.
PRINT_PAGE_SOURCE_ON_FIND_FAILURE
,
bool
);
}
public
boolean
doesPrintPageSourceOnFindFailure
()
{
return
(
boolean
)
getCapability
(
MobileCapabilityType
.
PRINT_PAGE_SOURCE_ON_FIND_FAILURE
);
}
public
T
setUdid
(
String
id
)
{
return
amend
(
MobileCapabilityType
.
UDID
,
id
);
}
public
String
getUdid
()
{
return
(
String
)
getCapability
(
MobileCapabilityType
.
UDID
);
}
@Override
public
T
merge
(
Capabilities
extraCapabilities
)
{
super
.
merge
(
extraCapabilities
);
return
(
T
)
this
;
}
protected
T
amend
(
String
optionName
,
Object
value
)
{
setCapability
(
optionName
,
value
);
return
(
T
)
this
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录