enhance: add e2e tests for outliner ops (#11828)

* first e2e example

* Add wally repl pause/resume example

* use with-page-open

* add indent outdent test

* outliner add delete tests

* remove all timeout usage

* refactor: move fns to logseq.util

* Add commands tests for command trigger and node reference

* Add http-server

* add bb script to build release and run tests

* exit when tests finished

* Add clj e2e workflow

* increase slow-mo to 100
This commit is contained in:
Tienson Qin
2025-04-24 00:51:22 +08:00
committed by GitHub
parent 1fb34efc8c
commit d0a3e08958
14 changed files with 529 additions and 2 deletions

80
.github/workflows/clj-e2e.yml vendored Normal file
View File

@@ -0,0 +1,80 @@
name: Clojure E2E
on:
push:
branches: [test/db-e2e]
paths:
- 'clj-e2e/**'
pull_request:
branches: [test/db-e2e]
paths:
- 'clj-e2e/**'
env:
CLOJURE_VERSION: '1.11.1.1413'
# This is the latest node version we can run.
NODE_VERSION: '20'
BABASHKA_VERSION: '1.0.168'
jobs:
e2e-test-build:
name: Test
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
cache-dependency-path: |
yarn.lock
- name: Set up Clojure
uses: DeLaGuardo/setup-clojure@10.1
with:
cli: ${{ env.CLOJURE_VERSION }}
bb: ${{ env.BABASHKA_VERSION }}
- name: Clojure cache
uses: actions/cache@v3
id: clojure-deps
with:
path: |
~/.m2/repository
~/.gitlibs
key: ${{ runner.os }}-clojure-deps-${{ hashFiles('deps.edn') }}
restore-keys: ${{ runner.os }}-clojure-deps-
- name: Fetch Clojure deps
if: steps.clojure-deps.outputs.cache-hit != 'true'
run: clojure -A:cljs -P
- name: Shadow-cljs cache
uses: actions/cache@v3
with:
path: .shadow-cljs
# ensure update cache every time
key: ${{ runner.os }}-shadow-cljs-${{ github.sha }}
# will match most recent upload
restore-keys: |
${{ runner.os }}-shadow-cljs-
- name: Fetch yarn deps
run: yarn install
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: true
# NOTE: require the app to be build with DEV-RELEASE flag
- name: Prepare E2E test build
run: |
yarn gulp:build && clojure -M:cljs release app --config-merge "{:closure-defines {frontend.config/DEV-RELEASE true}}" --debug
rsync -avz --exclude node_modules --exclude android --exclude ios ./static/ ./public/static/
ls -lR ./public
- name: Run e2e tests
run: cd clj-e2e && bb dev
env:
DEBUG: "pw:api"