Skip to content

Commit e5757c1

Browse files
committed
version 0.16: raise selenium-java version to 3.4.0
1 parent 9d32b73 commit e5757c1

File tree

4 files changed

+83
-28
lines changed

4 files changed

+83
-28
lines changed

pom.xml

Lines changed: 73 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.github.mike10004</groupId>
77
<artifactId>selenium-help</artifactId>
8-
<version>0.15</version>
8+
<version>0.16</version>
99
<name>selenium-help</name>
1010
<description>Library that helps you use Selenium WebDriver in Java</description>
1111
<url>https://github.com/mike10004/selenium-help</url>
@@ -33,8 +33,10 @@
3333
<properties>
3434
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3535
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
36-
<xvfb-manager.version>0.5</xvfb-manager.version>
36+
<xvfb-manager.version>0.7</xvfb-manager.version>
3737
<test.log.level>info</test.log.level>
38+
<selenium.version>3.4.0</selenium.version>
39+
<jetty.version>9.4.3.v20170317</jetty.version>
3840
<selenium-help.test.proxy.http></selenium-help.test.proxy.http>
3941
</properties>
4042
<profiles>
@@ -151,13 +153,78 @@
151153
<dependency>
152154
<groupId>org.seleniumhq.selenium</groupId>
153155
<artifactId>selenium-remote-driver</artifactId>
154-
<version>3.0.1</version>
156+
<version>${selenium.version}</version>
155157
</dependency>
156158
<dependency>
157159
<groupId>net.sourceforge.htmlunit</groupId>
158160
<artifactId>htmlunit</artifactId>
159161
<version>2.23</version>
160162
</dependency>
163+
<dependency>
164+
<groupId>com.google.guava</groupId>
165+
<artifactId>guava</artifactId>
166+
<version>21.0</version>
167+
</dependency>
168+
<!-- selenium 3.4.0 depends on a newer version of jetty (9.4.3.v20170317) than WireMock does,
169+
but it doesn't depend on all of the various jetty-* artifacts that WireMock does, so we
170+
have to explicitly define the version of these artifacts that are only used by WireMock,
171+
otherwise we'll have incompatibilities like jetty-io of one version and jetty-servlet of
172+
another -->
173+
<dependency>
174+
<groupId>org.eclipse.jetty.websocket</groupId>
175+
<artifactId>websocket-client</artifactId>
176+
<version>${jetty.version}</version>
177+
</dependency>
178+
<dependency>
179+
<groupId>org.eclipse.jetty.websocket</groupId>
180+
<artifactId>websocket-api</artifactId>
181+
<version>${jetty.version}</version>
182+
</dependency>
183+
<dependency>
184+
<groupId>org.eclipse.jetty</groupId>
185+
<artifactId>jetty-util</artifactId>
186+
<version>${jetty.version}</version>
187+
</dependency>
188+
<dependency>
189+
<groupId>org.eclipse.jetty</groupId>
190+
<artifactId>jetty-io</artifactId>
191+
<version>${jetty.version}</version>
192+
</dependency>
193+
<dependency>
194+
<groupId>org.eclipse.jetty</groupId>
195+
<artifactId>jetty-server</artifactId>
196+
<version>${jetty.version}</version>
197+
</dependency>
198+
<dependency>
199+
<groupId>org.eclipse.jetty</groupId>
200+
<artifactId>jetty-servlet</artifactId>
201+
<version>${jetty.version}</version>
202+
</dependency>
203+
<dependency>
204+
<groupId>org.eclipse.jetty</groupId>
205+
<artifactId>jetty-servlets</artifactId>
206+
<version>${jetty.version}</version>
207+
</dependency>
208+
<dependency>
209+
<groupId>org.eclipse.jetty</groupId>
210+
<artifactId>jetty-continuation</artifactId>
211+
<version>${jetty.version}</version>
212+
</dependency>
213+
<dependency>
214+
<groupId>org.eclipse.jetty</groupId>
215+
<artifactId>jetty-webapp</artifactId>
216+
<version>${jetty.version}</version>
217+
</dependency>
218+
<dependency>
219+
<groupId>org.eclipse.jetty</groupId>
220+
<artifactId>jetty-xml</artifactId>
221+
<version>${jetty.version}</version>
222+
</dependency>
223+
<dependency>
224+
<groupId>org.eclipse.jetty</groupId>
225+
<artifactId>jetty-security</artifactId>
226+
<version>${jetty.version}</version>
227+
</dependency>
161228
</dependencies>
162229
</dependencyManagement>
163230
<dependencies>
@@ -174,7 +241,6 @@
174241
<dependency>
175242
<groupId>com.google.guava</groupId>
176243
<artifactId>guava</artifactId>
177-
<version>20.0</version>
178244
</dependency>
179245
<dependency>
180246
<groupId>org.apache.commons</groupId>
@@ -189,7 +255,7 @@
189255
<dependency>
190256
<groupId>org.seleniumhq.selenium</groupId>
191257
<artifactId>selenium-java</artifactId>
192-
<version>3.0.1</version>
258+
<version>${selenium.version}</version>
193259
<exclusions>
194260
<exclusion>
195261
<groupId>net.sourceforge.htmlunit</groupId>
@@ -259,7 +325,7 @@
259325
<dependency>
260326
<groupId>io.github.bonigarcia</groupId>
261327
<artifactId>webdrivermanager</artifactId>
262-
<version>1.5.0</version>
328+
<version>1.6.2</version>
263329
<scope>test</scope>
264330
</dependency>
265331
<dependency>
@@ -276,7 +342,7 @@
276342
<dependency>
277343
<groupId>com.github.mike10004</groupId>
278344
<artifactId>chrome-cookie-implant-client</artifactId>
279-
<version>1.5</version>
345+
<version>1.5.3</version>
280346
</dependency>
281347
<dependency>
282348
<groupId>com.machinepublishers</groupId>

