Skip to content

Commit

Permalink
Updated for parameterized config keys.
Browse files Browse the repository at this point in the history
  • Loading branch information
WasiqB committed Sep 30, 2018
1 parent 0b82a54 commit bd2f13f
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 21 deletions.
17 changes: 12 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>appium</artifactId>
<version>2.2.0</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>Automation Framework wrapped over Appium.</description>
<description>Robust Automation Framework wrapped over Appium.</description>
<url>https://github.com/WasiqB/coteafs-appium</url>

<parent>
<groupId>com.github.wasiqb.coteafs</groupId>
<artifactId>parent</artifactId>
<version>2.0.1</version>
<version>2.0.1</version>
</parent>

<scm>
Expand All @@ -25,8 +26,8 @@
</issueManagement>

<ciManagement>
<system>travis</system>
<url>https://travis-ci.org/WasiqB/coteafs-appium</url>
<system>Circle CI</system>
<url>https://circleci.com/gh/WasiqB/coteafs-appium</url>
</ciManagement>

<properties>
Expand All @@ -35,6 +36,7 @@
<coteafs.config.version>1.6.0</coteafs.config.version>
<coteafs.error.version>1.5.0</coteafs.error.version>
<coteafs.logger.version>1.6.0</coteafs.logger.version>
<commons.text.version>1.4</commons.text.version>
</properties>

<dependencies>
Expand All @@ -49,6 +51,11 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>${commons.text.version}</version>
</dependency>
<dependency>
<groupId>com.github.wasiqb.coteafs</groupId>
<artifactId>error</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -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;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ();
Expand All @@ -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 ();
}

Expand Down Expand Up @@ -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 ();
}
}
33 changes: 24 additions & 9 deletions src/test/resources/appium-config.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,49 @@
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
local_time_zone: true
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
app_type: HYBRID
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
Expand Down

0 comments on commit bd2f13f

Please sign in to comment.