Skip to content

Commit

Permalink
Update to PhantomJS 2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
MatousJobanek committed Jan 25, 2016
1 parent 135ae30 commit 8af8ecc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.markdown
Expand Up @@ -29,7 +29,7 @@ the resolver will copy own file to the given path:
capabilities.setCapability("phantomjs.binary.path", "./target/phantomjs");

// enforce resolver to use given phantomjs version
capabilities.setCapability("phantomjs.binary.version", "1.9.1");
capabilities.setCapability("phantomjs.binary.version", "2.1.1");

// if there is phantomjs available on PATH, use that one
capabilities.setCapability("phantomjs.prefer.resolved", Boolean.FALSE);
Expand Down
Expand Up @@ -52,7 +52,7 @@ public String getDefault() {
* Defines the version of PhantomJS executable binary to resolve
*/
public static final String PHANTOMJS_BINARY_VERSION = "phantomjs.binary.version";
static final String DEFAULT_PHANTOMJS_BINARY_VERSION = "1.9.8";
static final String DEFAULT_PHANTOMJS_BINARY_VERSION = "2.1.1";

private static final Logger LOG = Logger.getLogger(ResolvingPhantomJSDriverService.class.getName());

Expand Down
Expand Up @@ -8,14 +8,14 @@
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.os.CommandLine;

import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;

public class TestMavenResolver {

private PhantomJSBinaryResolver resolver = new MavenPhantomJSBinaryResolver();

@Before
public void setUp() {
System.setProperty(ResolverConfiguration.PHANTOMJS_BINARY_VERSION, ResolverConfiguration.DEFAULT_PHANTOMJS_BINARY_VERSION);
Expand Down Expand Up @@ -66,14 +66,15 @@ public void testDefaultVersion() throws IOException {
@Test
public void testChangingVersion() throws IOException {
// given
System.setProperty(ResolverConfiguration.PHANTOMJS_BINARY_VERSION, "1.9.2");
System.setProperty(ResolverConfiguration.PHANTOMJS_BINARY_VERSION,
ResolverConfiguration.DEFAULT_PHANTOMJS_BINARY_VERSION);

// when
File location = resolver.resolve(new File("target/testVersion-phantomjs")).deleteOnExit().getLocation();
CommandLine cmd = new CommandLine(location.getAbsolutePath(), new String[] { "--version" });
cmd.execute();

// then
assertThat(cmd.getStdOut(), containsString("1.9.2"));
assertThat(cmd.getStdOut(), containsString(ResolverConfiguration.DEFAULT_PHANTOMJS_BINARY_VERSION));
}
}

0 comments on commit 8af8ecc

Please sign in to comment.