@yuantest/playwright - v1.0.5
    正在准备搜索索引...

    类 FlakyTestManager

    Extended base manager with automatic save scheduling functionality. Useful for managers that need to persist data periodically.

    class MyDataManager extends ManagedManager {
    private data: Map<string, any> = new Map();

    protected async doInitialize(): Promise<void> {
    await this.loadData();
    }

    updateData(key: string, value: any): void {
    this.data.set(key, value);
    this.scheduleSave(() => this.saveData());
    }

    private async saveData(): Promise<void> {
    await storage.writeJSON('data.json', Object.fromEntries(this.data));
    }
    }

    层级 (查看层级一览)

    索引

    构造函数

    属性

    _initialized: boolean = false
    initPromise: Promise<void> | null = null
    log: ChildLogger = ...
    dirty: boolean = false
    saveDelayMs: number = 1000

    方法

    • Initialize the manager. This method is idempotent. If already initialized, returns immediately. If initialization is in progress, waits for it to complete.

      返回 Promise<void>

    • Wait for the manager to be ready. Automatically calls initialize() if not already initialized.

      返回 Promise<void>

    • Schedule a save operation to be executed after a delay. Multiple calls will be debounced - only one save will occur.

      参数

      • saveFn: () => Promise<void>

        The async function to call for saving

      返回 void

    • Subclasses must implement this method to perform actual initialization. This method is called exactly once, when initialize() is first called.

      返回 Promise<void>

    • 参数

      • testId: string

      返回 Promise<boolean>

    • 参数

      • testId: string

      返回 Promise<boolean>

    • 返回 {
          totalTests: number;
          quarantined: number;
          flakyRate: number;
          topFlaky: FlakyTest[];
      }

    • 参数

      • 可选testId: string

      返回 Promise<void>

    • Immediately flush any pending save operations. Clears any scheduled save and executes it immediately.

      返回 Promise<void>