TidGi-Desktop/features/crossWindowSync.feature
linonetwo 21ff2181c2 fix: flaky tests + merge scenarios to save 8 Electron launches
- crossWindowSync: wait for tiddler to be saved to disk via watch-fs before opening second window
- tidgiMiniWindowWorkspace: add retry backoff to 'should not see elements' step
- tidgiMiniWindow: add explicit window switch after addTiddler
- Merge 5 filesystemPlugin scenarios into 1 (save 4 launches)
- Merge 2 defaultWiki scenarios into 1 (save 1 launch)
- Merge 2 preference scenarios into 1 (save 1 launch)
- Merge smoke + logging into 1 (save 1 launch)
- Merge 2 tiddler scenarios into 1 (save 1 launch)
- Total: 65  57 scenarios (8 fewer Electron launches)
2026-04-02 14:45:43 +08:00

32 lines
1.7 KiB
Gherkin

Feature: Cross-Window Synchronization
As a user
I want changes made in the main window to sync to new windows
So that I can view consistent content across all windows
Background:
Given I cleanup test wiki so it could create a new one on start
And I launch the TidGi application
And I wait for the page to load completely
Then I should see a "default wiki workspace" element with selector "div[data-testid^='workspace-']:has-text('wiki')"
When I click on a "default wiki workspace button" element with selector "div[data-testid^='workspace-']:has-text('wiki')"
Then the browser view should be loaded and visible
And I wait for "SSE backend ready" log marker "[test-id-SSE_READY]"
@crossWindowSync @crossWindowSync-basic
Scenario: Changes made to files should sync back to browser via SSE
When I update workspace "wiki" settings:
| property | value |
| enableFileSystemWatch | true |
And I wait for SSE and watch-fs to be ready
# Edit Index tiddler in window A via TW syncer (this triggers save to server → disk)
When I execute TiddlyWiki code in browser view: "$tw.wiki.addTiddler(new $tw.Tiddler({title: 'Index', text: 'CrossWindowSyncTestContent123'}))"
# Wait for the syncer to save the tiddler to disk via server, so window B sees it
Then I wait for tiddler "Index" to be updated by watch-fs
# Open workspace in a new window (window B)
When I open workspace "wiki" in a new window
# Switch to the newly opened secondary window and verify it sees the same wiki content
When I switch to the newest window
Then the browser view should be loaded and visible
Then I should see "CrossWindowSyncTestContent123" in the browser view content