Files
dify/e2e/features/workflows/prompt-draft-persistence.feature

71 lines
3.2 KiB
Gherkin

@workflows @authenticated
Feature: Persist LLM node prompts in workflow drafts
@workflow-collaboration
Scenario: Recover a prompt edit made before the connection was interrupted
Given a Chatflow with a saved LLM prompt and collaboration enabled
When I open the app from the app list
And I open the LLM prompt editor
And I edit the prompt and interrupt its upload
Then the server should still have the original prompt
When I reopen the LLM prompt editor while the collaboration connection is unavailable
Then the edited LLM prompt should still be visible
When I reopen the editor after the collaboration connection returns
Then the edited LLM prompt should be durably saved
@workflow-collaboration
Scenario: Reconcile a saved prompt after its confirmation is lost
Given a Chatflow with a saved LLM prompt and collaboration enabled
When I open the app from the app list
And I open the LLM prompt editor
And I edit the prompt and lose its successful save confirmation
Then the server should already have the edited prompt
And the edited LLM prompt should still be visible
When the collaboration connection returns
Then the retried prompt save should confirm the same stored revision
@workflow-collaboration
Scenario Outline: Keep a replaced draft when another editor reconnects
Given a Chatflow with a published LLM prompt and a second editor
When I open the app from the app list
And the other editor opens the same Chatflow
And I save a newer LLM prompt
And the other editor queues changes while disconnected
And I <replace the draft>
Then the saved draft contains the replacement prompt
When the other editor reconnects
Then both editors see the replacement instead of the queued changes
And the other editor can save and reload a new prompt
Examples:
| replace the draft |
| restore the published LLM prompt |
| overwrite the draft with its original DSL |
@core @workflow-http-draft
Scenario: Save and reload a prompt with collaboration disabled
Given a Chatflow with a saved LLM prompt and collaboration disabled
When I open the app from the app list
And I open the LLM prompt editor
And I edit the LLM prompt
Then the edited LLM prompt should be saved through the ordinary HTTP draft request
When I reload the Chatflow prompt editor
Then the edited LLM prompt should still be visible
@workflow-collaboration
Scenario Outline: Prevent an old tab from recreating a replaced local draft
Given a Chatflow with a published LLM prompt open in two tabs
When I open the app from the app list
And the other editor opens the same Chatflow
And I save a newer LLM prompt
And the other editor queues changes while disconnected
And I <replace the draft>
Then the saved draft contains the replacement prompt
And the old local draft is cleared across both tabs
When the disconnected tab edits the old draft again
Then both tabs keep the replacement after reconnect and reload
Examples:
| replace the draft |
| restore the published LLM prompt |
| overwrite the draft with its original DSL |