But I'm still working, in the spare time of the spare time, on PhantomJS. Yes, very slowly, but I'm not stall.
Recently two ideas have come to mind, and it's stuff I'd love to see supported by PhantomJS.
From the Wikipedia article:
A read–eval–print loop (REPL), also known as an interactive toplevel, is a simple, interactive computer programming environment.
In a REPL, the user may enter expressions, which are then evaluated, and the results displayed.
What I really like of the REPL, is the idea of launching it and start typing code into it straightaway. No files to create, save and launch. It's very good when you want to quickly toy with a concept/idea, and it's so small it doesn't really deserves a dedicated script file for that.
I haven't finished it yet, but I published my current status on this branch. Check it out!
Also, the REPL is truly enabling an even more simple concept: controlling PhantomJS by just piping commands to it through the STD_IN. A key aspect to enable easier integration of PhantomJS in larger stacks.
In facts, I discovered that sgentle has started working on wrapping PhantomJS into a Node module, and released phantomjs-node. What struck me is how he had to work out a communication channel between Node and the instances of PhantomJS: he opted for Socket.io.
Socket.io is definitely a smart solution, but phantom is launched as a child process: there must be a better way to let Node and PhantomJS speak, instead of having to pass through the network stack. Right?
And that's where my work on the REPL (and in general into controlling PhantomJS via STD_IN) comes into the picture.
- run test
I want to add a functionality to the
webpage module so that given a file
httpmap.json that looks like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
a tester that uses phantom could do something like:
1 2 3 4 5 6 7
var fs = require('fs'),
As you can probably guess, the format of the map offers some extra nifty features:
methodfield can be single (a
string) or multiple (an array of
destinationfield can be a single url (a
string), or multiple destinations (an array of
string) that phantom will cycle through at every matching request
sourcefield accepts regexp, and I'm thinking to add variables
This are my ideas so far. It would be of GREAT help if you, PhantomJS lover, could spend sometime to review those and suggest accordingly.