Skip to content

Commit

Permalink
Merge pull request #61 from WasiqB/issue-50
Browse files Browse the repository at this point in the history
Issue 50 approved.
  • Loading branch information
mfaisalkhatri authored Sep 30, 2018
2 parents 555aaea + bd2f13f commit 4c501cc
Show file tree
Hide file tree
Showing 18 changed files with 301 additions and 87 deletions.
8 changes: 6 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
- repo-reports-{{ .Branch }}-{{ .Revision }}
- run:
name: Update Sonar Analysis
command: mvn package sonar:sonar -Dsonar.host.url=$SONAR_HOST -Dsonar.organization=$SONAR_ORG -Dsonar.login=$SONAR_KEY
command: mvn package sonar:sonar -Dsonar.host.url=$SONAR_HOST -Dsonar.organization=$SONAR_ORG -Dsonar.login=$SONAR_KEY -DskipTests=true

filters: &all_branches
branches:
Expand All @@ -88,4 +88,8 @@ workflows:
- build:
filters: *all_branches
requires:
- resolve_dependencies
- resolve_dependencies
- code_analysis:
filters: *all_branches
requires:
- build
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,14 @@
*/
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;
import com.github.wasiqb.coteafs.appium.config.enums.DeviceType;
import com.github.wasiqb.coteafs.appium.config.enums.PlatformType;

/**
* @author wasiq.bhamla
* @since 12-Apr-2017 8:34:28 PM
Expand All @@ -26,6 +34,7 @@ public class DeviceSetting {
private AutomationName automationName;
private Browser browser;
private boolean clearSystemFiles;
private boolean cloudApp;
private String deviceName;
private DeviceType deviceType;
private String deviceVersion;
Expand Down Expand Up @@ -54,6 +63,7 @@ public DeviceSetting () {
this.externalApp = false;
this.clearSystemFiles = false;
this.sessionTimeout = 120;
this.cloudApp = false;
}

/**
Expand All @@ -71,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 Expand Up @@ -191,6 +203,15 @@ public boolean isClearSystemFiles () {
return this.clearSystemFiles;
}

/**
* @author wasiqb
* @since Sep 29, 2018
* @return the cloudApp
*/
public boolean isCloudApp () {
return this.cloudApp;
}

/**
* @author wasiq.bhamla
* @since Nov 19, 2017 9:54:14 PM
Expand Down Expand Up @@ -287,6 +308,16 @@ public void setClearSystemFiles (final boolean clearSystemFiles) {
this.clearSystemFiles = clearSystemFiles;
}

/**
* @author wasiqb
* @since Sep 29, 2018
* @param cloudApp
* the cloudApp to set
*/
public void setCloudApp (final boolean cloudApp) {
this.cloudApp = cloudApp;
}

/**
* @author wasiq.bhamla
* @since 12-Apr-2017 8:42:49 PM
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 com.github.wasiqb.coteafs.appium.config.enums.LogLevel;

/**
* @author wasiq.bhamla
* @since Oct 27, 2017 1:26:27 PM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@
*/
package com.github.wasiqb.coteafs.appium.config;

import static org.apache.commons.text.StringSubstitutor.replaceSystemProperties;

import java.util.HashMap;
import java.util.Map;

import com.github.wasiqb.coteafs.appium.config.enums.Protocol;

/**
* @author wasiq.bhamla
* @since 12-Apr-2017 8:43:22 PM
Expand All @@ -31,30 +35,37 @@ public class ServerSetting {

private String appiumJsPath;
private ServerArgumentSetting arguments;
private boolean cloud;
private Map <String, String> environmentVariables;
private boolean external;
private boolean fullReset;
private String ip;
private String host;
private String logFilePath;
private String nodePath;
private boolean noReset;
private String password;
private int port;
private Protocol protocol;
private int sessionTimeout;
private long startUpTimeOutSeconds;
private String userName;

/**
* @author wasiq.bhamla
* @since 08-May-2017 7:49:49 PM
*/
public ServerSetting () {
countInstance++;
this.cloud = false;
this.external = false;
this.noReset = false;
this.fullReset = false;
this.sessionTimeout = 120;
this.startUpTimeOutSeconds = 60;
this.environmentVariables = new HashMap <> ();
this.logFilePath = String.format ("%s/logs/server-%d.log", System.getProperty ("user.dir"), countInstance);
this.protocol = Protocol.HTTP;
this.logFilePath = String.format ("%s/logs/server-%d.log", System.getProperty ("user.dir"),
countInstance);
}

