From 752f09358bc0372b20685738a0387b3657037468 2014-02-11 00:11:12 From: Doug Blank Date: 2014-02-11 00:11:12 Subject: [PATCH] Merge remote-tracking branch 'upstream/master' --- diff --git a/IPython/html/tests/README.md b/IPython/html/tests/README.md index 2a91fff..b5c04c4 100644 --- a/IPython/html/tests/README.md +++ b/IPython/html/tests/README.md @@ -1,23 +1,28 @@ -# IPython Notebook Javascript Tests +# IPython Notebook JavaScript Tests -Regression tests for the web notebook. These tests depend on -[CasperJS](http://casperjs.org/), which in turn requires -a recent version of [PhantomJS](http://phantomjs.org/). +This directory includes regression tests for the web notebook. These tests +depend on [CasperJS](http://casperjs.org/), which in turn requires a recent +version of [PhantomJS](http://phantomjs.org/). -Run the tests using: +The JavaScript tests are organized into subdirectories that match those in +`static` (`base', `notebook`, `services`, `tree`, etc.). + +To run all of the JavaScript tests do: ``` iptest js ``` -For finer granularity, or to specify more options, you can also run the -following `casperjs` command +To run the JavaScript tests in a single subdirectory (`notebook` in this +case) do: -```sh -/path/to/bin/casperjs test --includes=util.js test_cases +``` +iptest js/notebook ``` -The file `util.js` contains utility functions for tests, including a path to a -running notebook server on localhost (http://127.0.0.1) with the port number -specified as a command line argument to the test suite. Port 8888 is used if -`--port=` is not specified. +The file `util.js` contains utility functions for tests, including a path to +a running notebook server on localhost (http://127.0.0.1) with the port +number specified as a command line argument to the test suite. Port 8888 is +used if `--port=` is not specified. When you run these tests using `iptest` +you do not, however, have to start a notebook server yourself; that is done +automatically. diff --git a/IPython/testing/iptestcontroller.py b/IPython/testing/iptestcontroller.py index 39fb933..8300e32 100644 --- a/IPython/testing/iptestcontroller.py +++ b/IPython/testing/iptestcontroller.py @@ -178,15 +178,16 @@ class JSController(TestController): TestController.__init__(self) self.section = section + + def launch(self): self.ipydir = TemporaryDirectory() self.nbdir = TemporaryDirectory() - print("Running notebook tests in directory: %r" % self.nbdir.name) + print("Running %s tests in directory: %r" % (self.section, self.nbdir.name)) os.makedirs(os.path.join(self.nbdir.name, os.path.join(u'sub ∂ir1', u'sub ∂ir 1a'))) os.makedirs(os.path.join(self.nbdir.name, os.path.join(u'sub ∂ir2', u'sub ∂ir 1b'))) self.dirs.append(self.ipydir) self.dirs.append(self.nbdir) - - def launch(self): + # start the ipython notebook, so we get the port number self._init_server() js_test_dir = get_js_test_dir()