Skip to content

Commit f99630f

Browse files
authored
Merge pull request #322 from vmi/develop
Merge development features 2020-08-15
2 parents 21538a8 + 9964481 commit f99630f

4 files changed

Lines changed: 19 additions & 26 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ cache:
66
- $HOME/.m2
77
install:
88
- gd_url=https://github.com/mozilla/geckodriver/releases/download
9-
- gd_ver=v0.21.0
9+
- gd_ver=v0.27.0
1010
- ( mkdir -pv bin; cd bin ; curl -L "${gd_url}/${gd_ver}/geckodriver-${gd_ver}-linux64.tar.gz" | gunzip | tar xf - ; chmod +x geckodriver )
1111
- mvn -B -V dependency:resolve
1212
before_script:

pom.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ It supports test-case and test-suite which are Selenium IDE's native format.</de
4646
<target.version>1.8</target.version>
4747
<skipTests>true</skipTests>
4848
<selenium.version>3.141.59</selenium.version>
49-
<htmlunit.version>2.40.0</htmlunit.version>
49+
<htmlunit.version>2.43.0</htmlunit.version>
5050
<htmlunit-core-js.version>${htmlunit.version}</htmlunit-core-js.version>
5151
<neko-htmlunit.version>${htmlunit.version}</neko-htmlunit.version>
52-
<htmlunit-driver.version>${htmlunit.version}</htmlunit-driver.version>
52+
<htmlunit-driver.version>2.43.1</htmlunit-driver.version>
5353
<slf4j.version>1.7.30</slf4j.version>
5454
<maven.version.rules>file://${basedir}/version-rules.xml</maven.version.rules>
5555
<shade.java.srcdir>src/shade/java</shade.java.srcdir>
@@ -393,12 +393,12 @@ It supports test-case and test-suite which are Selenium IDE's native format.</de
393393
<dependency>
394394
<groupId>commons-net</groupId>
395395
<artifactId>commons-net</artifactId>
396-
<version>3.6</version>
396+
<version>3.7</version>
397397
</dependency>
398398
<dependency>
399399
<groupId>org.apache.ant</groupId>
400400
<artifactId>ant-commons-net</artifactId>
401-
<version>1.10.7</version>
401+
<version>1.10.8</version>
402402
</dependency>
403403
</dependencies>
404404
</plugin>
@@ -537,7 +537,7 @@ It supports test-case and test-suite which are Selenium IDE's native format.</de
537537
<dependency>
538538
<groupId>io.netty</groupId>
539539
<artifactId>netty-all</artifactId>
540-
<version>4.1.49.Final</version>
540+
<version>4.1.51.Final</version>
541541
</dependency>
542542
</dependencies>
543543
</dependencyManagement>
@@ -569,17 +569,17 @@ It supports test-case and test-suite which are Selenium IDE's native format.</de
569569
<dependency>
570570
<groupId>org.apache.commons</groupId>
571571
<artifactId>commons-lang3</artifactId>
572-
<version>3.10</version>
572+
<version>3.11</version>
573573
</dependency>
574574
<dependency>
575575
<groupId>org.apache.commons</groupId>
576576
<artifactId>commons-text</artifactId>
577-
<version>1.8</version>
577+
<version>1.9</version>
578578
</dependency>
579579
<dependency>
580580
<groupId>commons-io</groupId>
581581
<artifactId>commons-io</artifactId>
582-
<version>2.6</version>
582+
<version>2.7</version>
583583
</dependency>
584584
<dependency>
585585
<groupId>args4j</groupId>
@@ -669,7 +669,7 @@ It supports test-case and test-suite which are Selenium IDE's native format.</de
669669
<dependency>
670670
<groupId>com.assertthat</groupId>
671671
<artifactId>selenium-shutterbug</artifactId>
672-
<version>0.9.3</version>
672+
<version>1.0</version>
673673
<exclusions>
674674
<exclusion>
675675
<groupId>org.seleniumhq.selenium</groupId>

