electron-agent-bridge
    Preparing search index...
    • Parse a flow file (YAML or JSON). ${env.NAME} in any string is replaced from env (a missing variable is an error). Problems are reported as file:line: steps[2].act.locator: ….

      Parameters

      • text: string
      • options: { env?: Readonly<Record<string, string | undefined>>; file?: string } = {}

      Returns {
          app?:
              | { connect: { pid?: number } }
              | {
                  launch: {
                      allowEval?: boolean;
                      allowPackaged?: boolean;
                      args?: string[];
                      cwd?: string;
                      env?: Record<string, string>;
                      executable: string;
                      strategy?: "node-options" | "inspector" | "auto";
                      timeoutMs?: number;
                  };
              };
          description?: string;
          name: string;
          steps: (
              | {
                  act: | {
                      button?: "left"
                      | "right"
                      | "middle";
                      clickCount?: number;
                      locator: {
                          css?: string;
                          exact?: boolean;
                          name?: string;
                          nth?: number;
                          ref?: string;
                          role?: string;
                          text?: string;
                      };
                      modifiers?: ("Alt" | "Control" | "Meta" | "Shift")[];
                      type: "click";
                  }
                  | {
                      locator: {
                          css?: string;
                          exact?: boolean;
                          name?: string;
                          nth?: number;
                          ref?: string;
                          role?: string;
                          text?: string;
                      };
                      type: "hover";
                  }
                  | {
                      locator: {
                          css?: string;
                          exact?: boolean;
                          name?: string;
                          nth?: number;
                          ref?: string;
                          role?: string;
                          text?: string;
                      };
                      type: "fill";
                      value: string;
                  }
                  | {
                      fields: {
                          locator: {
                              css?: string;
                              exact?: boolean;
                              name?: string;
                              nth?: number;
                              ref?: string;
                              role?: string;
                              text?: string;
                          };
                          value: string
                          | boolean
                          | string[];
                      }[];
                      type: "fillForm";
                  }
                  | {
                      locator?: {
                          css?: string;
                          exact?: boolean;
                          name?: string;
                          nth?: number;
                          ref?: string;
                          role?: string;
                          text?: string;
                      };
                      text: string;
                      type: "type";
                  }
                  | {
                      key: string;
                      locator?: {
                          css?: string;
                          exact?: boolean;
                          name?: string;
                          nth?: number;
                          ref?: string;
                          role?: string;
                          text?: string;
                      };
                      type: "press";
                  }
                  | {
                      locator: {
                          css?: string;
                          exact?: boolean;
                          name?: string;
                          nth?: number;
                          ref?: string;
                          role?: string;
                          text?: string;
                      };
                      type: "check";
                  }
                  | {
                      locator: {
                          css?: string;
                          exact?: boolean;
                          name?: string;
                          nth?: number;
                          ref?: string;
                          role?: string;
                          text?: string;
                      };
                      type: "uncheck";
                  }
                  | {
                      locator: {
                          css?: string;
                          exact?: boolean;
                          name?: string;
                          nth?: number;
                          ref?: string;
                          role?: string;
                          text?: string;
                      };
                      type: "select";
                      values: string[];
                  }
                  | {
                      deltaX?: number;
                      deltaY?: number;
                      locator?: {
                          css?: string;
                          exact?: boolean;
                          name?: string;
                          nth?: number;
                          ref?: string;
                          role?: string;
                          text?: string;
                      };
                      type: "scroll";
                  }
                  | {
                      files: string[];
                      locator: {
                          css?: string;
                          exact?: boolean;
                          name?: string;
                          nth?: number;
                          ref?: string;
                          role?: string;
                          text?: string;
                      };
                      type: "upload";
                  }
                  | {
                      from: {
                          css?: string;
                          exact?: boolean;
                          name?: string;
                          nth?: number;
                          ref?: string;
                          role?: string;
                          text?: string;
                      };
                      to: {
                          css?: string;
                          exact?: boolean;
                          name?: string;
                          nth?: number;
                          ref?: string;
                          role?: string;
                          text?: string;
                      };
                      type: "drag";
                  }
                  | (
                      | {
                          button?: "left"
                          | "right"
                          | "middle";
                          clickCount?: number;
                          locator: {
                              css?: string;
                              exact?: boolean;
                              name?: string;
                              nth?: number;
                              ref?: string;
                              role?: string;
                              text?: string;
                          };
                          modifiers?: ((...) | (...) | (...) | (...))[];
                          type: "click";
                      }
                      | {
                          locator: {
                              css?: string;
                              exact?: boolean;
                              name?: string;
                              nth?: number;
                              ref?: string;
                              role?: string;
                              text?: string;
                          };
                          type: "hover";
                      }
                      | {
                          locator: {
                              css?: string;
                              exact?: boolean;
                              name?: string;
                              nth?: number;
                              ref?: string;
                              role?: string;
                              text?: string;
                          };
                          type: "fill";
                          value: string;
                      }
                      | {
                          fields: {
                              locator: {
                                  css?: ...;
                                  exact?: ...;
                                  name?: ...;
                                  nth?: ...;
                                  ref?: ...;
                                  role?: ...;
                                  text?: ...;
                              };
                              value: (...)
                              | (...)
                              | (...)
                              | (...);
                          }[];
                          type: "fillForm";
                      }
                      | {
                          locator?: {
                              css?: (...)
                              | (...);
                              exact?: (...) | (...) | (...);
                              name?: (...) | (...);
                              nth?: (...) | (...);
                              ref?: (...) | (...);
                              role?: (...) | (...);
                              text?: (...) | (...);
                          };
                          text: string;
                          type: "type";
                      }
                      | {
                          key: string;
                          locator?: {
                              css?: (...)
                              | (...);
                              exact?: (...) | (...) | (...);
                              name?: (...) | (...);
                              nth?: (...) | (...);
                              ref?: (...) | (...);
                              role?: (...) | (...);
                              text?: (...) | (...);
                          };
                          type: "press";
                      }
                      | {
                          locator: {
                              css?: string;
                              exact?: boolean;
                              name?: string;
                              nth?: number;
                              ref?: string;
                              role?: string;
                              text?: string;
                          };
                          type: "check";
                      }
                      | {
                          locator: {
                              css?: string;
                              exact?: boolean;
                              name?: string;
                              nth?: number;
                              ref?: string;
                              role?: string;
                              text?: string;
                          };
                          type: "uncheck";
                      }
                      | {
                          locator: {
                              css?: string;
                              exact?: boolean;
                              name?: string;
                              nth?: number;
                              ref?: string;
                              role?: string;
                              text?: string;
                          };
                          type: "select";
                          values: string[];
                      }
                      | {
                          deltaX?: number;
                          deltaY?: number;
                          locator?: {
                              css?: (...)
                              | (...);
                              exact?: (...) | (...) | (...);
                              name?: (...) | (...);
                              nth?: (...) | (...);
                              ref?: (...) | (...);
                              role?: (...) | (...);
                              text?: (...) | (...);
                          };
                          type: "scroll";
                      }
                      | {
                          files: string[];
                          locator: {
                              css?: string;
                              exact?: boolean;
                              name?: string;
                              nth?: number;
                              ref?: string;
                              role?: string;
                              text?: string;
                          };
                          type: "upload";
                      }
                      | {
                          from: {
                              css?: string;
                              exact?: boolean;
                              name?: string;
                              nth?: number;
                              ref?: string;
                              role?: string;
                              text?: string;
                          };
                          to: {
                              css?: string;
                              exact?: boolean;
                              name?: string;
                              nth?: number;
                              ref?: string;
                              role?: string;
                              text?: string;
                          };
                          type: "drag";
                      }
                  )[];
                  continueOnError?: boolean;
                  name?: string;
                  target?: string;
                  timeoutMs?: number;
              }
              | {
                  continueOnError?: boolean;
                  name?: string;
                  target?: string;
                  timeoutMs?: number;
                  wait: | {
                      kind: "element";
                      locator: {
                          css?: string;
                          exact?: boolean;
                          name?: string;
                          nth?: number;
                          ref?: string;
                          role?: string;
                          text?: string;
                      };
                      state?: "visible"
                      | "detached"
                      | "enabled"
                      | "attached"
                      | "hidden";
                  }
                  | { kind: "text"; present?: boolean; text: string }
                  | { contains: string; kind: "url" }
                  | { channel: string; kind: "ipc" }
                  | { idleMs?: number; kind: "networkIdle" }
                  | { equals: {} | null; kind: "state"; path: string; store?: string };
              }
              | {
                  continueOnError?: boolean;
                  expect: | {
                      element: {
                          css?: string;
                          exact?: boolean;
                          name?: string;
                          nth?: number;
                          ref?: string;
                          role?: string;
                          text?: string;
                      };
                      state?: "visible"
                      | "detached"
                      | "enabled"
                      | "attached"
                      | "hidden";
                  }
                  | { present?: boolean; text: string }
                  | { url: { contains: string } }
                  | { state: { equals: {} | null; path: string; store?: string } }
                  | { ipc: { channel: string; min?: number } }
                  | { noConsoleErrors: true };
                  name?: string;
                  target?: string;
                  timeoutMs?: number;
              }
              | {
                  continueOnError?: boolean;
                  name?: string;
                  stub: {
                      method: "showOpenDialog"
                      | "showSaveDialog"
                      | "showMessageBox";
                      response: Record<string, unknown>;
                      times?: number;
                  };
                  target?: string;
                  timeoutMs?: number;
              }
              | {
                  continueOnError?: boolean;
                  menu: string[]
                  | { id: string };
                  name?: string;
                  target?: string;
                  timeoutMs?: number;
              }
              | {
                  continueOnError?: boolean;
                  name?: string;
                  target?: string;
                  timeoutMs?: number;
                  window: {
                      action: | "focus"
                      | "show"
                      | "hide"
                      | "minimize"
                      | "maximize"
                      | "restore"
                      | "close"
                      | "setBounds";
                      bounds?: { height?: number; width?: number; x?: number; y?: number };
                      id?: number;
                  };
              }
              | {
                  continueOnError?: boolean;
                  name?: string;
                  reset: true;
                  target?: string;
                  timeoutMs?: number;
              }
              | {
                  continueOnError?: boolean;
                  name?: string;
                  screenshot: { file?: string };
                  target?: string;
                  timeoutMs?: number;
              }
          )[];
          target?: string;
          timeoutMs?: number;
      }

      • Optionalapp?:
            | { connect: { pid?: number } }
            | {
                launch: {
                    allowEval?: boolean;
                    allowPackaged?: boolean;
                    args?: string[];
                    cwd?: string;
                    env?: Record<string, string>;
                    executable: string;
                    strategy?: "node-options" | "inspector" | "auto";
                    timeoutMs?: number;
                };
            }

        Default: connect to the newest running app (or the one --pid names).

      • Optionaldescription?: string
      • name: string
      • steps: (
            | {
                act: | {
                    button?: "left"
                    | "right"
                    | "middle";
                    clickCount?: number;
                    locator: {
                        css?: string;
                        exact?: boolean;
                        name?: string;
                        nth?: number;
                        ref?: string;
                        role?: string;
                        text?: string;
                    };
                    modifiers?: ("Alt" | "Control" | "Meta" | "Shift")[];
                    type: "click";
                }
                | {
                    locator: {
                        css?: string;
                        exact?: boolean;
                        name?: string;
                        nth?: number;
                        ref?: string;
                        role?: string;
                        text?: string;
                    };
                    type: "hover";
                }
                | {
                    locator: {
                        css?: string;
                        exact?: boolean;
                        name?: string;
                        nth?: number;
                        ref?: string;
                        role?: string;
                        text?: string;
                    };
                    type: "fill";
                    value: string;
                }
                | {
                    fields: {
                        locator: {
                            css?: string;
                            exact?: boolean;
                            name?: string;
                            nth?: number;
                            ref?: string;
                            role?: string;
                            text?: string;
                        };
                        value: string
                        | boolean
                        | string[];
                    }[];
                    type: "fillForm";
                }
                | {
                    locator?: {
                        css?: string;
                        exact?: boolean;
                        name?: string;
                        nth?: number;
                        ref?: string;
                        role?: string;
                        text?: string;
                    };
                    text: string;
                    type: "type";
                }
                | {
                    key: string;
                    locator?: {
                        css?: string;
                        exact?: boolean;
                        name?: string;
                        nth?: number;
                        ref?: string;
                        role?: string;
                        text?: string;
                    };
                    type: "press";
                }
                | {
                    locator: {
                        css?: string;
                        exact?: boolean;
                        name?: string;
                        nth?: number;
                        ref?: string;
                        role?: string;
                        text?: string;
                    };
                    type: "check";
                }
                | {
                    locator: {
                        css?: string;
                        exact?: boolean;
                        name?: string;
                        nth?: number;
                        ref?: string;
                        role?: string;
                        text?: string;
                    };
                    type: "uncheck";
                }
                | {
                    locator: {
                        css?: string;
                        exact?: boolean;
                        name?: string;
                        nth?: number;
                        ref?: string;
                        role?: string;
                        text?: string;
                    };
                    type: "select";
                    values: string[];
                }
                | {
                    deltaX?: number;
                    deltaY?: number;
                    locator?: {
                        css?: string;
                        exact?: boolean;
                        name?: string;
                        nth?: number;
                        ref?: string;
                        role?: string;
                        text?: string;
                    };
                    type: "scroll";
                }
                | {
                    files: string[];
                    locator: {
                        css?: string;
                        exact?: boolean;
                        name?: string;
                        nth?: number;
                        ref?: string;
                        role?: string;
                        text?: string;
                    };
                    type: "upload";
                }
                | {
                    from: {
                        css?: string;
                        exact?: boolean;
                        name?: string;
                        nth?: number;
                        ref?: string;
                        role?: string;
                        text?: string;
                    };
                    to: {
                        css?: string;
                        exact?: boolean;
                        name?: string;
                        nth?: number;
                        ref?: string;
                        role?: string;
                        text?: string;
                    };
                    type: "drag";
                }
                | (
                    | {
                        button?: "left"
                        | "right"
                        | "middle";
                        clickCount?: number;
                        locator: {
                            css?: string;
                            exact?: boolean;
                            name?: string;
                            nth?: number;
                            ref?: string;
                            role?: string;
                            text?: string;
                        };
                        modifiers?: ((...) | (...) | (...) | (...))[];
                        type: "click";
                    }
                    | {
                        locator: {
                            css?: string;
                            exact?: boolean;
                            name?: string;
                            nth?: number;
                            ref?: string;
                            role?: string;
                            text?: string;
                        };
                        type: "hover";
                    }
                    | {
                        locator: {
                            css?: string;
                            exact?: boolean;
                            name?: string;
                            nth?: number;
                            ref?: string;
                            role?: string;
                            text?: string;
                        };
                        type: "fill";
                        value: string;
                    }
                    | {
                        fields: {
                            locator: {
                                css?: ...;
                                exact?: ...;
                                name?: ...;
                                nth?: ...;
                                ref?: ...;
                                role?: ...;
                                text?: ...;
                            };
                            value: (...)
                            | (...)
                            | (...)
                            | (...);
                        }[];
                        type: "fillForm";
                    }
                    | {
                        locator?: {
                            css?: (...)
                            | (...);
                            exact?: (...) | (...) | (...);
                            name?: (...) | (...);
                            nth?: (...) | (...);
                            ref?: (...) | (...);
                            role?: (...) | (...);
                            text?: (...) | (...);
                        };
                        text: string;
                        type: "type";
                    }
                    | {
                        key: string;
                        locator?: {
                            css?: (...)
                            | (...);
                            exact?: (...) | (...) | (...);
                            name?: (...) | (...);
                            nth?: (...) | (...);
                            ref?: (...) | (...);
                            role?: (...) | (...);
                            text?: (...) | (...);
                        };
                        type: "press";
                    }
                    | {
                        locator: {
                            css?: string;
                            exact?: boolean;
                            name?: string;
                            nth?: number;
                            ref?: string;
                            role?: string;
                            text?: string;
                        };
                        type: "check";
                    }
                    | {
                        locator: {
                            css?: string;
                            exact?: boolean;
                            name?: string;
                            nth?: number;
                            ref?: string;
                            role?: string;
                            text?: string;
                        };
                        type: "uncheck";
                    }
                    | {
                        locator: {
                            css?: string;
                            exact?: boolean;
                            name?: string;
                            nth?: number;
                            ref?: string;
                            role?: string;
                            text?: string;
                        };
                        type: "select";
                        values: string[];
                    }
                    | {
                        deltaX?: number;
                        deltaY?: number;
                        locator?: {
                            css?: (...)
                            | (...);
                            exact?: (...) | (...) | (...);
                            name?: (...) | (...);
                            nth?: (...) | (...);
                            ref?: (...) | (...);
                            role?: (...) | (...);
                            text?: (...) | (...);
                        };
                        type: "scroll";
                    }
                    | {
                        files: string[];
                        locator: {
                            css?: string;
                            exact?: boolean;
                            name?: string;
                            nth?: number;
                            ref?: string;
                            role?: string;
                            text?: string;
                        };
                        type: "upload";
                    }
                    | {
                        from: {
                            css?: string;
                            exact?: boolean;
                            name?: string;
                            nth?: number;
                            ref?: string;
                            role?: string;
                            text?: string;
                        };
                        to: {
                            css?: string;
                            exact?: boolean;
                            name?: string;
                            nth?: number;
                            ref?: string;
                            role?: string;
                            text?: string;
                        };
                        type: "drag";
                    }
                )[];
                continueOnError?: boolean;
                name?: string;
                target?: string;
                timeoutMs?: number;
            }
            | {
                continueOnError?: boolean;
                name?: string;
                target?: string;
                timeoutMs?: number;
                wait: | {
                    kind: "element";
                    locator: {
                        css?: string;
                        exact?: boolean;
                        name?: string;
                        nth?: number;
                        ref?: string;
                        role?: string;
                        text?: string;
                    };
                    state?: "visible"
                    | "detached"
                    | "enabled"
                    | "attached"
                    | "hidden";
                }
                | { kind: "text"; present?: boolean; text: string }
                | { contains: string; kind: "url" }
                | { channel: string; kind: "ipc" }
                | { idleMs?: number; kind: "networkIdle" }
                | { equals: {} | null; kind: "state"; path: string; store?: string };
            }
            | {
                continueOnError?: boolean;
                expect: | {
                    element: {
                        css?: string;
                        exact?: boolean;
                        name?: string;
                        nth?: number;
                        ref?: string;
                        role?: string;
                        text?: string;
                    };
                    state?: "visible"
                    | "detached"
                    | "enabled"
                    | "attached"
                    | "hidden";
                }
                | { present?: boolean; text: string }
                | { url: { contains: string } }
                | { state: { equals: {} | null; path: string; store?: string } }
                | { ipc: { channel: string; min?: number } }
                | { noConsoleErrors: true };
                name?: string;
                target?: string;
                timeoutMs?: number;
            }
            | {
                continueOnError?: boolean;
                name?: string;
                stub: {
                    method: "showOpenDialog"
                    | "showSaveDialog"
                    | "showMessageBox";
                    response: Record<string, unknown>;
                    times?: number;
                };
                target?: string;
                timeoutMs?: number;
            }
            | {
                continueOnError?: boolean;
                menu: string[]
                | { id: string };
                name?: string;
                target?: string;
                timeoutMs?: number;
            }
            | {
                continueOnError?: boolean;
                name?: string;
                target?: string;
                timeoutMs?: number;
                window: {
                    action: | "focus"
                    | "show"
                    | "hide"
                    | "minimize"
                    | "maximize"
                    | "restore"
                    | "close"
                    | "setBounds";
                    bounds?: { height?: number; width?: number; x?: number; y?: number };
                    id?: number;
                };
            }
            | {
                continueOnError?: boolean;
                name?: string;
                reset: true;
                target?: string;
                timeoutMs?: number;
            }
            | {
                continueOnError?: boolean;
                name?: string;
                screenshot: { file?: string };
                target?: string;
                timeoutMs?: number;
            }
        )[]
      • Optionaltarget?: string

        Defaults for every step.

      • OptionaltimeoutMs?: number