Skip to content

Commit a66422b

Browse files
committed
feat: update
1 parent fa85088 commit a66422b

File tree

4 files changed

+37
-42
lines changed

4 files changed

+37
-42
lines changed

personal/clomacs/bb.edn

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{:paths ["src"]
22
:deps
3-
{medley/medley {:mvn/version "1.3.0"}
4-
djblue/portal {:mvn/version "0.19.2"}
5-
camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.2"}}}
3+
{medley/medley {:mvn/version "1.3.0"}
4+
djblue/portal {:mvn/version "0.22.1"}
5+
camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.2"}
6+
refactor-nrepl/refactor-nrepl {:mvn/version "3.5.2"}}}

personal/clomacs/deps.edn

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{:paths ["src"]
22
:deps
3-
{medley/medley {:mvn/version "1.3.0"}
4-
hickory/hickory {:mvn/version "LATEST"}
5-
djblue/portal {:mvn/version "0.19.2"}
6-
camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.2"}}}
3+
{medley/medley {:mvn/version "1.3.0"}
4+
hickory/hickory {:mvn/version "LATEST"}
5+
djblue/portal {:mvn/version "0.22.1"}
6+
camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.2"}
7+
refactor-nrepl/refactor-nrepl {:mvn/version "3.5.2"}}}

personal/clomacs/src/playwright/core.clj

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,21 @@
1919
(defn find-method [s]
2020
(str/replace (re-find #"^[^\(]+" s) #"^page\." ""))
2121

22+
(defn find-methods [s]
23+
(vec (drop 1 (str/split s #"\." ))))
24+
25+
(defn swap-paren-position [s]
26+
(let [method-name (re-find #"^[^\(]+" s)]
27+
(-> (str "(." method-name " " (str/replace s (re-pattern (str"^" method-name "\\(")) ""))
28+
(str/replace #" \)" ")"))))
29+
2230
(defn parse-page-method [s]
2331
(if (str/starts-with? s "page")
24-
(let [method (find-method s)]
25-
(-> s
26-
(str/replace (re-pattern (str "page." method "\\((.+)\\)")) "$1")
27-
js-quote->cl-string
28-
(as-> $ (clojure.pprint/cl-format nil "(.~A page ~A)" method $))))
32+
(let [method (find-method s)
33+
methods (mapv (comp swap-paren-position js-quote->cl-string) (find-methods s))]
34+
35+
(-> s
36+
(as-> $ (clojure.pprint/cl-format nil "(-> page ~A)" (str/join " " methods)))))
2937
s))
3038

3139
(defn expect-page-url? [s]
@@ -44,32 +52,13 @@
4452
(str/join "\n"))))
4553

4654
(comment
47-
(let [s "// Go to http://localhost:8000/
48-
await page.goto('http://localhost:8000/');
49-
// Click text=Wealth Management
50-
await page.click('text=Wealth Management');
51-
// Click text=Swiss Francs CHF
52-
await page.click('text=Swiss Francs CHF');
53-
// Click text=Performance CurrencyUS $Euro €Swiss Francs CHFFund Selection >> p
54-
await page.click('text=Performance CurrencyUS $Euro €Swiss Francs CHFFund Selection >> p');
55-
await expect(page).toHaveURL('http://localhost:8000/#/funds');
56-
// Click [aria-label=\"next page\"]
57-
await page.click('[aria-label=\"next page\"]');
58-
// Click text=Vontobel Asia Pacific Equity
59-
await page.click('text=Vontobel Asia Pacific Equity');
60-
await expect(page).toHaveURL('http://localhost:8000/#/fund/30102303100_1_10311111_1/overview');
61-
// Click button[role=\"tab\"]:has-text(\"Insights\")
62-
await page.click('button[role=\"tab\"]:has-text(\"Insights\")');
63-
await expect(page).toHaveURL('http://localhost:8000/#/fund/30102303100_1_10311111_1/insights');
64-
// Click button[role=\"tab\"]:has-text(\"ESG\")
65-
await page.click('button[role=\"tab\"]:has-text(\"ESG\")');
66-
await expect(page).toHaveURL('http://localhost:8000/#/fund/30102303100_1_10311111_1/esg');
67-
// Click button[role=\"tab\"]:has-text(\"Risk\")
68-
await page.click('button[role=\"tab\"]:has-text(\"Risk\")');
69-
await expect(page).toHaveURL('http://localhost:8000/#/fund/30102303100_1_10311111_1/analytics');
70-
// Click button:has-text(\"Selection\")
71-
await page.click('button:has-text(\"Selection\")');
72-
await expect(page).toHaveURL('http://localhost:8000/#/funds');"]
73-
(println (str/join "\n" (code->clj s))))
55+
(let [s "
56+
await page.locator('button[role=\"tab\"]:has-text(\"Style\")').click();
57+
await page.locator('button[role=\"tab\"]:has-text(\"Style\")').first().click();
58+
"]
59+
#_(println (str/join "\n" (code->clj s)))
60+
(println (code->clj s))
61+
)
62+
7463
(clojure.pprint/cl-format nil "(.click page ~A)" "hello")
7564
(clojure.pprint/cl-format nil "(.~A page ~A)" "hello" "world"))

personal/lsp.el

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,14 @@
6464
((t (:inherit nil :background nil :foreground nil :weight semi-bold
6565
:box (:line-width -1))))))
6666

67-
(use-package lsp-grammarly
68-
:after lsp-mode
69-
:ensure t)
67+
;; (use-package lsp-grammarly
68+
;; :after lsp-mode
69+
;; :ensure t
70+
;; :hook ((latex-mode . lsp)
71+
;; (markdown-mode . lsp)
72+
;; (org-mode . lsp)))
7073

7174
;; (setq lsp-ui-doc-position 'at-point)
7275
;; (setq lsp-ui-doc-delay 10.0)
76+
7377
;; (setq lsp-ui-sideline-delay 10.0)

0 commit comments

Comments
 (0)