@skrillex1224/playwright-toolkit 2.1.145 → 2.1.147

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -511,9 +511,18 @@ async function createApifyKit() {
511
511
  },
512
512
  /**
513
513
  * 宽松版runStep:失败时不调用Actor.fail,只抛出异常
514
+ * 支持透传 retry 等选项(failActor 始终固定为 false)
515
+ *
516
+ * @param {string} step - 步骤名称
517
+ * @param {import('playwright').Page} page - Playwright page 对象
518
+ * @param {Function} fn - 执行的异步操作
519
+ * @param {Object} [options] - 配置选项(支持 retry)
514
520
  */
515
- async runStepLoose(step, page, fn) {
516
- return await this.runStep(step, page, fn, { failActor: false });
521
+ async runStepLoose(step, page, fn, options = {}) {
522
+ return await this.runStep(step, page, fn, {
523
+ ...options,
524
+ failActor: false
525
+ });
517
526
  },
518
527
  /**
519
528
  * 推送成功数据的通用方法
@@ -2166,6 +2175,7 @@ var STEP_SEPARATOR = " | ";
2166
2175
  var STEP_EMOJIS = [
2167
2176
  { match: "\u4EFB\u52A1", emoji: "\u{1F9ED}" },
2168
2177
  { match: "\u8FD0\u884C\u6A21\u5F0F", emoji: "\u{1F9E9}" },
2178
+ { match: "\u6A21\u677F\u8BC6\u522B", emoji: "\u{1F9F1}" },
2169
2179
  { match: "\u767B\u5F55", emoji: "\u{1F510}" },
2170
2180
  { match: "\u73AF\u5883", emoji: "\u{1F9EA}" },
2171
2181
  { match: "\u8F93\u5165", emoji: "\u2328\uFE0F" },
@@ -2751,6 +2761,53 @@ var LOG_DEFINITIONS = [
2751
2761
  attention: "medium",
2752
2762
  buildDetails: (reason) => [reason ? `\u539F\u56E0=${reason}` : ""]
2753
2763
  },
2764
+ {
2765
+ key: "ai_search_card_detect_attempt",
2766
+ method: "aiSearchCardDetectAttempt",
2767
+ label: "AI Search \u5361\u7247\u8BC6\u522B\u5C1D\u8BD5",
2768
+ group: "AI Search",
2769
+ step: "AI Search \u5361\u7247\u8BC6\u522B",
2770
+ status: "\u5C1D\u8BD5",
2771
+ level: "info",
2772
+ attention: "low",
2773
+ buildDetails: (attempt = 1, maxAttempts = 1, url = "") => [
2774
+ `attempt=${attempt}/${maxAttempts}`,
2775
+ url ? `url=${url}` : ""
2776
+ ]
2777
+ },
2778
+ {
2779
+ key: "ai_search_card_detect_success",
2780
+ method: "aiSearchCardDetectSuccess",
2781
+ label: "AI Search \u5361\u7247\u8BC6\u522B\u6210\u529F",
2782
+ group: "AI Search",
2783
+ step: "AI Search \u5361\u7247\u8BC6\u522B",
2784
+ status: "\u6210\u529F",
2785
+ level: "success",
2786
+ attention: "high",
2787
+ buildDetails: (cardType = "", attempts = 1, refreshCount = 0, url = "") => [
2788
+ cardType ? `cardType=${cardType}` : "",
2789
+ `attempts=${attempts}`,
2790
+ `refreshCount=${refreshCount}`,
2791
+ url ? `url=${url}` : ""
2792
+ ]
2793
+ },
2794
+ {
2795
+ key: "ai_search_card_empty_result_success",
2796
+ method: "aiSearchCardEmptyResultSuccess",
2797
+ label: "AI Search \u7A7A\u7ED3\u679C\u6210\u529F",
2798
+ group: "AI Search",
2799
+ step: "AI Search \u7A7A\u7ED3\u679C",
2800
+ status: "\u6210\u529F",
2801
+ level: "success",
2802
+ attention: "high",
2803
+ buildDetails: (contentLeftTpls = [], targetTpls = [], url = "", attempts = 0, refreshCount = 0) => [
2804
+ Array.isArray(contentLeftTpls) ? `contentLeftTpls=${normalizeSnippet(contentLeftTpls.join(","), 200)}` : "",
2805
+ Array.isArray(targetTpls) ? `targetTpls=${normalizeSnippet(targetTpls.join(","), 200)}` : "",
2806
+ `attempts=${attempts}`,
2807
+ `refreshCount=${refreshCount}`,
2808
+ url ? `url=${url}` : ""
2809
+ ]
2810
+ },
2754
2811
  {
2755
2812
  key: "data_push_success",
2756
2813
  method: "dataPushSuccess",