พอดีเห็นว่ามีคนพัฒนา Library สำหรับช่วยสร้างผลการทำงานจาก Robot Framework
ให้อยู่ในรูปแบบของ Allure Report Framework
ชื่อว่า Robot Framework Allure Report
แต่ยังไม่ทำการสร้างไฟล์ report สวย ๆ นะ
เป็นเพียงไฟล์ xml และไฟล์ property กาก ๆ เท่านั้น

ดังนั้นต้องทำการสร้าง report หน้าสวย ๆ เอง
ผ่าน Allure Command line ต่อไป

มาดูตัวอย่างการติดตั้งและใช้งานกันนิดหน่อย

1. ทำการติดตั้ง Allure Command line กันก่อน

เป็น command line สำหรับการสร้างไฟล์ report สวยงาม

ติดตั้งสำหรับ Mac OS ด้วยคำสั่ง

$brew tap qatools/formulas
$brew install allure-commandline

การติดตั้งสำหรับ Windows และ Unix
ทำการ download library มาจาก Allure Core
จากนั้นทำการ extract และกำหนดในตัวแปร PATH ซะ

ผลจากการติดตั้งจะต้องใช้คำสั่งนี้ได้จากทุกที่

$allure

ผลการทำงานเป็นดังนี้

usage: allure [(-v | --verbose)] [(-q | --quiet)] <command> [<args>]

The most commonly used allure commands are:
    generate   Generate report
    help       Display help information
    report     Report commands
    version    Display version

See 'allure help <command>' for more information on a specific command.

2. ทำการติดตั้ง Library สำหรับ Robot Framework

สามารถติดตั้งผ่าน pip ด้วยคำสั่ง

$pip install robotframework-allurereport

3. ทำการเขียน test data ของ Robotframework อย่างง่ายเพื่อทดสอบ

นั่นก็คือ Hello Google ดังนี้

คำอธิบาย
สามารถกำหนด path สำหรับเก็บไฟล์ xml ของสำหรับ Allure report
จากนั้นทำการ run test data ด้วยคำสั่งปกติ

$pybot hello.robot

ผลการทำงานยังทำงานเป็นปกติเช่นเดิม
เพิ่มเติมคือไฟล์ต่าง ๆ สำหรับ Allure report อยู่ใน path ที่เรากำหนดไว้
ตัวอย่างเช่น

872228a1-7700-4a70-9cd9-2c1472b3253e-testsuite.xml
allure.properties
environment.xml

ปล. จะทำเก็บ history ของผลการทำสอบแต่ละครั้งให้ด้วยนะ ดีมาก ๆ

4. ทำการสร้างไฟล์ report สวย ๆ ในรูปแบบของ Allure

ด้วยคำสั่งดังนี้

$allure generate <path of allure report>

ผลการทำงานเป็นดังนี้

Report successfully generated to the directory <allure-report>. Use `allure report open` command to show the report.

นั่นคือจะทำการสร้าง folder ชื่อว่า allure-report ขึ้นมา
จากนั้นทำการเปิดดู report สวย ๆ ด้วยคำสั่ง

$allure report open

จะทำการ start web server ขึ้นมา
และเปิด report สวย ๆ ผ่าน browser ดังรูป

ตัวอย่างของหน้าแรกแสดงผลการทดสอบครั้งต่าง ๆ ไว้ให้

และมีกราฟงาม ๆ ให้ดูแบบผลการทดสอบ

เพียงเท่านี้ก็จะได้ report สวย ๆ ไว้ใช้งานแล้ว
ขอให้สนุกกับการเขียน automation test ด้วย Robot Framework นะครับ

ปล. จากการใช้งานยังพบ bug ในหลาย ๆ จุดอยู่นะ !!