Comments (20)
I thought that modifying min-wd/driver.js/connectBrowser()
with capabilities found here: https://code.google.com/p/selenium/wiki/JsonWireProtocol#Desired_Capabilities would help, but it doesn't. Just an FYI.
from mochify.js.
Another FYI, even with my modification to min-wd
capabilities, the output still shows:
Capabilities [{applicationCacheEnabled=false, rotatable=false, chrome={userDataDir=/var/folders/f0/3bf0bqj54fl6b3g0__nymw_m0000gn/T/.org.chromium.Chromium.FCHZKp}, takesHeapSnapshot=true, databaseEnabled=false, handlesAlerts=true, version=35.0.1916.153, platform=MAC, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Emphasis mine.
from mochify.js.
Sorry for blowing up your email here... :p However, it looks like the modification to min-wd
module makes Safari at least work for now.
from mochify.js.
Fancy sending a pull request for min-webdriver?
from mochify.js.
Sure, but it's still broken for Chrome.
from mochify.js.
If you could make a pull request with the solution for Safari and maybe link a Gist with an example that works there, but fails in Chrome, that would be helpful.
from mochify.js.
I was wrong. It sporadically passes in Safari regardless. I was just modifying driver.js:
function connectBrowser(context, callback) {
var caps = {
browserName : context.browser.name,
version : context.browser.version,
platform : context.browser.platform,
javascriptEnabled : true
};
to
function connectBrowser(context, callback) {
var caps = {
browserName : context.browser.name,
version : context.browser.version,
platform : context.browser.platform,
javascriptEnabled : true,
databaseEnabled : true
};
But it seems no matter what I do, I can't update the capabilities for Selenium. Mochify shows the capabilities through chrome and they're not updated with any change. It's very weird. Here's the relevant part on the POST /session
: https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session
I'm really not sure what the problem is. You can easily verify the behavior by installing PouchDB
with npm and trying to create a database and then running mochify.
from mochify.js.
The capabilities
cannot be forced. If the browser driver does not support the database capability, there is not much you can do.
You can try to put in requiredCapabilities
and see whether it fails with a more meaningfull message.
from mochify.js.
What's the purpose of selenium offering setting the capabilities if you can't "set" them? To just disable them? I tried requiredCapabilities
as well.
from mochify.js.
I think the idea is to have a set of settings that your app can work with, but not all of them might be supported by all devices. Think mobile, for example. It depends on the device / browser driver what it can actually support.
from mochify.js.
That makes sense, but you'd think that desktop Chrome would support databaseEnabled
especially since the output shows it. I guess maybe a ChromeDriver issue?
from mochify.js.
Looking at the error message, it could also be that Chrome does not allow DB access to injected scripts. Did you try FireFox yet?
from mochify.js.
No, I don't have it on this machine. But I'll install it and try it out. But it doesn't work in Safari either. Googling for selenium indexeddb
doesn't yield much, so I must be missing something.
from mochify.js.
Fails in Firefox too.
from mochify.js.
Ok, I created a project to reproduce the problem. I'd love to know if you have the same issues:
https://github.com/jprichardson/indexeddb-selenium
Readme contains instructions on reproducing error.
from mochify.js.
I'll have a look later today. Thanks!
from mochify.js.
Thanks again for putting together the repo for reproducing the issue.
The solution to your problem is to configure a "url" to load with an empty HTML page before running the tests (as described here: https://github.com/mantoni/min-webdriver#ie-trouble-shooting).
I don't really know why, but in some cases, browsers behave weird if they run scripts in the default Selenium start page. I will update the documentation accordingly.
Please let me know if there is anything else that is not working for you.
from mochify.js.
Ok, thanks. By that documentation it's not really clear... should doctype.html
just be dropped in the same dir as package.json
? Should the url literally be: http://my-server/doctype.html
? I tried changing my-server
to localhost
and couldn't get it to work.
Also, why not just have mochify
do this by default every single run-time?
from mochify.js.
I've updated the documentation with some additional explanation. You will need to wip up a static file server that ships the html page at some URL. It can totally be localhost
and some node service or an Apache or whatever works best for you.
This could be done by Mochify, yes, but it would only solve the issue when running Selenium locally.
For me, a central static file server with a URL that can be reached from the entire network (or even the internet) works better because I'm running tests on multiple remote machines and on SauceLabs for my open source projects. Also, not all the projects actually need this hack.
For SauceLabs, I heard of an option to tunnel traffic back to a dev machine. For custom Selenium Grid setups, one would have to make sure the machine running the tests is accessible from the clients and pass down the URL.
If you have a good idea on how to make the setup easier, ideas and pull requests are very welcome.
from mochify.js.
Thanks for your help on this and for Mochify. I love this module. I created a local server and piped the file. It's working great; you can see a super simple example of it where I needed it: https://github.com/jprichardson/browser-storage specifically in test/dev-server/
.
If I think of a clever way that this can be automated, I'll submit a PR. Thanks again!
from mochify.js.
Related Issues (20)
- Async test cases that fail end the entire test suite HOT 2
- Mochify does not work on Browserstack with Safari 12 or Firefox 64 HOT 10
- uncaught errors should be printed to stderr, not stdout HOT 6
- Support Puppeteer for Firefox HOT 6
- Support `--dumpio` option for tracing down errors with chromium
- Pass flags to Browserify HOT 3
- Update to a more recent version of mocha HOT 9
- Use Browserify 17 HOT 1
- Mochify Rewrite HOT 14
- `window._webdriver_manualPoll is not a function` on BrowserStack since 8.0.0 HOT 1
- Rewrite: Puppeteer settings HOT 1
- Rewrite: Integration tests for WebDriver
- Rewrite: Implement watch mode HOT 7
- Rewrite: Allow "external" mochify drivers
- Rewrite: Support native JavaScript modules HOT 2
- Rewrite: Release & publishing strategy HOT 11
- Rewrite: v1.0.0
- Rewrite: nested configuration does not get merged correctly
- Rewrite: Documentation HOT 1
- Rewrite: read spec/bundle from stdin HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mochify.js.