FORGE KUI / learn

Build regression checks for settings

Check the model, native input, state and layout separately.

Version 3.61.7

Lesson 11
Before you start
Settings events and debugging completed
What you will build
Repeatable acceptance steps and model tests
Download project ↓settings-lab.zip

Run the packaged model test first

settings_state_test checks application state without a GUI. It verifies validation and revision behavior, not controls, focus or layout.

powershell
cmake --build build --config Release --parallel 4
ctest --test-dir build -C Release --output-on-failure

Read the existing tests

This code comes from the lesson project. A failed assertion is a failed check. Understand these boundaries before adding your own rules.

cpp
#include "settings_state.h"
#include <iostream>
#include <string>
int main() {
    SettingsState state;
    if (!state.save("  Workbench  ", false) || state.name != "Workbench" || state.notifications || state.revision != 1) return 1;
    if (state.save(" \t\r\n", true) || state.name != "Workbench" || state.notifications || state.revision != 1) return 2;
    if (state.save(std::string(257, 'a'), true) || state.revision != 1) return 3;
    if (!state.save(std::string(256, 'b'), true) || state.revision != 2) return 4;
    if (!state.save("<script>alert(1)</script>", false) || state.name != "<script>alert(1)</script>") return 5;
    std::cout << "PASS: trim, rejection preserves state, byte boundary, literal text\n";
    return 0;
}

Four native-window checks

Execute the same steps manually or through MCP.

  1. Save QA Studio and expect the name with one revision increment.
  2. Save blank input and expect an error with unchanged revision.
  3. Edit without saving and restore to QA Studio.
  4. Tab through input, checkbox, Save and Restore, recording actual version behavior.

Make the checks executable by an agent

Ask the agent to connect to the current window, identify nodes, use real input and clicks, and capture after the expected state appears. Record input method, assertions and failures separately.

text
Connect to the local KUI settings window through MCP.
Inspect #display-name, #save, #reset, #status and #revision.
Type QA Studio, click Save and wait for the saved status.
Try blank input and assert that the revision does not change.
Edit without saving, restore, and assert the input value.
Capture the final window. Report failures; do not replace real input with attribute edits.

Acceptance matrix and limitations

Cover Chinese/English, default/narrow windows and success/failure/restore. Enter activation has a recorded limitation in existing lesson runs and must remain a separate observation. Replacing it with a click does not establish keyboard support.

  • Model tests pass.
  • Real input, clicks and feedback work.
  • Key controls, error messages and focus remain visible.
  • Record versions, configuration, size, limitations and untested items.