dalekjs / dalek-browser-phantomjs Goto Github PK
View Code? Open in Web Editor NEW[unmaintained] PhantomJS binding for DalekJS
License: MIT License
[unmaintained] PhantomJS binding for DalekJS
License: MIT License
I'm able to run Dalek fine using chrome, but phantomjs throws this error:
dalek-browser-phantomjs/index.js:273
this.spawned.kill('SIGTERM');
TypeError: Cannot read property 'kill' of null
Any ideas?
p.s. love dalek. Thanks for making it!
Version 0.0.4 does not install when using Node 4.x.
If I have a project that depends on dalek-browser-phantomjs and try to install using npm install
(assuming an empty node_modules
folder) the installation hangs after
Copying extracted folder...
is logged to the console.
The issue seems to be that the version of Medium/phantomjs being used (1.9.12) depends on a version of ncp that does not work on Node 4.x because of AvianFlu/ncp#79, i.e. if I change the version of ncp used by phantomjs from ~1.0.1
to ~2.0.0
and manually run phantomjs' install.js
the installation now works.
Potentially this driver could update to a newer version of phantomjs as versions from 1.9.14 up do not depend on ncp and should support Node 4.x.
I used to work with Phantom 1.9.1-9 and below test works fine.
module.exports = {
'Adding items to todo list': function (test) {
test
.open('http://todomvc.com/architecture-examples/backbone/index.html')
.type('#new-todo', 'Item 0\n')
.assert.numberOfElements('#todo-list .view label', 1, "List should contain 1 element")
.assert.text('#todo-list .view label', 'Item 0', "First element should be 'Item 0'")
.done();
}
};
c:\projects\todomvc-gh-pages\architecture-examples\backbone>dalek src\test\javas
cript\dalekjs\todo-dalek-test.js
Running tests
Running Browser: Phantomjs
OS: windows 7 32bit
Browser Version: 1.9.1
RUNNING TEST - "Adding items to todo list"
OPEN http://todomvc.com/architecture-examples/backbone/index.html
TYPE #new-todo
- NUMBEROFELEMENTS List should contain 1 element
- TEXT First element should be 'Item 0'
- 2 Assertions run
- TEST - "Adding items to todo list" SUCCEEDED
2/2 assertions passed. Elapsed Time: 2.78 sec
After moving this test to other place and installing dalek again I get latest version of Phantom. When I try to run the same test in new location I get following error:
c:\projects\todomvc-gh-pages\architecture-examples\backbone>dalek src\test\javas
cript\dalekjs\todo-dalek-test.js
Running tests
Running Browser: Phantomjs
TypeError: Cannot call method 'replace' of undefined
at Object.Driver.addCommand.onResponse (c:\projects\todomvc-gh-pages\archite
cture-examples\backbone\node_modules\dalekjs\node_modules\dalek-driver-native\no
de_modules\dalek-internal-webdriver\lib\commands\session.js:51:57)
at Object.Driver._onSuccess (c:\projects\todomvc-gh-pages\architecture-examp
les\backbone\node_modules\dalekjs\node_modules\dalek-driver-native\node_modules
dalek-internal-webdriver\lib\driver.js:285:27)
at Object.Driver._onResponseEnd (c:\projects\todomvc-gh-pages\architecture-e
xamples\backbone\node_modules\dalekjs\node_modules\dalek-driver-native\node_modu
les\dalek-internal-webdriver\lib\driver.js:247:90)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:910:16
at process._tickCallback (node.js:415:13)
Reverting Phantom to previous version solved the problem.
currently there is a bug of the phantomjs npm install script, which is fixed in 1.9.13, causing the install of dalekjs to fail.
something like ">=1.9.12 <1.10.0" should be a better fit, allowing bugfixes, but no unwanted break on new minor version
The default port of 9001 is a popular guy, I just struggled with running my tests as they silently simply did not run. If you start something else on port 9001 and then attempts running with webdriver on this port: node_modules/phantomjs/lib/phantom/bin/phantomjs --webdriver=9001
then you will see a nice error. But this is swallowed by the dalek browser and you end up with this unhelpful output:
I guess this could be tested by attempting to start on a common port like 80 or 22 just to capture the crash, I'll do a PR if you want such detection.
Is there any way I can make DalekJS to work with PhantomJS 2.0.0?
I already have PhantomJS 2.0.0 installed in my system, and the $ npm install dalekjs --save-dev
process always failed because of that. Error message says:
PhantomJS detected, but wrong version 2.0.0
Thanks in advance for any suggestions!
Running on PhantomJS OSX 10.9.1, the test hangs when it comes to the waitFor function.
module.exports = {
'Testing': function (test) {
test
.open("http://localhost:3333")
.wait(1000)
.assert.title('Doctor Who TV', 'Not your Daleks TV')
.waitFor(function(){
return true;
})
.done();
}
};
Hi,
I'm trying to set the port for firefox (as 9006 is always in use) and everytime i use the following in Dalekfile.json:
{
"logLevel": 4,
"browsers": {
"firefox": {
"port": 5555
}
}
}
And hit test here is what I get:
ERROR: TypeError: Cannot read property 'setBrowser' of null
Does anyone know why? I presume it can't find the firefox dalek browser, but when I install it everything seems fine.
It should be possible to specify the port to use for webdriver, in those cases when you're usage of port 9001 (See #1) is too ingrained in your workflow.
This probably needs to propagate from dalekjs/dalekjs.
Hi,
is there a way to get some kind of error reporting from PhantomJS? Somehow my tests are hanging in Phantom but run just fine in Chrome. How do you debug such cases?
Btw, error logging in DalekJS seems to be quite frugal, are there plans to improve this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.