Code Monkey home page Code Monkey logo

casperjs's Introduction

Docker Image for CasperJS Everything you need to run CasperJS http://casperjs.org built on top of PhantomJS image https://github.com/zjgsuwk/phantomjs Docker Hub

Usage /home/ubuntu/tests is a folder on host machine with your casperjs tests, it's mounted into the container, you can change it to any folder you prefer.

exec mode

docker run --rm zjgsuwk/casperjs casperjs --version docker run --rm zjgsuwk/casperjs phantomjs --version start the docker container in daemon mode

docker run -d --name casperjs-daemon -v /home/ubuntu/tests:/home/casperjs-tests --restart always zjgsuwk/casperjs check version and run test

docker exec casperjs-daemon casperjs --version docker exec casperjs-daemon casperjs test mytest.js sample test

docker exec casperjs-daemon casperjs test /opt/casperjs/samples/googletesting.js run your own script

docker exec casperjs-daemon casperjs test /home/casperjs-tests/mytesting.js --log-level=debug; Using PhantomJS 'hello world' and version check (default script)

docker exec casperjs-daemon phantomjs /home/phantomjs/script.js run your own script

docker exec casperjs-daemon phantomjs /mnt/test/phantomjs/myscript.js Some key points Takes the latest version from official Casper repo master branch By default the image is running as a daemon, note the command in Dockerfile

CMD echo "casperjs running..." && tail -f /dev/null echo "casperjs running..." is used to identify the running daemon from the host ps -ax I prefer running it like this on the dedicated test server. Practicing TDD, I use it quite frequently and I don't want to mount the volumes on each test run. I pull my new tests from git directly into the once mounted folder and simply run exec inside the always running container. If you prefer exec mode, just don't forget the --rm option, as you may pollute your host machine with many useless stopped containers.

Roadmap [ ] Add example of docker-compose.yml [ ] Add ability to specify casper version

casperjs's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.