src/main/java/jp/vmi/selenium/selenese/Runner.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
import org.slf4j.Logger;
3232
import org.slf4j.LoggerFactory;
3333

34+
import com.assertthat.selenium_shutterbug.core.Capture;
3435
import com.assertthat.selenium_shutterbug.core.Shutterbug;
35-
import com.assertthat.selenium_shutterbug.utils.web.ScrollStrategy;
3636
import com.google.common.base.Strings;
3737

3838
import jp.vmi.html.result.HtmlResult;
@@ -72,7 +72,7 @@ public class Runner implements Context, ScreenshotHandler, HighlightHandler, JUn
7272

7373
private static final DateTimeFormatter FILE_DATE_TIME = DateTimeFormatter.ofPattern("yyyyMMdd_HHmmssSSS");
7474

75-
private static PrintStream DEFAULT_PRINT_STREAM = new PrintStream(new NullOutputStream());
75+
private static PrintStream DEFAULT_PRINT_STREAM = new PrintStream(NullOutputStream.NULL_OUTPUT_STREAM);
7676

7777
private PrintStream ps;
7878
private WebDriver driver = null;
@@ -226,13 +226,6 @@ protected String takeScreenshot(File file, boolean entirePage) throws Unsupporte
226226
if (tss == null)
227227
throw new UnsupportedOperationException("webdriver does not support capturing screenshot.");
228228
file = file.getAbsoluteFile();
229-
try {
230-
// cf. http://prospire-developers.blogspot.jp/2013/12/selenium-webdriver-tips.html (Japanese)
231-
driver.switchTo().defaultContent();
232-
} catch (Exception e) {
233-
// some times switching to default context throws exceptions like:
234-
// Method threw 'org.openqa.selenium.UnhandledAlertException' exception.
235-
}
236229
File tmp;
237230
try {
238231
File dir = file.getParentFile();
@@ -248,7 +241,7 @@ protected String takeScreenshot(File file, boolean entirePage) throws Unsupporte
248241

249242
Map<?, ?> initialCoord = (Map<?, ?>) je.executeScript(getScrollCoord);
250243

251-
Shutterbug.shootPage((WebDriver) tss, ScrollStrategy.WHOLE_PAGE, screenshotScrollTimeout)
244+
Shutterbug.shootPage((WebDriver) tss, Capture.FULL_SCROLL, screenshotScrollTimeout)
252245
.withName(FilenameUtils.removeExtension(tmp.getName()))
253246
.save(dir.getPath());
254247

src/test/java/jp/vmi/selenium/webdriver/FirefoxDriverFactoryTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import org.junit.Test;
77
import org.junit.rules.ExternalResource;
88
import org.junit.rules.TemporaryFolder;
9-
import org.openqa.selenium.SessionNotCreatedException;
9+
import org.openqa.selenium.InvalidArgumentException;
1010

1111
import static org.openqa.selenium.firefox.FirefoxDriver.SystemProperty.*;
1212

@@ -52,14 +52,14 @@ protected void after() {
5252
* Test of not finding Firefox binary.
5353
*
5454
* @throws IOException exception.
55-
* @throws IllegalArgumentException exception.
55+
* @throws InvalidArgumentException exception.
5656
*/
57-
@Test(expected = IllegalStateException.class)
58-
public void firefoxNotFoundIn_webdriver_firefox_bin() throws IOException, IllegalArgumentException {
57+
@Test(expected = InvalidArgumentException.class)
58+
public void firefoxNotFoundIn_webdriver_firefox_bin() throws IOException, InvalidArgumentException {
5959
try {
6060
new FirefoxDriverFactory().newInstance(new DriverOptions());
61-
} catch (SessionNotCreatedException e) {
62-
throw new IllegalStateException(e);
61+
} catch (IllegalStateException e) {
62+
throw new InvalidArgumentException(e.getMessage(), e);
6363
}
6464
}
6565
}

0 commit comments

Comments
 (0)