我如何将文件附加到测试中。例如,我想添加kml文件(一种XML表示法,用于在二维地图和三维Earth浏览器中表达地理注释和可视化)。有什么主意吗?
使用allure.attach
,您可以将html内容添加到所进行的任何测试中。
def test_multiple_attachments():
allure.attach.file('./data/totally_open_source_kitten.png', attachment_type=allure.attachment_type.PNG)
allure.attach('<head></head><body> a page </body>', 'Attach with HTML type', allure.attachment_type.HTML)
<script>
var map;
var src = 'https://developers.google.com/maps/documentation/javascript/examples/kml/westcampus.kml';
[Here您有一个教程如何在HTML文件中显示* .kml内容。