Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 63 #76

Merged
merged 3 commits into from
Oct 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public static void checkCapabilitiesParams (final String key, final Object value
* @param element
* @param name
*/
public static void checkDeviceElementDisplayed (final MobileElement element, final String name) {
public static void checkDeviceElementDisplayed (final MobileElement element,
final String name) {
if (!element.isDisplayed ()) {
final String msg = "Device element [%s] is not displayed.";
fail (DeviceElementNotDisplayedError.class, String.format (msg, name));
Expand All @@ -67,10 +68,6 @@ public static void checkDeviceElementEnabled (final MobileElement element, final
}
}

/**
* @author wasiq.bhamla
* @since Jul 22, 2017 10:12:20 PM
*/
private DeviceChecker () {
// Utility class.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ public static void checkServerRunning (final AppiumServer server) {
}
}

/**
* @author wasiq.bhamla
* @since Jul 22, 2017 10:50:03 PM
*/
private ServerChecker () {
// Utility class.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,20 @@
* @since 12-Apr-2017 8:58:57 PM
*/
public class AppiumSetting {
private DeviceSetting device;
private Map <String, DeviceSetting> devices;
private ServerSetting server;
private Map <String, ServerSetting> servers;

/**
* @author wasiqb
* @since Oct 16, 2018
* @return the device
*/
public DeviceSetting getDevice () {
return this.device;
}

/**
* @author wasiq.bhamla
* @param key
Expand All @@ -44,6 +55,15 @@ public Map <String, DeviceSetting> getDevices () {
return this.devices;
}

/**
* @author wasiqb
* @since Oct 16, 2018
* @return the server
*/
public ServerSetting getServer () {
return this.server;
}

/**
* @author wasiq.bhamla
* @param key
Expand All @@ -63,6 +83,16 @@ public Map <String, ServerSetting> getServers () {
return this.servers;
}

/**
* @author wasiqb
* @since Oct 16, 2018
* @param device
* the device to set
*/
public void setDevice (final DeviceSetting device) {
this.device = device;
}

/**
* @author wasiq.bhamla
* @since 13-Apr-2017 9:59:40 PM
Expand All @@ -73,6 +103,16 @@ public void setDevices (final Map <String, DeviceSetting> devices) {
this.devices = devices;
}

/**
* @author wasiqb
* @since Oct 16, 2018
* @param server
* the server to set
*/
public void setServer (final ServerSetting server) {
this.server = server;
}

/**
* @author wasiq.bhamla
* @since 13-Apr-2017 9:59:40 PM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public DeviceSetting () {
this.clearSystemFiles = false;
this.sessionTimeout = 120;
this.cloudApp = false;
this.playback = new PlaybackSetting ();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public class ServerArgumentSetting {
*/
public ServerArgumentSetting () {
this.logLevel = LogLevel.ERROR;
this.android = new AndroidArgumentSetting ();
this.ios = new IOSArgumentSetting ();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@
* @since 12-Apr-2017 8:43:22 PM
*/
public class ServerSetting {
private static int countInstance;

static {
countInstance = 0;
}
private static int countInstance = 0;

private String appiumJsPath;
private ServerArgumentSetting arguments;
Expand Down Expand Up @@ -65,7 +61,8 @@ public ServerSetting () {
this.environmentVariables = new HashMap <> ();
this.protocol = Protocol.HTTP;
this.logFilePath = String.format ("%s/logs/server-%d.log", System.getProperty ("user.dir"),
countInstance);
countInstance);
this.arguments = new ServerArgumentSetting ();
}

/**
Expand Down
61 changes: 28 additions & 33 deletions src/test/resources/appium-config.yaml
Original file line number Diff line number Diff line change
@@ -1,54 +1,49 @@
server: &default_server
appium_js_path: C:\Users\wasiqb\AppData\Roaming\npm\node_modules\appium\build\lib\main.js
node_path: C:\Program Files\nodejs\node.exe
arguments:
log_level: DEBUG
log_time_stamp: true
local_time_zone: true
session_override: true
android:
suppress_adb_kill_server: true

servers:
android:
host: 0.0.0.0
port: 4723
appium_js_path: C:\Users\wasiqb\AppData\Roaming\npm\node_modules\appium\build\lib\main.js
node_path: C:\Program Files\nodejs\node.exe
arguments:
log_level: DEBUG
log_time_stamp: true
local_time_zone: true
session_override: true
android:
suppress_adb_kill_server: true
<<: *default_server
browserstack:
protocol: HTTPS
host: hub-cloud.browserstack.com
cloud: true
user_name: ${env.user}
password: ${env.pass}

device: &default_device
platform_type: ANDROID
app_type: HYBRID
device_type: REAL
automation_name: APPIUM
session_timeout: 120000
playback:
record:
enabled: true
delay_before_swipe: 2
delay_after_swipe: 1
delay_before_tap: 2
delay_after_tap: 1

devices:
test_local:
platform_type: ANDROID
device_name: MI Redmi Note 4
device_version: 7.0
app_type: HYBRID
device_type: REAL
automation_name: APPIUM
app_location: apps/android/VodQA.apk
session_timeout: 120000
playback:
record:
enabled: true
delay_before_swipe: 2
delay_after_swipe: 1
delay_before_tap: 2
delay_after_tap: 1
<<: *default_device
test_browserstack:
platform_type: ANDROID
device_name: Samsung Galaxy S8
device_version: 7.0
app_type: HYBRID
device_type: REAL
automation_name: APPIUM
app_location: ${env.app}
cloud_app: true
session_timeout: 120000
playback:
record:
enabled: true
delay_before_swipe: 2
delay_after_swipe: 1
delay_before_tap: 2
delay_after_tap: 1
<<: *default_device