mirror of
https://github.com/logseq/logseq.git
synced 2026-05-04 19:06:21 +00:00
This pull request refactors the plugin library infrastructure and adds new experimental features for hosted/sidebar renderers. The main changes include: Purpose: Refactor plugin communication library (Postmate) to support MessageChannel for improved performance, add support for hosted/sidebar renderers in plugins, add new debug APIs, and consolidate helper functions. Changes: Added MessageChannel support to Postmate for optimized plugin-host communication with backward compatibility Introduced hosted renderer and sidebar renderer APIs for plugins to register custom UI components Added new app APIs: get_current_route, export_debug_log_db, reset_debug_log_db Refactored helper functions from helpers.ts to common.ts and updated all import paths Extended block property APIs to include class properties with default values Added comprehensive documentation for experiments APIs and plugin development Added E2E test for plugin marketplace installation Version bump from 0.2.12 to 0.3.1
e2e
e2e tests for Logseq app.
Prerequisites
- The app's JS and CSS assets are built and located at
../static/. - Babashka is installed.
Setup
Serve the static assets (default port 3002):
$ bb serve
To use a custom port:
$ bb serve --port 3001
$ bb serve -p 3001
Running Tests
Run all tests (namespaces ending in -basic-test):
$ bb test
Run a single test namespace:
$ bb test -n logseq.e2e.editor-basic-test
Run a single test function:
$ bb test -v logseq.e2e.editor-basic-test/toggle-between-page-and-block
Filter by metadata tag (e.g. ^:focus):
$ bb test -i focus
Combine namespace and tag filters:
$ bb test -n logseq.e2e.editor-basic-test -i focus
Run tests against a custom port:
$ bb test -p 3001
Run tests and serve together (starts both in parallel):
$ bb dev
$ bb dev -p 3001
How -i Works
The -i/--include flag is a cognitect test-runner option. It filters tests by Clojure metadata key. Add ^:focus to any deftest and pass -i focus to run only those tests:
(deftest ^:focus my-test
...)
RTC Tests
Run RTC extra tests (served + tested in parallel):
$ bb run-rtc-extra-test
$ bb run-rtc-extra-part2-test
Debugging
When tests fail, clj-e2e/e2e-dump/ contains console logs and screenshots.