A lot of CommonJS specs/API is just "convenience" for the purpose of
web testing with PhantomJS. Combining PhantomJS with external
script/shell will solve the problem, albeit less elegant.
I suggest coming up with a strict small set of API that answers the
following question: "Which IO functions are very critical for web
testing?".
For example, I can imagine that file open, read, write, and close
would be absolutely critical. However, things like symbolic link,
permission, file copy, etc are not show stopper at all. Nothing stops
someone from using PhantomJS together with other scripting languages
for more post-processing.
PhantomJS #1 goal is always headless WebKit and not general purpose
JavaScript shell.
--
Ariya
Can you list what you'd like to have?
--
Ariya Hidayat
http://www.linkedin.com/in/ariyahidayat
I have been on hold this past days, waiting for more feedback on this
topic, but seems like only 3/4 of us care. So we should just move on
and do it.
Later
Ivan
Ivan De Marino
Front End Developer @ Betfair
Sent from my iPhone 4
Does the above cover the scripting of file uploads to a web app in the
dom, i.e., ajax?
For example, a web app that is using an ajax based multiple file
upload, phantomjs allows parsing the dom for the next element to
script files locally to be uploaded...
On Jul 10, 4:45 pm, Ivan De Marino <detroniza...@gmail.com> wrote:
> So, painting done, dinner as well, it's time to list what API, in my
> opinion, should be part of PhantomJS, out of the ones defined in
> CommonJS/Filesystem currently.
>
> I marked with "DONE" what is already on the upstream repo :)
>
> *Attributes *
> - size()
> - lastModified()
>
> *Files / Directories*
> - copy()
> - move()
> - rename()
>
> *Directory*
> - copyTree()
> - makeDirectory()* DONE*
> - makeTree()* DONE*
> - removeDirectory()* DONE*
> - removeTree()* DONE*
>
> *Files*
> - open()* DONE*
> *fs:*
> - atEnd()* DONE*
> - close()* DONE*
> - flush()* DONE*
> - read()* DONE*
> - readLine()* DONE*
> - write()* DONE*
> - writeLine()* DONE*
> - read() << this is for very lazy coders :)
> - write() << this is for very lazy coders :)
> - remove()* DONE*
>
> *Listing*
> list()* DONE*
>
> *Paths*
> - separator()* DONE*
> - changeWorkingDirectory()* DONE*
> - workingDirectory()* DONE*
>
> *Tests *
> - exists()* DONE*
> - isAbsolute()
> - isDirectory()
> - isExecutable()
> - isFile()
> - isLink()
> - isMount()
> - isReadable()
> - isWritable()
>
> I removed from James' list based on the following questions:
> *- can JavaScript do it already?*
> *- should this be done by Bash Script or "full programming languages"?*
> *
> *
> What do you guys think?
>
> Ivan
I also don't know if anyone actually uses various API. For example, I
know I want to use file open/read/write/close (and its variants), but
that's about my needs.
One very good practice back when I was with Trolltech/Nokia-Qt was
"can you have three examples/use cases?" everytime a public API is
introduced. If we use this approach, file read/write makes sense but
I'm not sure about other functions.
--
Ariya
--
Ariya
Sounds good. Which group did you mean by group 1? My suggestion would
be to start by what everyone needs most :)
> I'll use Jasmine for the tests, if you don't have a specific reason not to.
It should be fine till we have something in issue 146 implemented.
--
Ariya
> I'll add this to my todo:Sounds good. Which group did you mean by group 1? My suggestion would
> - roll out group 1
> - roll out tests for group 1
be to start by what everyone needs most :)
> I'll use Jasmine for the tests, if you don't have a specific reason not to.
It should be fine till we have something in issue 146 implemented.
--
Ariya