2018-11-02 00:00:10 -04:00
|
|
|
@eldoc
|
2019-04-14 14:39:46 -04:00
|
|
|
Scenario: remote eldoc (largely unused)
|
2018-11-02 00:00:10 -04:00
|
|
|
Given I enable "ein:enable-eldoc-support"
|
2019-03-29 12:11:12 -04:00
|
|
|
Given I clear log expr "ein:log-all-buffer-name"
|
2019-05-14 10:02:40 -04:00
|
|
|
Given new python notebook
|
2018-11-02 00:00:10 -04:00
|
|
|
And I type "import math"
|
|
|
|
And I press "C-a"
|
|
|
|
And I call eldoc-documentation-function
|
|
|
|
And I switch to log expr "ein:log-all-buffer-name"
|
|
|
|
Then I should not see "ein:completions--prepare-oinfo"
|
|
|
|
|
2018-11-10 09:47:54 -05:00
|
|
|
@complete
|
|
|
|
Scenario: auto completion
|
|
|
|
Given I set "ein:ac-direct-matches" to eval "nil"
|
|
|
|
Given I set "ein:completion-backend" to eval "(quote ein:use-ac-backend)"
|
2019-05-14 10:02:40 -04:00
|
|
|
Given new python notebook
|
2018-11-10 09:47:54 -05:00
|
|
|
And I type "import itertool"
|
|
|
|
And I press "C-c C-i"
|
|
|
|
And I wait for the smoke to clear
|
|
|
|
Then "ein:ac-direct-matches" should include "itertools"
|
|
|
|
|
|
|
|
@complete
|
|
|
|
Scenario: no auto completion
|
|
|
|
Given I set "ein:ac-direct-matches" to eval "nil"
|
|
|
|
Given I set "ein:completion-backend" to eval "(quote ein:use-none-backend)"
|
2019-05-14 10:02:40 -04:00
|
|
|
Given new python notebook
|
2018-11-10 09:47:54 -05:00
|
|
|
And I type "import itertool"
|
|
|
|
And I press "C-c C-i"
|
|
|
|
And I wait for the smoke to clear
|
|
|
|
Then "ein:ac-direct-matches" should not include "itertools"
|
|
|
|
|
2018-12-25 19:12:26 -05:00
|
|
|
@complete
|
|
|
|
Scenario: company completion
|
|
|
|
Given I set "ein:completion-backend" to eval "(quote ein:use-company-backend)"
|
|
|
|
Given I kill all websocket buffers
|
2019-05-14 10:02:40 -04:00
|
|
|
Given new python notebook
|
2018-12-25 19:12:26 -05:00
|
|
|
And I type "import itertools"
|
|
|
|
And I press "M-RET"
|
|
|
|
And I type "itertools."
|
|
|
|
And I call "company-complete"
|
2018-12-28 21:45:12 -05:00
|
|
|
And I wait for completions "itertools.chain"
|
2018-12-25 19:12:26 -05:00
|
|
|
And I press "C-a"
|
|
|
|
And I press "C-k"
|
|
|
|
And I clear websocket log
|
|
|
|
And I type "itertool"
|
|
|
|
And I call "company-complete"
|
|
|
|
Then I should see "itertools"
|
|
|
|
And I type ".chai"
|
|
|
|
And I call "company-complete"
|
|
|
|
Then I should see "itertools.chain"
|
|
|
|
Then no completion traffic
|
|
|
|
Given I set "ein:completion-backend" to eval "(quote ein:use-ac-backend)"
|
2019-05-14 10:02:40 -04:00
|
|
|
Given new python notebook
|
2018-12-25 19:12:26 -05:00
|
|
|
Given I set "ein:completion-backend" to eval "(quote ein:use-none-backend)"
|
|
|
|
|
2019-03-29 12:11:12 -04:00
|
|
|
@rename
|
|
|
|
Scenario: rename notebook
|
2019-05-14 10:02:40 -04:00
|
|
|
Given new python notebook
|
2019-03-29 12:11:12 -04:00
|
|
|
And I press "C-c C-/"
|
|
|
|
And I switch to buffer like "Untitled"
|
|
|
|
And rename notebook to "Renamed" succeeds
|
|
|
|
|
2019-04-29 12:09:27 -04:00
|
|
|
@image
|
|
|
|
Scenario: image fails to materialize initially. Document this in a test.
|
2019-05-14 10:02:40 -04:00
|
|
|
Given new python notebook
|
2019-04-29 12:09:27 -04:00
|
|
|
And I type "import numpy, math, matplotlib.pyplot as plt"
|
|
|
|
And I press "RET"
|
|
|
|
And I type "x = numpy.linspace(0, 2*math.pi)"
|
|
|
|
And I press "RET"
|
|
|
|
And I type "plt.plot(x, numpy.sin(x))"
|
|
|
|
And I press "RET"
|
|
|
|
And I clear log expr "ein:log-all-buffer-name"
|
|
|
|
And I wait for cell to execute
|
|
|
|
And I dump buffer
|
|
|
|
And I switch to log expr "ein:log-all-buffer-name"
|
|
|
|
Then I should not see "msg_type=display_data"
|
|
|
|
And I switch to buffer like "Untitled"
|
|
|
|
And I wait for cell to execute
|
|
|
|
And I dump buffer
|
|
|
|
And I switch to log expr "ein:log-all-buffer-name"
|
|
|
|
Then I should see "msg_type=display_data"
|
|
|
|
|
2018-12-05 17:15:02 -05:00
|
|
|
@switch
|
|
|
|
Scenario: switch kernel
|
2019-05-14 10:02:40 -04:00
|
|
|
Given new python notebook
|
2018-12-05 17:15:02 -05:00
|
|
|
And I type "import itertools"
|
|
|
|
And I wait for cell to execute
|
|
|
|
And I switch kernel to "ir"
|
|
|
|
|
2018-10-30 14:17:29 -04:00
|
|
|
@reconnect
|
2018-11-03 16:02:04 -04:00
|
|
|
Scenario: kernel reconnect succeeds
|
2019-05-14 10:02:40 -04:00
|
|
|
Given new python notebook
|
2018-10-30 14:17:29 -04:00
|
|
|
When I type "import math"
|
|
|
|
And I wait for cell to execute
|
|
|
|
And I kill processes like "websocket"
|
2018-10-31 03:28:25 -04:00
|
|
|
And I switch to log expr "ein:log-all-buffer-name"
|
2018-10-30 14:17:29 -04:00
|
|
|
Then I should see "WS closed unexpectedly"
|
|
|
|
And I switch to buffer like "Untitled"
|
2018-11-15 13:53:22 -06:00
|
|
|
And header says "Kernel requires reconnect \<ein:notebook-mode-map>\[ein:notebook-reconnect-session-command]"
|
2018-11-03 16:02:04 -04:00
|
|
|
And I clear log expr "ein:log-all-buffer-name"
|
2018-10-30 14:17:29 -04:00
|
|
|
And I press "C-c C-r"
|
|
|
|
And I wait for the smoke to clear
|
2018-11-15 13:53:22 -06:00
|
|
|
And header does not say "Kernel requires reconnect \<ein:notebook-mode-map>\[ein:notebook-reconnect-session-command]"
|
2018-11-03 16:02:04 -04:00
|
|
|
And I switch to log expr "ein:log-all-buffer-name"
|
|
|
|
Then I should not see "[warn]"
|
|
|
|
And I should not see "[error]"
|
|
|
|
And I should see "ein:kernel-retrieve-session--complete"
|
|
|
|
And I switch to buffer like "Untitled"
|
2018-11-05 10:16:40 -05:00
|
|
|
And I kill processes like "websocket"
|
|
|
|
And I switch to log expr "ein:log-all-buffer-name"
|
|
|
|
Then I should see "WS closed unexpectedly"
|
|
|
|
And I switch to buffer like "Untitled"
|
2018-11-15 13:53:22 -06:00
|
|
|
And header says "Kernel requires reconnect \<ein:notebook-mode-map>\[ein:notebook-reconnect-session-command]"
|
2018-11-05 10:16:40 -05:00
|
|
|
And I clear log expr "ein:log-all-buffer-name"
|
|
|
|
And I wait for cell to execute
|
2018-11-15 13:53:22 -06:00
|
|
|
And header does not say "Kernel requires reconnect \<ein:notebook-mode-map>\[ein:notebook-reconnect-session-command]"
|
2018-11-05 10:16:40 -05:00
|
|
|
And I switch to log expr "ein:log-all-buffer-name"
|
|
|
|
Then I should not see "[warn]"
|
|
|
|
And I should not see "[error]"
|
|
|
|
And I should see "ein:kernel-retrieve-session--complete"
|
|
|
|
And I switch to buffer like "Untitled"
|
2018-11-01 20:08:10 -04:00
|
|
|
And I clear log expr "ein:log-all-buffer-name"
|
2018-11-03 16:02:04 -04:00
|
|
|
And I restart kernel
|
2018-11-01 20:08:10 -04:00
|
|
|
And I switch to log expr "ein:log-all-buffer-name"
|
|
|
|
Then I should not see "[warn]"
|
|
|
|
And I should not see "[error]"
|
2018-11-03 16:02:04 -04:00
|
|
|
And I should see "ein:kernel-retrieve-session--complete"
|
|
|
|
And I switch to buffer like "Untitled"
|
|
|
|
And I kill kernel
|
2018-11-15 13:53:22 -06:00
|
|
|
And header says "Kernel requires reconnect \<ein:notebook-mode-map>\[ein:notebook-reconnect-session-command]"
|
2018-11-03 16:02:04 -04:00
|
|
|
And I clear log expr "ein:log-all-buffer-name"
|
|
|
|
And my reconnect is questioned
|
2019-05-03 09:23:29 -04:00
|
|
|
|
|
|
|
@exit
|
|
|
|
Scenario: Saving fails upon quit, need to consult user
|
2019-05-14 10:02:40 -04:00
|
|
|
Given new python notebook
|
2019-05-03 09:23:29 -04:00
|
|
|
When I type "import math"
|
|
|
|
And I wait for cell to execute
|
|
|
|
And I cannot save upon quit
|
|
|
|
|
|
|
|
@kill
|
|
|
|
Scenario: Assign variable, save, kill notebook buffer, get it back, check variable
|
2019-05-14 10:02:40 -04:00
|
|
|
Given new python notebook
|
2019-05-03 09:23:29 -04:00
|
|
|
When I type "import math"
|
|
|
|
And I press "RET"
|
|
|
|
And I type "b = math.pi"
|
|
|
|
And I press "RET"
|
|
|
|
And I wait for cell to execute
|
|
|
|
And I press "C-x C-s"
|
|
|
|
And I wait for the smoke to clear
|
|
|
|
And I kill buffer and reopen
|
|
|
|
And I press "C-c C-b"
|
|
|
|
And I type "b"
|
|
|
|
And I wait for cell to execute
|
|
|
|
Then I should see "3.1415"
|
2019-05-14 10:02:40 -04:00
|
|
|
And I press "C-x k"
|
|
|
|
|
|
|
|
@julia
|
|
|
|
Scenario: Smoke test julia
|
|
|
|
Given new julia notebook
|
|
|
|
When I type "isapprox(Base.MathConstants.e ^ (pi * im), -1)"
|
|
|
|
And I wait for cell to execute
|
2019-05-16 15:01:45 -04:00
|
|
|
Then I should see "true"
|
2019-05-24 15:58:07 -04:00
|
|
|
And I dump buffer
|
|
|
|
|
|
|
|
@evil
|
|
|
|
Scenario: Test the undo-tree-incompatible-logic
|
|
|
|
Given new python notebook
|
|
|
|
And I call "evil-mode"
|
|
|
|
Then the value of "undo-tree-mode" is nil
|
|
|
|
And I call "evil-mode"
|