{"id":43,"date":"2026-03-05T10:00:00","date_gmt":"2026-03-05T02:00:00","guid":{"rendered":"http:\/\/localhost:8888\/?p=43"},"modified":"2026-07-09T16:17:45","modified_gmt":"2026-07-09T08:17:45","slug":"allure%e6%b5%8b%e8%af%95%e6%8a%a5%e5%91%8a%e7%be%8e%e5%8c%96%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/blog.runnergo.cn\/?p=43","title":{"rendered":"Allure\u6d4b\u8bd5\u62a5\u544a\u7f8e\u5316\u6307\u5357 &#8211; \u8ba9\u6d4b\u8bd5\u7ed3\u679c\u53ef\u89c6\u5316\u5448\u73b0"},"content":{"rendered":"<h1>Allure\u6d4b\u8bd5\u62a5\u544a\u7f8e\u5316\u6307\u5357 - \u8ba9\u6d4b\u8bd5\u7ed3\u679c\u53ef\u89c6\u5316\u5448\u73b0<\/h1>\n\n&gt; \u4f5c\u8005\uff1a\u6d4b\u8bd5\u62a5\u544a\u541b\n---\n\n<h2>\u524d\u8a00<\/h2>\n\n\u5927\u5bb6\u597d\uff0c\u6211\u662f\u6d4b\u8bd5\u62a5\u544a\u541b\u3002\u505a\u6d4b\u8bd5\u62a5\u544a\u5206\u67904\u5e74\uff0cAllure\u662f\u6211\u6700\u559c\u6b22\u7684\u62a5\u544a\u6846\u67b6\u3002\u4eca\u5929\u5206\u4eabAllure\u62a5\u544a\u7684\u7f8e\u5316\u548c\u5b9a\u5236\u6280\u5de7\u3002\n\n---\n\n<h2>\u4e00\u3001Allure\u62a5\u544a\u7ed3\u6784<\/h2>\n\n<h3>\u62a5\u544a\u5185\u5bb9<\/h3>\n\nAllure\u62a5\u544a\u5305\u542b\uff1a\n<ul><li>\u6267\u884c\u6982\u89c8\uff08\u6210\u529f\/\u5931\u8d25\u7edf\u8ba1\uff09<\/li>\n<li>\u529f\u80fd\u5206\u7c7b\uff08\u6309Feature\u5206\u7ec4\uff09<\/li>\n<li>\u65f6\u95f4\u7edf\u8ba1\uff08\u6267\u884c\u8017\u65f6\u5206\u6790\uff09<\/li>\n<li>\u8be6\u7ec6\u4fe1\u606f\uff08\u8bf7\u6c42\u3001\u54cd\u5e94\u3001\u65e5\u5fd7\uff09<\/li>\n<\/ul>\n---\n\n<h2>\u4e8c\u3001Allure\u6ce8\u89e3\u4f7f\u7528<\/h2>\n\n<code>`<\/code>java\n@Allure.Feature(\"\u7528\u6237\u7ba1\u7406\")\n@Allure.Story(\"\u767b\u5f55\u529f\u80fd\")\n@Allure.Title(\"\u9a8c\u8bc1\u7528\u6237\u767b\u5f55\u6210\u529f\")\n@Allure.Severity(Allure.SEVERITY.CRITICAL)\npublic void testLoginSuccess() {\n    Allure.step(\"\u6253\u5f00\u767b\u5f55\u9875\u9762\");\n    Allure.step(\"\u8f93\u5165\u7528\u6237\u540d\u5bc6\u7801\");\n    Allure.step(\"\u70b9\u51fb\u767b\u5f55\u6309\u94ae\");\n    Allure.step(\"\u9a8c\u8bc1\u767b\u5f55\u6210\u529f\");\n}\n<code>`<\/code>\n\n---\n\n<h2>\u4e09\u3001\u622a\u56fe\u9644\u4ef6<\/h2>\n\n<code>`<\/code>java\n\/\/ \u5931\u8d25\u65f6\u622a\u56fe\n@Attachment(value = \"\u5931\u8d25\u622a\u56fe\", type = \"image\/png\")\npublic byte[] takeScreenshot() {\n    return ((TakesScreenshot)driver).getScreenshotAs(OutputType.BYTES);\n}\n<code>`<\/code>\n\n---\n\n<h2>\u603b\u7ed3<\/h2>\n\nAllure\u62a5\u544a\u7f8e\u5316\u8981\u70b9\uff1a\n\n| \u8981\u70b9 | \u65b9\u6cd5 |\n|------|------|\n| \u5206\u7ec4 | @Feature\u3001@Story\u6ce8\u89e3 |\n| \u6b65\u9aa4 | Allure.step() |\n| \u9644\u4ef6 | @Attachment |\n| \u4e25\u91cd\u7ea7\u522b | @Severity |\n\n---\n\n<strong>\u4e0b\u671f\u9884\u544a\uff1a\u6570\u636e\u9a71\u52a8\u6d4b\u8bd5\u5b9e\u6218 - Excel\u3001YAML\u3001JSON\u591a\u6e90\u6570\u636e\u7ba1\u7406<\/strong>\n\n&gt; \u4f5c\u8005\uff1a\u6d4b\u8bd5\u62a5\u544a\u541b\uff0c4\u5e74\u6d4b\u8bd5\u62a5\u544a\u5206\u6790\u7ecf\u9a8c","protected":false},"excerpt":{"rendered":"<p>Allure\u6d4b\u8bd5\u62a5\u544a\u7f8e\u5316\u6307\u5357 &#8211; \u8ba9\u6d4b\u8bd5\u7ed3\u679c\u53ef\u89c6\u5316\u5448\u73b0 &gt; \u4f5c\u8005\uff1a\u6d4b\u8bd5\u62a5\u544a\u541b &#8212; \u524d\u8a00 \u5927\u5bb6\u597d\uff0c\u6211\u662f\u6d4b\u8bd5\u62a5\u544a\u541b\u3002\u505a\u6d4b\u8bd5\u62a5\u544a\u5206\u67904\u5e74\uff0cAllure\u662f\u6211\u6700\u559c\u6b22\u7684\u62a5\u544a\u6846\u67b6\u3002\u4eca\u5929\u5206\u4eabAllure\u62a5\u544a&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-43","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=\/wp\/v2\/posts\/43","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=43"}],"version-history":[{"count":0,"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=\/wp\/v2\/posts\/43\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=43"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=43"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=43"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}