Browse Source

test(e2e,rtc): update rtc-outliner-conflict-update-test

rcmerci 4 months ago
parent
commit
4f6c0fee28
2 changed files with 36 additions and 31 deletions
  1. 1 1
      clj-e2e/dev/user.clj
  2. 35 30
      clj-e2e/test/logseq/e2e/rtc_extra_test.clj

+ 1 - 1
clj-e2e/dev/user.clj

@@ -22,7 +22,7 @@
 (reset! config/*port 3001)
 ;; show ui
 (reset! config/*headless false)
-(reset! config/*slow-mo 50)
+(reset! config/*slow-mo 30)
 
 (def *futures (atom {}))
 

+ 35 - 30
clj-e2e/test/logseq/e2e/rtc_extra_test.clj

@@ -238,17 +238,23 @@
           (rtc/wait-tx-update-to @*latest-remote-tx))
         (validate-2-graphs)))
     (testing "page1: indent block1 as child of block0, page2: delete block0"
-        (rtc/with-stop-restart-rtc
-          [@*page1 @*page2]
-          [@*page1 (rtc/with-wait-tx-updated (b/new-block "page1-done-1"))
-           @*page2 (rtc/with-wait-tx-updated (b/new-block "page2-done-1"))]
-          (w/with-page @*page1
-            (w/click (format ".ls-block :text('%s')" (str title-prefix "-" 1)))
-            (b/indent))
-          (w/with-page @*page2
-            (w/click (format ".ls-block :text('%s')" (str title-prefix "-" 0)))
-            (b/delete-blocks)))
-        (validate-2-graphs))
+      (rtc/with-stop-restart-rtc
+        [@*page1 @*page2]
+        [@*page1 (rtc/with-wait-tx-updated
+                   (k/esc)
+                   (assert/assert-in-normal-mode?)
+                   (b/new-block "page1-done-1"))
+         @*page2 (rtc/with-wait-tx-updated
+                   (k/esc)
+                   (assert/assert-in-normal-mode?)
+                   (b/new-block "page2-done-1"))]
+        (w/with-page @*page1
+          (w/click (format ".ls-block :text('%s')" (str title-prefix "-" 1)))
+          (b/indent))
+        (w/with-page @*page2
+          (w/click (format ".ls-block :text('%s')" (str title-prefix "-" 0)))
+          (b/delete-blocks)))
+      (validate-2-graphs))
     (comment
       "this case is failing now"
       (testing "
@@ -265,22 +271,21 @@ page2:
 - block4
   - block3"
         (rtc/with-stop-restart-rtc
-            [@*page1 @*page2]
-            [@*page1 (rtc/with-wait-tx-updated (b/new-block "page1-done-2"))
-             @*page2 (rtc/with-wait-tx-updated (b/new-block "page2-done-2"))]
-            (w/with-page @*page1
-              (w/click (format ".ls-block :text('%s')" (str title-prefix "-" 3)))
-              (b/indent)
-              (k/arrow-down)
-              (b/indent)
-              (b/indent))
-            (w/with-page @*page2
-              (w/click (format ".ls-block :text('%s')" (str title-prefix "-" 2)))
-              (b/delete-blocks)
-              (w/click (format ".ls-block :text('%s')" (str title-prefix "-" 3)))
-              (k/shift+arrow-down)
-              (k/meta+shift+arrow-down)
-              (k/enter)
-              (b/indent)))
-        (validate-2-graphs)
-        ))))
+          [@*page1 @*page2]
+          [@*page1 (rtc/with-wait-tx-updated (b/new-block "page1-done-2"))
+           @*page2 (rtc/with-wait-tx-updated (b/new-block "page2-done-2"))]
+          (w/with-page @*page1
+            (w/click (format ".ls-block :text('%s')" (str title-prefix "-" 3)))
+            (b/indent)
+            (k/arrow-down)
+            (b/indent)
+            (b/indent))
+          (w/with-page @*page2
+            (w/click (format ".ls-block :text('%s')" (str title-prefix "-" 2)))
+            (b/delete-blocks)
+            (w/click (format ".ls-block :text('%s')" (str title-prefix "-" 3)))
+            (k/shift+arrow-down)
+            (k/meta+shift+arrow-down)
+            (k/enter)
+            (b/indent)))
+        (validate-2-graphs)))))