src/main/java/com/github/mike10004/seleniumhelp/ArbitraryActions.java

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,35 @@
11
package com.github.mike10004.seleniumhelp;
22

3-
import org.openqa.selenium.Keys;
43
import org.openqa.selenium.WebDriver;
54
import org.openqa.selenium.WebElement;
65
import org.openqa.selenium.interactions.Action;
76
import org.openqa.selenium.interactions.Actions;
8-
import org.openqa.selenium.interactions.Keyboard;
9-
import org.openqa.selenium.interactions.Mouse;
107

118
import static com.google.common.base.Preconditions.checkNotNull;
129

1310
public class ArbitraryActions extends Actions {
11+
1412
public ArbitraryActions(WebDriver driver) {
1513
super(checkNotNull(driver, "driver"));
1614
}
1715

18-
public ArbitraryActions(Keyboard keyboard, Mouse mouse) {
19-
super(checkNotNull(keyboard, "keyboard"), checkNotNull(mouse, "mouse"));
20-
}
21-
22-
public ArbitraryActions(Keyboard keyboard) {
23-
super(checkNotNull(keyboard, "keyboard"));
24-
}
25-
2616
@Override
27-
public ArbitraryActions keyDown(Keys theKey) {
17+
public ArbitraryActions keyDown(CharSequence theKey) {
2818
return (ArbitraryActions) super.keyDown(theKey);
2919
}
3020

3121
@Override
32-
public ArbitraryActions keyDown(WebElement element, Keys theKey) {
22+
public ArbitraryActions keyDown(WebElement element, CharSequence theKey) {
3323
return (ArbitraryActions) super.keyDown(element, theKey);
3424
}
3525

3626
@Override
37-
public ArbitraryActions keyUp(Keys theKey) {
27+
public ArbitraryActions keyUp(CharSequence theKey) {
3828
return (ArbitraryActions) super.keyUp(theKey);
3929
}
4030

4131
@Override
42-
public ArbitraryActions keyUp(WebElement element, Keys theKey) {
32+
public ArbitraryActions keyUp(WebElement element, CharSequence theKey) {
4333
return (ArbitraryActions) super.keyUp(element, theKey);
4434
}
4535

src/test/java/com/github/mike10004/seleniumhelp/BrAwareServerResponseCaptureFilterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static void initChromeDriver() {
4545
@Rule
4646
public final XvfbRule xvfb = XvfbRule.builder().disabledOnWindows().build();
4747

48-
@Test
48+
@Test(timeout = 10000L)
4949
public void endToEnd_chrome() throws Exception {
5050
byte[] brotliBytes = loadBrotliCompressedSample();
5151
byte[] decompressedBytes = loadUncompressedSample();

src/test/java/com/github/mike10004/seleniumhelp/ChromeDriverExperiments.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.github.mike10004.seleniumhelp;
22

3-
import com.google.common.base.Function;
43
import com.google.common.io.ByteSource;
54
import com.google.common.io.Resources;
65
import com.google.gson.Gson;
@@ -69,12 +68,12 @@ public String doStuff(WebDriver driver) {
6968
String preCookieGet = null, postCookieGet;
7069
URI url = URI.create("https://httprequestecho.appspot.com/");
7170
driver.get("chrome-extension://fngmhnnpilhplaeedifhccceomclgfbg/popup.html?url=" + url + "&incognito=false");
72-
WebElement pasteButton = new WebDriverWait(driver, 3).until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("a#pasteButton")));
71+
WebElement pasteButton = new WebDriverWait(driver, 3).until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("a#pasteButton"))::apply);
7372
pasteButton.click();
74-
WebElement textArea = new WebDriverWait(driver, 3).until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("div#pasteCookie textarea")));
73+
WebElement textArea = new WebDriverWait(driver, 3).until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("div#pasteCookie textarea"))::apply);
7574
String COOKIE_JSON = produceCookieArrayJson(url, "httprequestecho.appspot.com", "/", "SLIM_COOKIE_NAME", "SLIM_COOKIE_VALUE");
7675
textArea.sendKeys(COOKIE_JSON);
77-
WebElement importButton = new WebDriverWait(driver, 3).until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("#submitDiv #submitButton")));
76+
WebElement importButton = new WebDriverWait(driver, 3).until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("#submitDiv #submitButton"))::apply);
7877
importButton.click();
7978
driver.get("https://httprequestecho.appspot.com/get");
8079
postCookieGet = driver.getPageSource();
@@ -205,7 +204,7 @@ public Boolean doStuff(WebDriver driver) throws IOException {
205204
System.out.println(uri);
206205
driver.get(uri.toString());
207206
WebElement outputElement = new WebDriverWait(driver, 3)
208-
.until(new Function<WebDriver, WebElement>(){
207+
.until(new java.util.function.Function<WebDriver, WebElement>(){
209208
@Nullable
210209
@Override
211210
public WebElement apply(WebDriver input) {

0 commit comments

Comments
 (0)