Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use phantomjs.cli.args in webDriverCapabilities #200

Merged
merged 2 commits into from
Jan 9, 2014

Conversation

klieber
Copy link
Collaborator

@klieber klieber commented Jan 9, 2014

Looking at the source code of org.openqa.selenium.phantomjs.PhantomJSDriverService#findCLIArgumentsFromCaps, it seems that it expects the capability to be in the form of either String[] or a Collection. As the type passed by jasmine-maven-plugin is always String, this test will always fail and thus it is not currently possible to specify phantomjs.cli.args.

This could perhaps be seen as a bug in PhantomJSDriverService, which should allow a String to be used as a single argument.

@tomdw
Copy link

tomdw commented Nov 20, 2013

Same problem here. We are trying to solve a problem with phantomjs on our build server and having the ability to activate the debug logging of phantomjs seems desirable. Using the jasmine-maven-plugin this would require to pass phantomjs.cli.args but this does not work.

@ghost ghost assigned klieber Jan 9, 2014
@klieber
Copy link
Collaborator

klieber commented Jan 9, 2014

I've decided to make a non backwards compatible change to the format of the webDriverCapabilities parameter to support this functionality.

This is an example configuration using the new format with phantomjs.cli.args:

<plugin>
  <groupId>com.github.searls</groupId>
  <artifactId>jasmine-maven-plugin</artifactId>
  <version>${jasmine-maven-plugin.version}</version>
  <executions>
    <execution>
      <goals>
        <goal>test</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <webDriverClassName>org.openqa.selenium.phantomjs.PhantomJSDriver</webDriverClassName>
    <webDriverCapabilities>
      <capability>
        <name>phantomjs.cli.args</name>
        <list>
          <value>--disk-cache=true</value>
          <value>--max-disk-cache-size=256</value>
        </list>
      </capability>
    </webDriverCapabilities>
  </configuration>
</plugin>

This will be more fully documented in the plugin documentation when it is releases.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.73%) when pulling 45edff1 on klieber:issue/200_web_driver_capabilities into c45b873 on searls:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.73%) when pulling 72c52bd on klieber:issue/200_web_driver_capabilities into c45b873 on searls:master.

klieber added a commit that referenced this pull request Jan 9, 2014
Can't use phantomjs.cli.args in webDriverCapabilities; fixes #80; fixes #81
@klieber klieber merged commit 5425526 into searls:master Jan 9, 2014
@klieber klieber deleted the issue/200_web_driver_capabilities branch February 18, 2014 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants