Show More
@@ -1,23 +1,28 b'' | |||
|
1 |
# IPython Notebook Java |
|
|
1 | # IPython Notebook JavaScript Tests | |
|
2 | 2 | |
|
3 |
|
|
|
4 | [CasperJS](http://casperjs.org/), which in turn requires | |
|
5 |
|
|
|
3 | This directory includes regression tests for the web notebook. These tests | |
|
4 | depend on [CasperJS](http://casperjs.org/), which in turn requires a recent | |
|
5 | version of [PhantomJS](http://phantomjs.org/). | |
|
6 | 6 | |
|
7 | Run the tests using: | |
|
7 | The JavaScript tests are organized into subdirectories that match those in | |
|
8 | `static` (`base', `notebook`, `services`, `tree`, etc.). | |
|
9 | ||
|
10 | To run all of the JavaScript tests do: | |
|
8 | 11 | |
|
9 | 12 | ``` |
|
10 | 13 | iptest js |
|
11 | 14 | ``` |
|
12 | 15 | |
|
13 | For finer granularity, or to specify more options, you can also run the | |
|
14 | following `casperjs` command | |
|
16 | To run the JavaScript tests in a single subdirectory (`notebook` in this | |
|
17 | case) do: | |
|
15 | 18 | |
|
16 |
``` |
|
|
17 | /path/to/bin/casperjs test --includes=util.js test_cases | |
|
19 | ``` | |
|
20 | iptest js/notebook | |
|
18 | 21 |
|
|
19 | 22 | |
|
20 |
The file `util.js` contains utility functions for tests, including a path to |
|
|
21 |
running notebook server on localhost (http://127.0.0.1) with the port |
|
|
22 |
specified as a command line argument to the test suite. Port 8888 is |
|
|
23 | `--port=` is not specified. | |
|
23 | The file `util.js` contains utility functions for tests, including a path to | |
|
24 | a running notebook server on localhost (http://127.0.0.1) with the port | |
|
25 | number specified as a command line argument to the test suite. Port 8888 is | |
|
26 | used if `--port=` is not specified. When you run these tests using `iptest` | |
|
27 | you do not, however, have to start a notebook server yourself; that is done | |
|
28 | automatically. |
@@ -178,15 +178,16 b' class JSController(TestController):' | |||
|
178 | 178 | TestController.__init__(self) |
|
179 | 179 | self.section = section |
|
180 | 180 | |
|
181 | ||
|
182 | def launch(self): | |
|
181 | 183 | self.ipydir = TemporaryDirectory() |
|
182 | 184 | self.nbdir = TemporaryDirectory() |
|
183 |
print("Running |
|
|
185 | print("Running %s tests in directory: %r" % (self.section, self.nbdir.name)) | |
|
184 | 186 | os.makedirs(os.path.join(self.nbdir.name, os.path.join(u'sub ∂ir1', u'sub ∂ir 1a'))) |
|
185 | 187 | os.makedirs(os.path.join(self.nbdir.name, os.path.join(u'sub ∂ir2', u'sub ∂ir 1b'))) |
|
186 | 188 | self.dirs.append(self.ipydir) |
|
187 | 189 | self.dirs.append(self.nbdir) |
|
188 | ||
|
189 | def launch(self): | |
|
190 | ||
|
190 | 191 | # start the ipython notebook, so we get the port number |
|
191 | 192 | self._init_server() |
|
192 | 193 | js_test_dir = get_js_test_dir() |
General Comments 0
You need to be logged in to leave comments.
Login now