1

Using phantomjs, how to run all scripts within a directory?

Ex: I have 3 tests in c:\tests folder.

\firsttest.js

\secondtest.js

\thirdtest.js

I have tried below, but didn't work

phantomjs tests/

phantomjs tests/*

Can someone let me know how to achieve this?

Thanks,

neomanni
  • 11
  • 1
  • http://stackoverflow.com/questions/37420286/make-phantomjs-run-all-js-files-in-the-current-directory/37420608 – meatspace May 24 '16 at 18:16

1 Answers1

0

PhantomJS itself is not a test framework , neither a testing library : it provides scripted headless testing of web applications.

There are no options in phantomjs that allow you to run a set of scripts ; but there are some popular projects which are built on top of PhantomJS to provide convenient high-level functionality for testing purposes. For example, CasperJS.

As said here,

It will recursively scan any passed directory to search for *.js or *.coffee files and add them to the stack.

A gist is also available here.

Cybermaxs
  • 24,378
  • 8
  • 83
  • 112