Commit Graph

2239 Commits

Author SHA1 Message Date
Pablo de Oliveira
bbfcbf40eb Add casperjs test for isolated SVGs 2013-10-29 22:19:43 +01:00
Pablo de Oliveira
c72d4fead0 Notebook isolated content: fix firefox extra-space issue
In Firefox, if the iframe initial height is set to 0, the reported
scrollHeight is too large. Workaround: set the initial height to 1.
2013-10-29 22:19:43 +01:00
Pablo de Oliveira
a8e39d6acc Support isolated metadata tag for any content
Any content whose metadata contains an `isolated` tag will be isolated
from the rest of the document.

The current implementation wraps isolated content into an iframe.
2013-10-29 22:19:43 +01:00
Pablo de Oliveira
86dce97804 SVG: scoped is passed as metadata
Instead of using a svg class to pass scope information
use notebook metadata.

Suggested by Matthias Bussonnier
2013-10-29 22:19:43 +01:00
Pablo de Oliveira
4c49abd2ae Fix style and typo 2013-10-29 22:19:43 +01:00
Pablo de Oliveira
3e0a69ba68 SVG scoping must be explicitly enabled by the user
SVG scoping is disabled by default, to enable it the user
must call the core.display.SVG constructor with the scoped=True
keyword parameter.
2013-10-29 22:19:43 +01:00
Pablo de Oliveira
f152996f11 outputarea.js: Wrap inline SVGs inside an iframe
When multiple inline SVGs are included in a single document,
they share the same parse tree. Therefore, style collisions and
use id collisions can occur and upset the rendering.

This patch wraps each SVG inside an individual iframe, ensuring
that SVG's declarations do not collide.

(The SVG representation is kept as XML and not converted to a binary
format, so I do not think this approach precludes the use of d3.js)

Tested on:
* Chrome Version 29.0.1547.57 Debian 7.1 (217859)
* Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130806 Firefox/17.0 Iceweasel/17.0.8

Closes #1866
2013-10-29 22:19:43 +01:00
Thomas Kluyver
acd00de9dd Simplify StreamCapturer for subprocess testing
Rather than using a transient pipe for each subprocess started, the
StreamCapturer now makes a single pipe, and subprocesses redirect their
output to it.

So long as this works on Windows (I've done brief testing, and os.pipe()
seems to be functional), this will hopefully make this much more robust.
The recent failures in ShiningPanda on IPython.parallel have been caused
by StreamCapturer.
2013-10-29 12:24:24 -07:00
Thomas Kluyver
93ee2d7173 Make sessions REST API test more robust.
Was seeing failures on Windows because it failed to delete the folder.
2013-10-29 09:15:57 -07:00
Thomas Kluyver
0e9a7c0874 Remove unused imports in IPython.html.notebook.handlers 2013-10-29 09:15:57 -07:00
Thomas Kluyver
9fd838d624 Fix imports in IPython.html.utils 2013-10-29 09:15:56 -07:00
Thomas Kluyver
79c0712752 Catch failures reading data from terminated subprocesses 2013-10-29 09:15:56 -07:00
Thomas Kluyver
d729dfbbe2 Fix passing extra arguments to Python test controllers 2013-10-29 09:15:56 -07:00
Thomas Kluyver
81660c08ce Allow running Python tests on one section of the codebase 2013-10-29 09:15:56 -07:00
Thomas Kluyver
bce32ec03b Fixes for notebook session manager 2013-10-29 09:15:56 -07:00
Thomas Kluyver
f65b3a1495 Use StringIO.StringIO on Python 2.
io.StringIO is strict about unicode, StringIO.StringIO isn't.
2013-10-29 09:15:55 -07:00
Thomas Kluyver
51040fb768 Update imports for Python 3
2to3 fixer imports (+ manual changes)
2013-10-29 09:15:54 -07:00
Thomas Kluyver
4a14ed7e22 Replace references to unicode and basestring 2013-10-29 09:15:54 -07:00
Thomas Kluyver
d4532983f4 Convert print statements to print function calls
libmodernize.fixes.fix_print
2013-10-29 09:14:15 -07:00
Paul Ivanov
4ffe489e72 Merge pull request #4415 from ivanov/more-tooltips
More tooltips in the Notebook menu
2013-10-28 13:51:39 -07:00
Paul Ivanov
e608c6d07a fix: allow JS test to run after shutdown test
shutdown notebook test closes casper browser, here we re-instatiate it
after the test
2013-10-28 13:46:55 -07:00
Min RK
d797f8950f Merge pull request #4450 from ivanov/remove-old-tornado-monkeypatch
remove monkey patch for older versions of tornado
2013-10-28 11:39:47 -07:00
Paul Ivanov
f04eca3ddd remove monkey patch for older versions of tornado
Since we now depend on Tornado >= 3.1, this code path is no longer
necessary
2013-10-28 11:07:24 -07:00
Paul Ivanov
1123af8528 make close-and-halt work on new tabs in Chrome
this is not possible in Firefox, as new tabs/windows which were *not*
opened via a script ( window.open call ) are not allowed to be closed
via window.close and will yield a message like

