{
  "entry_url": "https://www.zhihu.com/creator",
  "editor_url": "https://zhuanlan.zhihu.com/write",
  "domains": {
    "creator": "www.zhihu.com",
    "editor": "zhuanlan.zhihu.com"
  },
  "literals": {
    "write_entry_text": "写文章",
    "title_placeholder": "请输入标题（最多 100 个字）",
    "body_role": "textbox",
    "publish_text": "发布",
    "publish_confirm_text": "确认发布"
  },
  "selectors": {
    "creator_write_panel": "div.css-1q62b6s",
    "creator_write_entry": "div.css-1q62b6s > div.css-byu4by",
    "title_input": "textarea[placeholder='请输入标题（最多 100 个字）']",
    "body_editor": "div.notranslate.public-DraftEditor-content[contenteditable='true'][role='textbox']",
    "publish_button": "button.Button--primary.Button--blue",
    "publish_confirm_dialog": "div[role='dialog']",
    "publish_confirm_button": "div[role='dialog'] button.Button--primary.Button--blue",
    "published_title": "h1"
  },
  "steps": [
    {
      "name": "navigate_creator",
      "action": "navigate",
      "expected_domain": "creator",
      "url_ref": "entry_url",
      "log_message": "navigate https://www.zhihu.com/creator"
    },
    {
      "name": "click_write_article",
      "action": "click",
      "expected_domain": "creator",
      "selector_ref": "creator_write_entry",
      "wait_after_ms": 1500,
      "log_message": "click 写文章"
    },
    {
      "name": "wait_editor_ready",
      "action": "waitForSelector",
      "expected_domain": "editor",
      "selector_ref": "title_input",
      "timeout_ms": 8000,
      "log_message": "wait for editor title input"
    },
    {
      "name": "type_title",
      "action": "type",
      "expected_domain": "editor",
      "selector_ref": "title_input",
      "text_source": "title",
      "clear_first": true,
      "log_message": "type article title into 请输入标题（最多 100 个字）"
    },
    {
      "name": "type_body",
      "action": "type",
      "expected_domain": "editor",
      "selector_ref": "body_editor",
      "text_source": "body",
      "clear_first": true,
      "log_message": "type article body into editor textbox"
    },
    {
      "name": "scroll_publish_button",
      "action": "scrollTo",
      "expected_domain": "editor",
      "selector_ref": "publish_button",
      "only_when_publish": true,
      "log_message": "scroll to 发布"
    },
    {
      "name": "click_publish",
      "action": "click",
      "expected_domain": "editor",
      "selector_ref": "publish_button",
      "wait_after_ms": 800,
      "only_when_publish": true,
      "capture_url": true,
      "log_message": "click 发布"
    },
    {
      "name": "wait_publish_confirm_dialog",
      "action": "waitForSelector",
      "expected_domain": "editor",
      "selector_ref": "publish_confirm_dialog",
      "timeout_ms": 8000,
      "only_when_publish": true,
      "log_message": "wait for publish confirm dialog"
    },
    {
      "name": "click_publish_confirm",
      "action": "click",
      "expected_domain": "editor",
      "selector_ref": "publish_confirm_button",
      "wait_after_ms": 1500,
      "only_when_publish": true,
      "capture_url": true,
      "log_message": "click 确认发布"
    },
    {
      "name": "wait_published_title",
      "action": "waitForSelector",
      "expected_domain": "editor",
      "selector_ref": "published_title",
      "timeout_ms": 15000,
      "only_when_publish": true,
      "capture_url": true,
      "log_message": "wait for published article title"
    },
    {
      "name": "confirm_published_title",
      "action": "getText",
      "expected_domain": "editor",
      "selector_ref": "published_title",
      "only_when_publish": true,
      "expect_text_source": "title",
      "allow_empty_text": true,
      "capture_url": true,
      "log_message": "verify published article title"
    }
  ]
}
