We are running cucumber tests against our Single Page App using Selenium WebDriver and PhantomJS. We recently implemented an appcache manifest and now our cukes fail. In our troubleshooting it seems to be failing because phantomjs does not support cache manifests. In looking through the phantomjsdriver.log we that the negotiated capabilities contained:
"applicationCacheEnabled":false
We then tried to set the desired capabilities to enable it with:
var webdriver = require('selenium-webdriver');
var hooks = function() {
this.Before(function(callback) {
var pBrowser = webdriver.Capabilities.phantomjs();
pBrowser.set('applicationCacheEnabled', true);
this.driver = new webdriver.Builder().withCapabilities(pBrowser).build();
});
The desired vs negotiated capabilities in the log file show that it's trying to be set but isn't succeeding (and our cukes are still failing).
SessionManagerReqHand - _postNewSessionCommand - New Session Created: c6f61520-b603-11e3-83b0-2b905be08819
GhostDriver - Main - running on port 63911
CONSTRUCTOR - Desired Capabilities: {"browserName":"phantomjs","applicationCacheEnabled":true}
CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.1","driverName":"ghostdriver","driverVersion":"1.0.3","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
Does anyone know if our scenario isn't supported or if we're implementing it the wrong way?
According to line #47 of the source code at http://bit.ly/1mrRvaV, GhostDriver does not support the feature of desired vs. negotiated capabilities.