--
[11:50:59.691] Scripts may not close windows that were not opened by script. @ http://localhost:8888/static/notebook/js/menubar.js:105
2013-10-28 11:00:42 -07:00
Min RK
4e8bc066e9 Merge pull request #4435 from minrk/tornado-tweaks
raise 404 on not found static file
2013-10-27 13:12:08 -07:00
Matthias BUSSONNIER
f7eff4cdb4 recompile css 2013-10-27 16:35:06 +01:00
Matthias BUSSONNIER
88cb5073d5 split notebook style in 2 files,
app specific/not app specific
2013-10-27 16:34:28 +01:00
Matthias BUSSONNIER
d2a41e902f remove more hard coded layout 2013-10-27 16:11:44 +01:00
Min RK
57fa14a2fa Merge pull request #4442 from Carreau/fix-oir
finish object_info_request/object_info rename in tooltip
2013-10-26 11:04:22 -07:00
Matthias BUSSONNIER
a74c36b62a remove compatibility layer 2013-10-26 19:59:49 +02:00
Min RK
8b58e38990 Merge pull request #4436 from minrk/require-ext
allow `require("nbextensions/extname")` to load from IPYTHONDIR/nbextensions
2013-10-26 10:41:00 -07:00
Matthias BUSSONNIER
bdb1c94137 fix and add shim for change introduce by #4195
comm merging renamed object_info_request to object_info
2013-10-26 14:04:55 +02:00
Min RK
4f3f1f1ebb Merge pull request #4437 from minrk/etag
don't compute etags in static file handlers
2013-10-25 16:54:15 -07:00
Min RK
c3e6e625a7 Merge pull request #4427 from minrk/checkpoint-on-first-save
notebooks should always have one checkpoint

closes #4396
2013-10-25 13:36:59 -07:00
Matthias Bussonnier
5bd89b7376 Merge pull request #4425 from Carreau/fix-js-python
Fix impossibility to upload notebooks.
2013-10-25 11:41:42 -07:00
Matthias BUSSONNIER
79f1edc5e9 fix notebook upload
pythonnism + PUT instead of POST
2013-10-25 20:23:54 +02:00
MinRK
f8ddcffacb allow require("nbextensions/extname") to load from IPYTHONDIR/nbextensions 2013-10-24 15:32:28 -07:00
MinRK
7ea4db6c48 don't compute etags in static file handlers
etags skip cache timing, which we probably don't want.  If-Modified-Since is good enough for us.
2013-10-24 14:25:15 -07:00
Min RK
0aaafce4af Merge pull request #4195 from minrk/widget-msg
IPEP 21:  widget messages
2013-10-24 12:19:41 -07:00
MinRK
ff744e25cd raise 404 on not found static file
master gives 403 due to empty string being outside of root
2013-10-24 11:14:50 -07:00
Thomas Kluyver
daf15735bd Merge pull request #4428 from minrk/tornado-3.1
bump minimum tornado version to 3.1.0
2013-10-23 14:36:25 -07:00
MinRK
6fa13ebb98 bump minimum tornado version to 3.1.0
The no-hidden behavior of the files handler
already requires this, but instead of raising, it just doesn't hide hidden files.

