Skip to content

Commit

Permalink
fix(test): update cypress tests according to new ui
Browse files Browse the repository at this point in the history
andelf authored and tiensonqin committed Nov 18, 2021
1 parent 36aa870 commit 673d6a8
Showing 3 changed files with 18 additions and 11 deletions.
18 changes: 10 additions & 8 deletions cypress/integration/app/basic.cljs
Original file line number Diff line number Diff line change
@@ -11,12 +11,17 @@
(beforeEach []
(.clearIndexedDB cy))
(before []
(.visit cy "http://localhost:3001"))
(.. cy
(visit "http://localhost:3001")
(get "#main-content-container" #js {:timeout 10000})
(should (fn [result]
(expect result :not.to.contain "Loading")))))

(it "Search" []
(.. cy
(get "#search-button")
(click)
(get "input.cp__palette-input")
(type "welcome to Logseq"))
(.. cy (get "#ui__ac-inner")
(should (fn [result]
@@ -27,14 +32,11 @@
(.. cy
(get "#search-button")
(click)
(type "new page"))

(.wait cy 1000)

(.. cy
(get "#search-button")
(get "input.cp__palette-input")
(type "new page")
(wait 500)
(type "{enter}"))

;; edit bullet
(util/edit-block "this is my first bullet {enter}")
(util/edit-block "this is my second bullet {enter}")
9 changes: 7 additions & 2 deletions cypress/integration/app/template.cljs
Original file line number Diff line number Diff line change
@@ -12,18 +12,23 @@
(.clearIndexedDB cy)
(cy.wait 1000))
(before []
(.visit cy "http://localhost:3001"))
(.. cy
(visit "http://localhost:3001")
(get "#main-content-container" #js {:timeout 10000})
(should (fn [result]
(expect result :not.to.contain "Loading")))))
(it "template-basic" []
(.. cy
(get "#search-button")
(click)
(get "input.cp__palette-input")
(type "template test page")
(wait 1000)
(type "{enter}"))
(util/edit-block "template")
(.. cy
(realPress #js ["Shift" "Enter"]))
(util/edit-block "template:: template-name{enter}")
(util/edit-block "template:: template-name{enter}{enter}")
(util/tab)
(util/edit-block "line1{enter}")
(util/edit-block "line2{enter}")
2 changes: 1 addition & 1 deletion cypress/integration/app/util.cljs
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@

(defn back-to-home
[]
(.. cy (get ".cp__header-logo")
(.. cy (get ".ui__modal")
(first)
(click)))

0 comments on commit 673d6a8

Please sign in to comment.