Skip to content

Commit f816d48

Browse files
jleehU-SRP_IMPNET\JHuxtable
authored andcommitted
Completed & tested a complete refactor of all the drivers and implementation with SauceLabs & BrowserStack
1 parent ee32e58 commit f816d48

File tree

18 files changed

+233
-274
lines changed

18 files changed

+233
-274
lines changed

pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@
134134
<groupId>com.paulhammant</groupId>
135135
<artifactId>ngwebdriver</artifactId>
136136
<version>0.9.1</version>
137-
<scope>test</scope>
138137
</dependency>
139138
</dependencies>
140139

src/main/java/com/frameworkium/config/DriverSetup.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
package com.frameworkium.config;
22

3-
import com.frameworkium.config.browsers.*;
3+
import com.frameworkium.config.drivers.*;
44
import com.frameworkium.config.remotes.BrowserStack;
55
import com.frameworkium.config.remotes.Sauce;
66
import org.apache.logging.log4j.LogManager;
77
import org.apache.logging.log4j.Logger;
88
import org.openqa.selenium.remote.DesiredCapabilities;
9-
import sun.security.krb5.internal.crypto.Des;
109

1110
import static com.frameworkium.config.SystemProperty.*;
1211

@@ -15,10 +14,10 @@ public class DriverSetup {
1514
private static final SupportedBrowsers DEFAULT_BROWSER = SupportedBrowsers.FIREFOX;
1615

1716
/**
18-
* List of supported browsers
17+
* List of supported drivers
1918
*/
2019
private enum SupportedBrowsers {
21-
FIREFOX,CHROME,OPERA,IE,PHANTOMJS,SAFARI
20+
FIREFOX,CHROME,OPERA,IE,PHANTOMJS,SAFARI,IOS
2221
}
2322

2423
/**
@@ -32,7 +31,7 @@ private enum SupportedRemotes {
3231
* List of supported platforms on remote grids
3332
*/
3433
public enum SupportedPlatforms {
35-
IOS,ANDROID,BROWSER
34+
WINDOWS,OSX,IOS,ANDROID,NONE
3635
}
3736

3837
protected final static Logger logger = LogManager.getLogger(DriverType.class);
@@ -108,7 +107,7 @@ private static SupportedPlatforms returnPlatformType() {
108107
return SupportedPlatforms.valueOf(SystemProperty.PLATFORM.getValue().toUpperCase());
109108
}
110109
else {
111-
return null;
110+
return SupportedPlatforms.NONE;
112111
}
113112
}
114113

src/main/java/com/frameworkium/config/DriverType.java

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
import com.frameworkium.listeners.EventListener;
66
import org.apache.logging.log4j.LogManager;
77
import org.apache.logging.log4j.Logger;
8-
import org.openqa.selenium.Platform;
98
import org.openqa.selenium.WebDriver;
109
import org.openqa.selenium.remote.DesiredCapabilities;
1110
import org.openqa.selenium.remote.SessionNotFoundException;
1211

1312
import static com.frameworkium.config.SystemProperty.*;
14-
import static com.frameworkium.config.SystemProperty.BROWSER_VERSION;
1513
import static com.frameworkium.config.DriverSetup.useRemoteDriver;
1614

1715
public abstract class DriverType {
@@ -54,21 +52,15 @@ public WebDriverWrapper getDriver() {
5452
* @return - Boolean, whether using mobile or not
5553
*/
5654
public static boolean isMobile() {
57-
return "ios".equalsIgnoreCase(PLATFORM.getValue()) || "android".equalsIgnoreCase(PLATFORM.getValue());
55+
return false;
5856
}
5957

6058
/**
6159
* Maximises the browser window based on paramaters
6260
*/
6361
public void maximiseBrowserWindow() {
6462
if (!MAXIMISE.isSpecified() || Boolean.parseBoolean(MAXIMISE.getValue())) {
65-
if (DriverType.isNative()) {
66-
webDriverWrapper.getWrappedAppiumDriver().manage().window().maximize();
67-
}
68-
if(useRemoteDriver()) {
69-
webDriverWrapper.getWrappedRemoteWebDriver().manage().window().maximize();
70-
}
71-
else {
63+
if((!useRemoteDriver() && !isNative()) || GRID_URL.isSpecified()) {
7264
webDriverWrapper.getWrappedDriver().manage().window().maximize();
7365
}
7466
}
@@ -116,22 +108,6 @@ public static boolean isNative() {
116108
return APP_PATH.isSpecified();
117109
}
118110

119-
/**
120-
* Used by the drivers which are remote, as common desired capabilities
121-
*
122-
* @param desiredCapabilities - The browser desired capabilities
123-
* @return - The browser desired capabilities
124-
*/
125-
protected static DesiredCapabilities setGeneralRemoteCapabilities(DesiredCapabilities desiredCapabilities) {
126-
if (PLATFORM.isSpecified()) {
127-
desiredCapabilities.setPlatform(Platform.valueOf(PLATFORM.getValue().toUpperCase()));
128-
}
129-
if (BROWSER_VERSION.isSpecified()) {
130-
desiredCapabilities.setVersion(BROWSER_VERSION.getValue());
131-
}
132-
return desiredCapabilities;
133-
}
134-
135111
/**
136112
* Implemented in each Driver Type to specify the capabilities of that browser
137113
*

src/main/java/com/frameworkium/config/SystemProperty.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ public enum SystemProperty {
2222
SUT_VERSION("sutVersion"),
2323
JIRA_RESULT_FIELDNAME("jiraResultFieldName"),
2424
JIRA_RESULT_TRANSITION("jiraResultTransition"),
25-
MAXIMISE("maximise");
25+
MAXIMISE("maximise"),
26+
RESOLUTION("resolution");
2627

2728

2829
private String value;

src/main/java/com/frameworkium/config/browsers/BrowserStackImpl.java

Lines changed: 0 additions & 99 deletions
This file was deleted.

src/main/java/com/frameworkium/config/browsers/SauceImpl.java

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)