diff --git a/pom.xml b/pom.xml index a25bad0..d0c01ce 100644 --- a/pom.xml +++ b/pom.xml @@ -1,16 +1,17 @@ - 4.0.0 appium 2.2.0 ${project.groupId}:${project.artifactId} - Automation Framework wrapped over Appium. + Robust Automation Framework wrapped over Appium. https://github.com/WasiqB/coteafs-appium com.github.wasiqb.coteafs parent - 2.0.1 + 2.0.1 @@ -25,8 +26,8 @@ - travis - https://travis-ci.org/WasiqB/coteafs-appium + Circle CI + https://circleci.com/gh/WasiqB/coteafs-appium @@ -35,6 +36,7 @@ 1.6.0 1.5.0 1.6.0 + 1.4 @@ -49,6 +51,11 @@ + + org.apache.commons + commons-text + ${commons.text.version} + com.github.wasiqb.coteafs error diff --git a/src/main/java/com/github/wasiqb/coteafs/appium/config/DeviceSetting.java b/src/main/java/com/github/wasiqb/coteafs/appium/config/DeviceSetting.java index 67e32a1..fc685d4 100644 --- a/src/main/java/com/github/wasiqb/coteafs/appium/config/DeviceSetting.java +++ b/src/main/java/com/github/wasiqb/coteafs/appium/config/DeviceSetting.java @@ -15,6 +15,8 @@ */ package com.github.wasiqb.coteafs.appium.config; +import static org.apache.commons.text.StringSubstitutor.replaceSystemProperties; + import com.github.wasiqb.coteafs.appium.config.enums.ApplicationType; import com.github.wasiqb.coteafs.appium.config.enums.AutomationName; import com.github.wasiqb.coteafs.appium.config.enums.Browser; @@ -79,7 +81,9 @@ public AndroidDeviceSetting getAndroid () { * @return the appLocation */ public String getAppLocation () { - return this.appLocation; + return this.appLocation.startsWith ("${") + ? replaceSystemProperties (this.appLocation) + : this.appLocation; } /** diff --git a/src/main/java/com/github/wasiqb/coteafs/appium/config/ServerSetting.java b/src/main/java/com/github/wasiqb/coteafs/appium/config/ServerSetting.java index 0bbc57c..1ea65d3 100644 --- a/src/main/java/com/github/wasiqb/coteafs/appium/config/ServerSetting.java +++ b/src/main/java/com/github/wasiqb/coteafs/appium/config/ServerSetting.java @@ -15,6 +15,8 @@ */ package com.github.wasiqb.coteafs.appium.config; +import static org.apache.commons.text.StringSubstitutor.replaceSystemProperties; + import java.util.HashMap; import java.util.Map; @@ -126,7 +128,9 @@ public String getNodePath () { * @return the password */ public String getPassword () { - return this.password; + return this.password.startsWith ("${") + ? replaceSystemProperties (this.password) + : this.password; } /** @@ -171,7 +175,9 @@ public long getStartUpTimeOutSeconds () { * @return the userName */ public String getUserName () { - return this.userName; + return this.userName.startsWith ("${") + ? replaceSystemProperties (this.userName) + : this.userName; } /** diff --git a/src/test/java/com/github/wasiqb/coteafs/appium/android/DefaultTest.java b/src/test/java/com/github/wasiqb/coteafs/appium/android/DefaultTest.java index 7f6f9e1..3054c66 100644 --- a/src/test/java/com/github/wasiqb/coteafs/appium/android/DefaultTest.java +++ b/src/test/java/com/github/wasiqb/coteafs/appium/android/DefaultTest.java @@ -39,7 +39,7 @@ public class DefaultTest { */ @BeforeMethod public void setupMethod () { - this.androidDevice = new AndroidDevice (this.androidServer, "test"); + this.androidDevice = new AndroidDevice (this.androidServer, "test_browserstack"); this.androidDevice.start (); login (); @@ -53,7 +53,7 @@ public void setupMethod () { */ @BeforeClass (alwaysRun = true) public void setupTestSuite () { - this.androidServer = new AppiumServer ("android"); + this.androidServer = new AppiumServer ("browserstack"); this.androidServer.start (); } @@ -82,7 +82,7 @@ public void tearDownTestSuite () { private void login () { final LoginActivityAction login = new LoginActivityAction (this.androidDevice); login.addInputValue ("UserName", "admin") - .addInputValue ("Password", "admin") - .perform (); + .addInputValue ("Password", "admin") + .perform (); } } \ No newline at end of file diff --git a/src/test/resources/appium-config.yaml b/src/test/resources/appium-config.yaml index e8f519c..b704206 100644 --- a/src/test/resources/appium-config.yaml +++ b/src/test/resources/appium-config.yaml @@ -1,15 +1,9 @@ servers: android: -# protocol: HTTP host: 0.0.0.0 port: 4723 -# cloud: true -# external: true - user_name: wasiqbhamla1 - password: CDbp8qTdCa7nVtxur9fp appium_js_path: C:\Users\wasiqb\AppData\Roaming\npm\node_modules\appium\build\lib\main.js node_path: C:\Program Files\nodejs\node.exe -# external: true arguments: log_level: DEBUG log_time_stamp: true @@ -17,9 +11,16 @@ servers: session_override: true android: suppress_adb_kill_server: true + browserstack: + protocol: HTTPS + host: hub-cloud.browserstack.com + cloud: true + external: true + user_name: ${env.user} + password: ${env.pass} devices: - test: + test_local: platform_type: ANDROID device_name: Samsung Galaxy S8 device_version: 7.0 @@ -27,8 +28,22 @@ devices: device_type: REAL automation_name: APPIUM app_location: apps/android/VodQA.apk -# app_location: bs://d5fbc8a52dd7bad1535da8d2c7a4bbc2178c8081 -# cloud_app: true + session_timeout: 120000 + playback: + delay_before_swipe: 2 + delay_after_swipe: 1 + delay_before_tap: 2 + delay_after_tap: 1 + 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: apps/android/VodQA.apk + app_location: ${env.app} + cloud_app: true session_timeout: 120000 playback: delay_before_swipe: 2