forked from logseq/logseq
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
f0af0f0
commit 69fa58f
Showing
3 changed files
with
66 additions
and
5 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 |
---|---|---|
@@ -1 +1 @@ | ||
{} | ||
{"defaultCommandTimeout": 10000} |
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 |
---|---|---|
@@ -1,10 +1,52 @@ | ||
(ns app.window | ||
(:require-macros [latte.core :refer [describe beforeEach it]])) | ||
(:require-macros [latte.core :refer [describe beforeEach before it]]) | ||
(:require [latte.chai :refer (expect)]) | ||
(:refer-clojure :exclude [first get])) | ||
|
||
(def cy js/cy) | ||
|
||
(defn back-to-home | ||
[] | ||
(.. cy (get ".cp__header-logo") | ||
(first) | ||
(click))) | ||
|
||
(defn edit-block | ||
[content] | ||
(.. cy (get "textarea") | ||
(first) | ||
(click) | ||
(type content))) | ||
|
||
|
||
(describe "Window" | ||
(beforeEach [] | ||
(.visit cy "https://example.cypress.io/commands/window")) | ||
(it "cy.window() - get the global window object" [] | ||
(.should (.window cy) "have.property" "top"))) | ||
(.clearIndexedDB cy)) | ||
(before [] | ||
(.visit cy "http://localhost:3001")) | ||
|
||
(it "Search" [] | ||
(.. cy | ||
(get "#search-field") | ||
(click) | ||
(type "welcome to Logseq")) | ||
(.. cy (get "#ui__ac-inner") | ||
(should (fn [result] | ||
(expect result :to.have.length 1)))) | ||
(back-to-home) | ||
|
||
;; create new page | ||
(.. cy | ||
(get "#search-field") | ||
(click) | ||
(type "new page")) | ||
|
||
(.wait cy 1000) | ||
|
||
(.. cy | ||
(get "#search-field") | ||
(type "{enter}")) | ||
|
||
;; edit bullet | ||
(edit-block "this is my first bullet {enter}") | ||
(edit-block "this is my second bullet {enter}"))) |
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