Bumping the minimum version also allows much cleaner static file handler subclasses.
2013-10-23 14:04:35 -07:00
Thomas Kluyver
45faf9a949 Merge commit '37dadeb' (most of PR #4391)
Conflicts:
	IPython/testing/iptestcontroller.py
2013-10-23 14:00:14 -07:00
Paul Ivanov
80ac24683f give travis 10 seconds to start server 2013-10-23 12:28:30 -07:00
Paul Ivanov
357b78171a fix: JS kernel state should reflect killed state 2013-10-23 12:22:08 -07:00
MinRK
79a7b1e421 fix tornado log propagation
in the notebook
2013-10-23 12:01:45 -07:00
Paul Ivanov
26b5a76841 don't use test.begin
the PPA we use on Travis CI doesn't have CasperJS 1.1.0-DEV yet, so
we're better off not using it for now.
2013-10-23 11:49:43 -07:00
Paul Ivanov
4993ddd498 make js tests quieter, silence notebook server 2013-10-23 11:48:33 -07:00
Paul Ivanov
217b43cf87 use test.begin to give test group a name 2013-10-23 11:05:59 -07:00
Paul Ivanov
641f157fd9 add test for shutdown notebook 2013-10-23 11:05:59 -07:00
Paul Ivanov
e971d051ed created a kernel_running method 2013-10-23 11:05:59 -07:00
Paul Ivanov
755565019d adds test of clicking the play button 2013-10-23 11:05:59 -07:00
Paul Ivanov
baf90fd755 add checks for new cell added using shift-enter 2013-10-23 11:05:59 -07:00
Paul Ivanov
89f2ed95f9 refactor of get_output_cell 2013-10-23 11:05:59 -07:00
Paul Ivanov
047f3d76cc minor shortening 2013-10-23 11:05:59 -07:00
Paul Ivanov
1703b289c9 test keyboard interrupt shortcuts 2013-10-23 11:05:59 -07:00
Paul Ivanov
19a20a3c70 add Ctrl-M keyboard shortcut 2013-10-23 11:05:59 -07:00
Paul Ivanov
605573e110 use wait_for_output util function 2013-10-23 11:05:58 -07:00
Paul Ivanov
df2118297b wait_for_output utility function 2013-10-23 11:05:58 -07:00
Paul Ivanov
65810a49e4 utility functions + tests for shift- & ctrl-enter 2013-10-23 11:05:58 -07:00
Paul Ivanov
34c9ad36a2 repeat test with keyboard shortcut 2013-10-23 11:05:58 -07:00
Paul Ivanov
23a7eb325d make sure kernel started running 2013-10-23 11:05:58 -07:00
Paul Ivanov
fe60519410 test kernel interrupt 2013-10-23 11:05:58 -07:00
Paul Ivanov
e8fba5dd6d try to shutdown at the end of every notebook run
this line causes noise in the test suite, but if we just ignore it,
we'll never get to the bottom of it. It seems to only happen when
running 'iptest js', and *not* when running the 'casperjs test' command
directly, with a notebookserver that was launched manually.
2013-10-23 11:05:58 -07:00
Paul Ivanov
7546e57db4 make tests work on TravisCI 2013-10-23 11:05:58 -07:00
Paul Ivanov
7e7ac7ec9e don't shutdown kernel after every test 2013-10-23 11:05:58 -07:00
Paul Ivanov
ebf1320e64 use dashboard to simulate clicking new notebook 2013-10-23 11:05:58 -07:00
Paul Ivanov
c956f28894 make confusing code snippet more readable 2013-10-23 11:05:58 -07:00
Paul Ivanov
a093b4b8ff use new press_up and press_down utils functions 2013-10-23 11:05:58 -07:00
Paul Ivanov
c68eaca621 added a shorthand way to trigger keyboard events
as suggested by @ellisonbg in #4285
2013-10-23 11:05:58 -07:00
Thomas Kluyver
fc639f3d25 Separate out machinery for running JS tests 2013-10-23 11:05:58 -07:00
Thomas Kluyver
f8a36e785d Use Python 3 compatible syntax in tests 2013-10-23 11:04:56 -07:00
Paul Ivanov
6b2692aa4a eliminate hardcoded wait, now wait on outputs
Note: this test still sometimes fails, though I don't understand why.
Increasing the wait time to 30 seconds does not help, which leads me to
believe that there's some race condition, or that we're genuinely
dropping outputs sometimes (saved notebooks on these timeouts *do*
contain an In[] number, but don't have any outputs attached). @ellisonbg
and @minrk might now what's going on with that.

To run just this test, fire up a notebook server on port 8888 and run:

while true; do casperjs test --includes=util.js test_cases/execute_code_cell.js ; done
2013-10-23 11:04:56 -07:00
Paul Ivanov
f2e0315152 pep8 style function names 2013-10-23 11:04:56 -07:00
Paul Ivanov
0ea7d1e394 more informative message on server timeout 2013-10-23 11:03:12 -07:00
Paul Ivanov
3725218069 updated js tests README, --port= now optional 2013-10-23 11:03:12 -07:00
Paul Ivanov
5fbfc30a08 quieter notebook server output for js test suite 2013-10-23 11:03:12 -07:00
Paul Ivanov
3fdbeb5cae use a temporary directory for js tests 2013-10-23 11:03:12 -07:00
Paul Ivanov
c6c5066162 don't try to delete notebooks
this method wasn't currently working, and though we should put a working
method there as a utility, it isn't strictly necessary, since the whole
directory will be deleted
2013-10-23 11:03:12 -07:00
Paul Ivanov
49770da5ea --no-browser flag to js tests notebook server 2013-10-23 11:03:12 -07:00
Paul Ivanov
5f4c695aab start and use notebook server for js test suite 2013-10-23 11:03:12 -07:00
Paul Ivanov
aaae8fd200 JSController working, iptest js runs casperjs 2013-10-23 11:03:12 -07:00
Paul Ivanov
66972d69bf added javascript section with casperjs requirement 2013-10-23 11:03:11 -07:00
Paul Ivanov
8338f9ae90 simplify prepare_controllers logic 2013-10-23 11:03:11 -07:00
Paul Ivanov
641fdc77a7 include the # of active kernels in server info 2013-10-23 11:03:11 -07:00
Paul Ivanov
031811225e consistently get the first cell 2013-10-23 11:03:11 -07:00
Paul Ivanov
b75cd967d7 less convoluted way of grabbing output 2013-10-23 11:03:11 -07:00
Paul Ivanov
6d7758271e make casperjs test suite pass again 2013-10-23 11:03:11 -07:00
Paul Ivanov
928e846ea8 jstest moved to new place, closes #3125 2013-10-23 11:03:11 -07:00
David Wyde
9f4e9345a3 Add CasperJS tests for merge_cell_above() and merge_cell_below(). 2013-10-23 11:03:11 -07:00
David Wyde
dead20b1bd Use existing IPython method to kill kernels. 2013-10-23 11:03:11 -07:00
David Wyde
b566c71dfd Add tests for Markdown toolbar and menubar entries. 2013-10-23 11:03:11 -07:00
David Wyde
95873c65da Wrap CasperJS tests in a helper function to reduce boilerplate. 2013-10-23 11:03:11 -07:00
David Wyde
fce51827e0 Use keycode constants from jQuery UI and improve message in test. 2013-10-23 11:03:11 -07:00
David Wyde
6e7cd60cb5 Add a test to demonstrate errors when up/down arrow keys are
pressed in an empty notebook.
2013-10-23 11:03:11 -07:00
David Wyde
7f9aecc2d9 Add a README for CasperJS tests. 2013-10-23 11:03:11 -07:00
David Wyde
f5000f416e Add CasperJS utility functions, and tests for code and
Markdown cell execution.

Code cell test is based on https://gist.github.com/ellisonbg/3329929.
2013-10-23 11:03:11 -07:00
Thomas Kluyver
7570c8b00f Merge pull request #4426 from minrk/kernel-cwd
set kernel cwd to notebook's directory
2013-10-23 10:40:30 -07:00
MinRK
6bc2c65c83 notebooks should always have one checkpoint
closes #4396
2013-10-23 10:37:49 -07:00
MinRK
3a4d719033 fix checkpoint filename 2013-10-23 10:37:08 -07:00