{
  "schemaVersion": "0.11.0",
  "canonical": "https://www.pystone.net/notes/chatgpt-game-autotest-sensitive-word-filter/",
  "atlas": "https://www.pystone.net/?node=chatgpt-game-autotest-sensitive-word-filter#knowledge-atlas",
  "markdown": "https://www.pystone.net/notes/chatgpt-game-autotest-sensitive-word-filter.md",
  "context": "https://www.pystone.net/notes/chatgpt-game-autotest-sensitive-word-filter.context.json",
  "knowledgeVersion": "224c990773de.5fa8af6e39fa",
  "build": {
    "siteCommit": "224c990773de166d23a886306577dd90379529ce",
    "notesCommit": "5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a",
    "builtAt": "1970-01-01T00:00:00.000Z",
    "version": "224c990773de.5fa8af6e39fa"
  },
  "id": "note:chatgpt-game-autotest-sensitive-word-filter",
  "slug": "chatgpt-game-autotest-sensitive-word-filter",
  "title": "【ChatGPT】游戏自动化测试实践案例 - 敏感词过滤",
  "type": "note",
  "visibility": "public",
  "idStability": "rename-stable",
  "author": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "publisher": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "aliases": [],
  "summary": "【ChatGPT】游戏自动化测试实践案例 敏感词过滤",
  "contentRole": "unspecified",
  "isMoc": false,
  "mocRecognition": "none",
  "generated": false,
  "attribution": "unspecified",
  "domain": "99-资料来源、摘录与归档",
  "tags": [],
  "mocs": [],
  "contentHash": "e806d2eb1f19786aa5a4c57e9020250c4f7a5d0624eceb85599ef0847c357ef0",
  "assets": [],
  "headings": [
    {
      "depth": 1,
      "text": "【ChatGPT】游戏自动化测试实践案例 - 敏感词过滤",
      "anchor": "chatgpt游戏自动化测试实践案例---敏感词过滤",
      "citation": "https://www.pystone.net/notes/chatgpt-game-autotest-sensitive-word-filter/#chatgpt%E6%B8%B8%E6%88%8F%E8%87%AA%E5%8A%A8%E5%8C%96%E6%B5%8B%E8%AF%95%E5%AE%9E%E8%B7%B5%E6%A1%88%E4%BE%8B---%E6%95%8F%E6%84%9F%E8%AF%8D%E8%BF%87%E6%BB%A4"
    },
    {
      "depth": 2,
      "text": "连接到目标设备device = connectdevice(\"Android:///\")",
      "anchor": "连接到目标设备device-connectdeviceandroid",
      "citation": "https://www.pystone.net/notes/chatgpt-game-autotest-sensitive-word-filter/#%E8%BF%9E%E6%8E%A5%E5%88%B0%E7%9B%AE%E6%A0%87%E8%AE%BE%E5%A4%87device-connectdeviceandroid"
    },
    {
      "depth": 2,
      "text": "初始化 Pocopoco = UnityPoco(device)",
      "anchor": "初始化-pocopoco-unitypocodevice",
      "citation": "https://www.pystone.net/notes/chatgpt-game-autotest-sensitive-word-filter/#%E5%88%9D%E5%A7%8B%E5%8C%96-pocopoco-unitypocodevice"
    },
    {
      "depth": 2,
      "text": "点击输入框并输入敏感词 inputbox = poco(\"inputbox\")",
      "anchor": "点击输入框并输入敏感词-inputbox-pocoinputbox",
      "citation": "https://www.pystone.net/notes/chatgpt-game-autotest-sensitive-word-filter/#%E7%82%B9%E5%87%BB%E8%BE%93%E5%85%A5%E6%A1%86%E5%B9%B6%E8%BE%93%E5%85%A5%E6%95%8F%E6%84%9F%E8%AF%8D-inputbox-pocoinputbox"
    },
    {
      "depth": 2,
      "text": "点击发送按钮 sendbutton = poco(\"sendbutton\")",
      "anchor": "点击发送按钮-sendbutton-pocosendbutton",
      "citation": "https://www.pystone.net/notes/chatgpt-game-autotest-sensitive-word-filter/#%E7%82%B9%E5%87%BB%E5%8F%91%E9%80%81%E6%8C%89%E9%92%AE-sendbutton-pocosendbutton"
    },
    {
      "depth": 2,
      "text": "检查敏感词是否被过滤 message = poco(\"message\")",
      "anchor": "检查敏感词是否被过滤-message-pocomessage",
      "citation": "https://www.pystone.net/notes/chatgpt-game-autotest-sensitive-word-filter/#%E6%A3%80%E6%9F%A5%E6%95%8F%E6%84%9F%E8%AF%8D%E6%98%AF%E5%90%A6%E8%A2%AB%E8%BF%87%E6%BB%A4-message-pocomessage"
    }
  ],
  "claims": [],
  "outgoing": [],
  "incoming": [
    {
      "id": "note:sources-excerpts-archive",
      "title": "资料来源、摘录与归档",
      "url": "https://www.pystone.net/notes/sources-excerpts-archive/",
      "atlas": "https://www.pystone.net/?node=sources-excerpts-archive#knowledge-atlas",
      "label": "资料来源、摘录与归档",
      "origin": "explicit",
      "humanReviewed": true,
      "context": "02-AI对话与研究原始输出中的“【ChatGPT】游戏自动化测试实践案例 - 敏感词过滤”导航项",
      "citation": "https://www.pystone.net/notes/sources-excerpts-archive/#02-ai%E5%AF%B9%E8%AF%9D%E4%B8%8E%E7%A0%94%E7%A9%B6%E5%8E%9F%E5%A7%8B%E8%BE%93%E5%87%BA"
    }
  ],
  "contentMarkdown": "# 【ChatGPT】游戏自动化测试实践案例 - 敏感词过滤\n\n> [!note] ChatGPT 问答录\n> 本文保存一次 ChatGPT 问答原始输出，仅作为资料来源；其中结论未自动视为已验证知识，使用前应结合可靠来源复核。\n\n\n> 创建时间：2023/6/11 19:08\n\n一个简单的示例：\n\npython\n\nfrom airtest.core.api import connect_device, time\n\nfrom poco.drivers.unity3d import UnityPoco\n\n## 连接到目标设备device = connect_device(\"Android:///\")\n\n## 初始化 Pocopoco = UnityPoco(device)\n\ndef test_sensitive_word_filtering(): for word in sensitive_words:\n\n## 点击输入框并输入敏感词 input_box = poco(\"input_box\")\n\ninput_box.click()\n\ntext(\"word\")\n\ntime.sleep(1)\n\n## 点击发送按钮 send_button = poco(\"send_button\")\n\nsend_button.click()\n\ntime.sleep(1)\n\n## 检查敏感词是否被过滤 message = poco(\"message\")\n\nassert message.get_text() == \"***\", f\"敏感词 {word} 未被过滤！\"\n\ntest_sensitive_word_filtering()\n\n在上述示例中，我们首先连接到目标设备并初始化 Poco。然后，我们遍历敏感词列表，逐个输入敏感词并点击发送按钮。最后，我们检查应用程序是否成功地过滤了这些敏感词（将其替换为 \"***\"）。\n"
}
