diff --git a/test/browser/fixtures/resources/scenarios/issue-53.html b/test/browser/fixtures/resources/scenarios/issue-53.html new file mode 100644 index 0000000000..a7c2c318c5 --- /dev/null +++ b/test/browser/fixtures/resources/scenarios/issue-53.html @@ -0,0 +1,21 @@ + + + + issue-53 + + + + + + +This page scenario contains: + + + + + + diff --git a/test/browser/fixtures/src/scenarios03/dirac/tests/scenarios/issue_53.cljs b/test/browser/fixtures/src/scenarios03/dirac/tests/scenarios/issue_53.cljs new file mode 100644 index 0000000000..41e74ced41 --- /dev/null +++ b/test/browser/fixtures/src/scenarios03/dirac/tests/scenarios/issue_53.cljs @@ -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!) diff --git a/test/browser/fixtures/src/scenarios03/dirac/tests/scenarios/issue_53/core.cljs b/test/browser/fixtures/src/scenarios03/dirac/tests/scenarios/issue_53/core.cljs new file mode 100644 index 0000000000..fd806cedf2 --- /dev/null +++ b/test/browser/fixtures/src/scenarios03/dirac/tests/scenarios/issue_53/core.cljs @@ -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))) diff --git a/test/browser/fixtures/src/tasks/dirac/tests/tasks/suite03/issue_53.cljs b/test/browser/fixtures/src/tasks/dirac/tests/tasks/suite03/issue_53.cljs new file mode 100644 index 0000000000..c2b2cb2678 --- /dev/null +++ b/test/browser/fixtures/src/tasks/dirac/tests/tasks/suite03/issue_53.cljs @@ -0,0 +1,30 @@ +(ns dirac.tests.tasks.suite03.issue-53 + (:require [cljs.core.async :refer ["} +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: +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.