package net.northking.cctp.se.script.core;


import net.northking.cctp.element.core.IExecuteContext;
import net.northking.cctp.se.debug.bean.DebuggerRequest;
import net.northking.cctp.se.script.bean.Variable;

/**
 * 脚本运行时上下文接口
 */
public interface IScriptRuntimeContext extends IExecuteContext {
    String KEY_CURRENT_REQUEST = "__currentRequest";
    String KEY_CURRENT_STEP = "__currentStep";
    String KEY_CURRENT_DRIVER = "__deviceDriver";
    String KEY_CURRENT_CONN = "__deviceConnection";
    String KEY_TASK_TENANT = "__tenantId";
    String KEY_FOR_CURRENT_INDEX = "__forCurrentIndex";
    String KEY_ENV_ID = "__envId";
    String APP_VERSION = "__appVersion";
    String IS_DEBUG = "__isDebug";
    DebuggerRequest getCurrentRequest();
    /**
     * 脚本运行过程中是否截屏
     * @return
     */
    boolean isSnapshot();
    /**
     * 脚本运行过程中是否录屏
     * @return
     */
    boolean isRecord();
    /**
     * 脚本运行过程中是否采集移动设备日志
     */
    boolean isSaveMobileSyslog();

    /**
     * 获取变量定义
     * @param key
     * @return
     */
    Variable getVariableInfo(String key);

    /**
     * 设置上下文变量
     * @param key
     * @param object
     */
    void setContextVariable(String key,Object object);

}
