32 enum class EPlayMode { Sequential, StepByStep };
38 bool loadScript(
const std::string& filePath);
39 bool loadJson(
const std::string& jsonStr);
42 void play(EPlayMode mode = EPlayMode::Sequential);
47 bool isPlaying()
const {
return running_; }
50 int currentStep()
const {
return currentIndex_; }
51 int totalSteps()
const {
return static_cast<int>(steps_.size()); }
52 const std::string& lastError()
const {
return lastError_; }
53 std::string progress()
const;
56 void stepStarted(
int index,
const std::string& description);
57 void stepCompleted(
int index,
const std::string& result);
58 void stepFailed(
int index,
const std::string& error);
59 void playbackFinished();
60 void playbackPaused();
63 void executeNextStep();
64 void executeStep(
int index);
65 void retryStep(
int index,
int maxRetries = 2);
66 void continuePlayback();
69 std::vector<RecordStep> steps_;
70 int currentIndex_ = -1;
71 bool running_ =
false;
73 std::string lastError_;