-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
155 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>issue-53</title> | ||
<link rel="icon" href="data:,"> | ||
<link rel="stylesheet" href="../css/scenario.css"> | ||
<script src="../.compiled/scenarios03/goog/base.js" type="text/javascript"></script> | ||
<script src="../.compiled/scenarios03/main.js" type="text/javascript"></script> | ||
</head> | ||
<body> | ||
This page scenario contains: | ||
<ul> | ||
<li>cljs-devtools</li> | ||
<li>dirac runtime properly initialized</li> | ||
<li>issue-53 workspace is present</li> | ||
</ul> | ||
|
||
<script>goog.require('dirac.tests.scenarios.issue_53')</script> | ||
|
||
</body> | ||
</html> |
10 changes: 10 additions & 0 deletions
10
test/browser/fixtures/src/scenarios03/dirac/tests/scenarios/issue_53.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(ns dirac.tests.scenarios.issue-53 | ||
"https://github.com/binaryage/dirac/issues/53" | ||
(:require [dirac.automation.runtime :refer [init-runtime!]] | ||
[dirac.automation.triggers :refer [install-common-triggers!]] | ||
[dirac.automation.scenario :as scenario] | ||
[dirac.tests.scenarios.issue-53.core])) | ||
|
||
(init-runtime!) | ||
(install-common-triggers!) | ||
(scenario/ready!) |
13 changes: 13 additions & 0 deletions
13
test/browser/fixtures/src/scenarios03/dirac/tests/scenarios/issue_53/core.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
(ns dirac.tests.scenarios.issue-53.core) | ||
|
||
(defn breakpoint-fn1 [] | ||
(let [x 1] | ||
(let [y 2] | ||
(let [x 3 | ||
z #(println x)] | ||
(js-debugger))))) | ||
|
||
(defn breakpoint-fn2 [one-one] | ||
(let [two-two 2] | ||
((fn rebind [] one-one)) | ||
(js-debugger))) |
30 changes: 30 additions & 0 deletions
30
test/browser/fixtures/src/tasks/dirac/tests/tasks/suite03/issue_53.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
(ns dirac.tests.tasks.suite03.issue-53 | ||
(:require [cljs.core.async :refer [<! timeout]] | ||
[cljs.test :refer-macros [is are]] | ||
[dirac.automation :refer-macros [<!* go-task with-scenario with-devtools with-console-feedback testing] :as a])) | ||
|
||
(go-task | ||
(with-scenario "issue-53" | ||
(with-devtools | ||
(<!* a/switch-to-console-panel!) | ||
(<!* a/switch-prompt-to-dirac!) | ||
(<!* a/wait-for-prompt-to-enter-edit-mode) | ||
(with-console-feedback | ||
(<!* a/console-enter! "(require 'dirac.tests.scenarios.issue-53.core)") | ||
(<!* a/console-exec-and-match! | ||
"(in-ns 'dirac.tests.scenarios.issue-53.core)" | ||
"setDiracPromptNS('dirac.tests.scenarios.issue-53.core')") | ||
|
||
(testing "test case 1" | ||
(<!* a/console-enter! "(breakpoint-fn1)") | ||
(<!* a/wait-for-panel-switch "sources") | ||
(<!* a/scrape! :scope-content) | ||
(<!* a/simulate-global-action! "F8")) ; resume paused debugger | ||
|
||
(testing "test case 2" | ||
(<!* a/switch-to-console-panel!) | ||
(<!* a/console-enter! "(breakpoint-fn2 1)") | ||
(<!* a/wait-for-panel-switch "sources") | ||
(<!* a/scrape! :scope-content) | ||
(<!* a/simulate-global-action! "F8")) ; resume paused debugger | ||
)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
ns Testing dirac.tests.tasks.suite03.issue-53 | ||
extension reset extension state | ||
extension set extension options:{:target-url "http://localhost:<port>"} | ||
extension set extension options:{:open-as "window"} | ||
automate open-scenario! ["issue-53"] | ||
automate open-devtools! | ||
extension handling command: open-dirac-devtools | ||
extension register devtools #1 | ||
devtools #1 implant initialized | ||
devtools #1 setCurrentPanel: elements | ||
devtools #1 devtools ready | ||
devtools #1 namespacesCache is cool now | ||
automate #1 switch-to-console-panel! | ||
devtools #1 setCurrentPanel: console | ||
devtools #1 console initialized | ||
devtools #1 adopt-prompt-element use-parinfer? true | ||
devtools #1 setDiracPromptMode('status') | ||
devtools #1 ConsoleView constructed | ||
devtools #1 displayWelcomeMessage | ||
automate #1 switch-prompt-to-dirac! | ||
devtools #1 switched console prompt to 'dirac' | ||
devtools #1 init-repl! | ||
devtools #1 setDiracPromptStatusContent('Checking for Dirac Runtime presence in your app...') | ||
devtools #1 setDiracPromptStatusStyle('info') | ||
devtools #1 setDiracPromptStatusContent('Dirac Agent connected. Bootstrapping ClojureScript REPL...') | ||
devtools #1 setDiracPromptNS('cljs.user') | ||
devtools #1 setDiracPromptMode('edit') | ||
automate #1 enable-console-feedback! | ||
automate #1 console-enter! ["(require 'dirac.tests.scenarios.issue-53.core)"] | ||
devtools #1 DC.info> (require 'dirac.tests.scenarios.issue-53.core) | ||
devtools #1 send-eval-request: (require 'dirac.tests.scenarios.issue-53.core) | ||
devtools #1 repl eval job started | ||
automate #1 console-exec-and-match! ["(in-ns 'dirac.tests.scenarios.issue-53.core)" "setDiracPromptNS('dirac.tests.scenarios.issue-53.core')"] | ||
devtools #1 repl eval job ended | ||
devtools #1 DC.info> (in-ns 'dirac.tests.scenarios.issue-53.core) | ||
devtools #1 send-eval-request: (in-ns 'dirac.tests.scenarios.issue-53.core) | ||
devtools #1 repl eval job started | ||
devtools #1 setDiracPromptNS('dirac.tests.scenarios.issue-53.core') | ||
devtools #1 repl eval job ended | ||
testing test case 1 | ||
automate #1 console-enter! ["(breakpoint-fn1)"] | ||
devtools #1 DC.info> (breakpoint-fn1) | ||
devtools #1 send-eval-request: (breakpoint-fn1) | ||
devtools #1 repl eval job started | ||
devtools #1 setCurrentPanel: sources | ||
automate #1 scrape! [:scope-content] | ||
stdout displayed 5 items: | ||
* this: Window | ||
* x: 1 | ||
* x: 3 | ||
* y: 2 | ||
* z: <custom> | ||
automate #1 simulate-global-action! ["F8"] | ||
devtools #1 DF.info> null | ||
devtools #1 repl eval job ended | ||
∎ | ||
testing test case 2 | ||
automate #1 switch-to-console-panel! | ||
devtools #1 setCurrentPanel: console | ||
automate #1 console-enter! ["(breakpoint-fn2 1)"] | ||
devtools #1 DC.info> (breakpoint-fn2 1) | ||
devtools #1 send-eval-request: (breakpoint-fn2 1) | ||
devtools #1 repl eval job started | ||
devtools #1 setCurrentPanel: sources | ||
automate #1 scrape! [:scope-content] | ||
stdout displayed 3 items: | ||
* one-one: 1 | ||
* this: Window | ||
* two-two: 2 | ||
automate #1 simulate-global-action! ["F8"] | ||
devtools #1 DF.info> null | ||
devtools #1 repl eval job ended | ||
∎ | ||
automate #1 disable-console-feedback! | ||
automate #1 close-devtools! | ||
extension handling command: close-dirac-devtools | ||
extension unregister devtools #1 | ||
automate close-scenario! ["scenario-tab#1"] | ||
summary Automated 17 actions with 3 check-points containing 0 assertions. | ||
0 failures, 0 errors. |