How to run PhantomJS and CasperJS tests?



I created two different tests: One is for know how much time does a webpage takes to load, it was coded with phantomjs and the other one is for knowing if the redirecting links are working how it should in the webpage, this was coded with casperjs, my question lays in how can I integrate this tests to CircleCI?




You’d run them in your CircleCI config file the same way you would do it manually on your own computer.


Do you have a v2 config.yml file? Just add new entries in your steps key. For example for PHPUnit I have:

  - run:
      name: Run PHPUnit tests
      command: |
        docker run ${CIRCLE_PROJECT_REPONAME} php vendor/bin/phpunit

I’m using docker:17.05.0-ce-git, so I install all the stuff I need manually (I like the control). That includes PhantomJS, which works very reliably.

So you just need to replace the command above with whatever you would need to kick off the tests in the CircleCI container.