# How to run PhantomJS and CasperJS tests?

**URL:** <https://discuss.circleci.com/t/how-to-run-phantomjs-and-casperjs-tests/17983>\
**Category:** Running Tests\
**Tags:** phantomjs\
**Created:** [November 9, 2017, 5:30pm UTC](https://discuss.circleci.com/t/how-to-run-phantomjs-and-casperjs-tests/17983 "2017-11-09T17:30:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pilarfc](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@pilarfc](https://discuss.circleci.com/u/pilarfc)\
**Post date:** [November 9, 2017, 5:30pm UTC](https://discuss.circleci.com/t/how-to-run-phantomjs-and-casperjs-tests/17983/1 "2017-11-09T17:30:45Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![pilarfc](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@pilarfc](https://discuss.circleci.com/u/pilarfc)\
**Post date:** [November 9, 2017, 5:31pm UTC](https://discuss.circleci.com/t/how-to-run-phantomjs-and-casperjs-tests/17983/2 "2017-11-09T17:31:31Z")

</div>

@FelicianoTech

---

<div class="post-metadata">

**Author:** ![FelicianoTech](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/felicianotech/32/21348_2.png) [@FelicianoTech](https://discuss.circleci.com/u/FelicianoTech)\
**Post date:** [November 19, 2017, 4:20pm UTC](https://discuss.circleci.com/t/how-to-run-phantomjs-and-casperjs-tests/17983/3 "2017-11-19T16:20:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [November 20, 2017, 2:09pm UTC](https://discuss.circleci.com/t/how-to-run-phantomjs-and-casperjs-tests/17983/4 "2017-11-20T14:09:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:32am UTC](https://discuss.circleci.com/t/how-to-run-phantomjs-and-casperjs-tests/17983/5 "2018-06-18T11:32:48Z")

</div>


