Skip to content

Commit

Permalink
Changes made for #50 for BrowserStack support.
Browse files Browse the repository at this point in the history
  • Loading branch information
WasiqB committed Sep 30, 2018
1 parent 555aaea commit 431cc0e
Show file tree
Hide file tree
Showing 15 changed files with 256 additions and 72 deletions.
6 changes: 5 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,8 @@ workflows:
- build:
filters: *all_branches
requires:
- resolve_dependencies
- resolve_dependencies
- code_analysis:
filters: *all_branches
requires:
- build
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
*/
package com.github.wasiqb.coteafs.appium.config;

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 +32,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 +61,7 @@ public DeviceSetting () {
this.externalApp = false;
this.clearSystemFiles = false;
this.sessionTimeout = 120;
this.cloudApp = false;
}

/**
Expand Down Expand Up @@ -191,6 +199,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 +304,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 @@ -18,6 +18,8 @@
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 +33,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 +96,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 +120,15 @@ public String getNodePath () {
return this.nodePath;
}

/**
* @author wasiqb
* @since Sep 29, 2018
* @return the password
*/
public String getPassword () {
return this.password;
}

/**
* @author wasiq.bhamla
* @since 12-Apr-2017 8:51:26 PM
Expand All @@ -120,6 +138,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 +165,24 @@ public long getStartUpTimeOutSeconds () {
return this.startUpTimeOutSeconds;
}

/**
* @author wasiqb
* @since Sep 29, 2018
* @return the userName
*/
public String getUserName () {
return 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 +230,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 +273,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 +310,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 +330,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 +359,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
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.MobilePlatform;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* Copyright (c) 2017-2020, Wasiq Bhamla.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* 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 com.github.wasiqb.coteafs.appium.config.enums;

/**
* @author wasiqb
* @since Sep 29, 2018
*/
public enum Protocol {
/**
* HTTP protocol.
*/
HTTP ("http"),
/**
* HTTPS protocol.
*/
HTTPS ("https");

private final String protocol;

private Protocol (final String protocol) {
this.protocol = protocol;
}

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

0 comments on commit 431cc0e

Please sign in to comment.