Feature: Agent Tools - Ask-question variants and turn action bar
As a user
I want agent tools to render correctly and respond to interaction
So that I can interact with the AI agent through various tool UIs
Background:
Given I add test ai settings
And I have started the mock OpenAI server without rules
Then I launch the TidGi application
And I wait for the page to load completely
And I should see a "page body" element with selector "body"
And I click on "agent workspace button and new tab button" elements with selectors:
| element description | selector |
| agent workspace | [data-testid='workspace-agent'] |
| new tab button | [data-tab-id='new-tab-button'] |
@agentTool @mockOpenAI
Scenario: Ask-question — single-select, multi-select, and text input in one session
# All 6 mock responses are queued in FIFO order; each ask-question consumes 2
Given I add mock OpenAI responses:
| response | stream |
| {"question":"Which approach do you prefer?","inputType":"single-select","options":[{"label":"Approach A: Create separate tiddlers for each topic and link them","description":"This keeps content modular and easy to navigate"},{"label":"Approach B: Create one large tiddler with sections","description":"Simpler structure, all information in one place"}],"allowFreeform":true} | false |
| 好的,你选择了方法A。我将为每个主题创建独立的tiddler并链接它们。 | false |
| {"question":"Which tags should I add to the new tiddler?","inputType":"multi-select","options":[{"label":"AI","description":"Artificial Intelligence"},{"label":"Programming","description":"Software development"},{"label":"Notes","description":"Personal notes"}],"allowFreeform":false} | false |
| 好的,我将为tiddler添加 AI, Programming 两个标签。 | false |
| {"question":"What title should the new tiddler have?","inputType":"text","allowFreeform":true} | false |
| 好的,我将创建标题为"My Custom Title"的tiddler。 | false |
# Create agent
When I click on a "create default agent button" element with selector "[data-testid='create-default-agent-button']"
And I should see a "message input box" element with selector "[data-testid='agent-message-input']"
# ── Part 1: single-select ──
When I click on a "message input textarea" element with selector "[data-testid='agent-message-input']"
And I type "帮我整理笔记" in "chat input" element with selector "[data-testid='agent-message-input']"
And I press "Enter" key
Then I should see an "ask question container" element with selector "[data-testid='ask-question-container']"
And I should see "question text and two full-width options" elements with selectors:
| element description | selector |
| question text | *:has-text('Which approach do you prefer?') |
| option A | [data-testid='ask-question-option-0']:has-text('Approach A') |
| option B | [data-testid='ask-question-option-1']:has-text('Approach B') |
And I should not see a "raw tool use xml" element with selector "*:has-text('