mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-04-13 09:12:51 -07:00
34 lines
2.3 KiB
Gherkin
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"
|