/**
Expand Down Expand Up @@ -87,10 +98,10 @@ public Map <String, String> getEnvironmentVariables () {
/**
* @author wasiq.bhamla
* @since 12-Apr-2017 8:51:26 PM
* @return the ip
* @return the host
*/
public String getIp () {
return this.ip;
public String getHost () {
return this.host;
}

/**
Expand All @@ -111,6 +122,17 @@ public String getNodePath () {
return this.nodePath;
}

/**
* @author wasiqb
* @since Sep 29, 2018
* @return the password
*/
public String getPassword () {
return this.password.startsWith ("${")
? replaceSystemProperties (this.password)
: this.password;
}

/**
* @author wasiq.bhamla
* @since 12-Apr-2017 8:51:26 PM
Expand All @@ -120,6 +142,15 @@ public int getPort () {
return this.port;
}

/**
* @author wasiqb
* @since Sep 29, 2018
* @return the protocol
*/
public Protocol getProtocol () {
return this.protocol;
}

/**
* @author wasiq.bhamla
* @since 08-May-2017 7:49:31 PM
Expand All @@ -138,6 +169,26 @@ public long getStartUpTimeOutSeconds () {
return this.startUpTimeOutSeconds;
}

/**
* @author wasiqb
* @since Sep 29, 2018
* @return the userName
*/
public String getUserName () {
return this.userName.startsWith ("${")
? replaceSystemProperties (this.userName)
: this.userName;
}

/**
* @author wasiqb
* @since Sep 29, 2018
* @return the cloud
*/
public boolean isCloud () {
return this.cloud;
}

/**
* @author wasiq.bhamla
* @since 21-Apr-2017 5:06:22 PM
Expand Down Expand Up @@ -185,6 +236,16 @@ public void setArguments (final ServerArgumentSetting arguments) {
this.arguments = arguments;
}

/**
* @author wasiqb
* @since Sep 29, 2018
* @param cloud
* the cloud to set
*/
public void setCloud (final boolean cloud) {
this.cloud = cloud;
}

/**
* @author wasiq.bhamla
* @since Oct 27, 2017 1:28:09 PM
Expand Down Expand Up @@ -218,11 +279,11 @@ public void setFullReset (final boolean fullReset) {
/**
* @author wasiq.bhamla
* @since 12-Apr-2017 8:51:26 PM
* @param ip
* the ip to set
* @param host
* the host to set
*/
public void setIp (final String ip) {
this.ip = ip;
public void setHost (final String host) {
this.host = host;
}

/**
Expand Down Expand Up @@ -255,6 +316,16 @@ public void setNoReset (final boolean noReset) {
this.noReset = noReset;
}

/**
* @author wasiqb
* @since Sep 29, 2018
* @param password
* the password to set
*/
public void setPassword (final String password) {
this.password = password;
}

/**
* @author wasiq.bhamla
* @since 12-Apr-2017 8:51:26 PM
Expand All @@ -265,6 +336,16 @@ public void setPort (final int port) {
this.port = port;
}

/**
* @author wasiqb
* @since Sep 29, 2018
* @param protocol
* the protocol to set
*/
public void setProtocol (final Protocol protocol) {
this.protocol = protocol;
}

/**
* @author wasiq.bhamla
* @since 08-May-2017 7:49:31 PM
Expand All @@ -284,4 +365,14 @@ public void setSessionTimeout (final int sessionTimeout) {
public void setStartUpTimeOutSeconds (final long startUpTimeOutSeconds) {
this.startUpTimeOutSeconds = startUpTimeOutSeconds;
}

/**
* @author wasiqb
* @since Sep 29, 2018
* @param userName
* the userName to set
*/
public void setUserName (final String userName) {
this.userName = userName;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.github.wasiqb.coteafs.appium.config;
package com.github.wasiqb.coteafs.appium.config.enums;

/**
* @author wasiq.bhamla
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.github.wasiqb.coteafs.appium.config;
package com.github.wasiqb.coteafs.appium.config.enums;

/**
* @author wasiq.bhamla
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.github.wasiqb.coteafs.appium.config;
package com.github.wasiqb.coteafs.appium.config.enums;

import io.appium.java_client.remote.MobileBrowserType;

Expand Down
Loading

0 comments on commit 4c501cc

Please sign in to comment.