TidGi-Desktop/features/editWorkspace.feature
2026-03-26 23:30:26 +08:00

34 lines
2.3 KiB
Gherkin

@edit-workspace-save
Feature: Edit Workspace
As a user
I want to edit workspace settings
Background:
Given I cleanup test wiki so it could create a new one on start
When 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')"
# Open edit workspace window
When I open edit workspace window for workspace with name "wiki"
And I switch to "editWorkspace" window
@edit-workspace-save-http-api
Scenario: Save button disappears after enabling HTTP API and restarting wiki
# Server section is always visible (no accordion). Click sidebar to scroll to it, then toggle the switch.
When I click on "server section sidebar and enableHTTPAPI switch and save button" elements with selectors:
| element description | selector |
| server section sidebar btn | [data-testid='preference-section-server'] |
| enableHTTPAPI switch | [data-testid='enable-http-api-switch'] |
| save button | [data-testid='edit-workspace-save-button'] |
Then I should not see a "save button" element with selector "[data-testid='edit-workspace-save-button']"
Then I should see a "restart snackbar with restart button" element with selector "button:has-text('')"
# Clear RESTARTING marker to catch the new restart event
And I clear log lines containing "[test-id-WIKI_WORKER_RESTARTING]"
# Click the restart button in the snackbar (still in editWorkspace window)
When I click on a "restart now button in snackbar" element with selector "button:has-text('')"
# Wait for wiki worker restart to begin - RESTARTING marker is logged immediately when restart starts
Then I wait for "wiki worker restart initiated" log marker "[test-id-WIKI_WORKER_RESTARTING]"
# Save button should STILL be hidden after restart completes
# This tests that the workspace state doesn't diverge after restart, not triggered by fields like `lastUrl`
Then I should not see a "save button after restart" element with selector "[data-testid='edit-workspace-save-button']"
Then settings.json should have workspace "wiki" with "enableHTTPAPI" set to "true"