我正在尝试使用selenium发送由框架生成的倾城报告的电子邮件。 我已阅读文档但无法找到有关如何发送电子邮件的任何答案。 任何人都可以指出我正确的方向。
谢谢, Sudheer
答案 0 :(得分:2)
如果您只需要发送报告摘要 - 目前还不可能。 Here您可以找到此功能的票证。
答案 1 :(得分:2)
使用Allure Docker Service容器,您可以获取可通过电子邮件发送的报告。 https://github.com/fescobar/allure-docker-service#customize-emailable-report
答案 2 :(得分:1)
我知道这个问题很老了。我发现了使用第三方和Amazon AWS S3存储桶托管魅力的一些答案。从安全角度来看,第一个不好,第二个涉及金钱。因此,让我们看一下下面的免费版本。希望这可以为遇到相同问题的人们提供帮助。
下面的步骤已经详细说明,并且可以百分百地工作。
open_report_windows.bat 的代码:
SET PARENTDIR=%cd%
cd %PARENTDIR%\allure-2.13.5\bin
allure.bat open %PARENTDIR%
open_report_mac.sh 的代码:
parent_dir=$(pwd)
cd $parent_dir/allure-2.13.5/bin
allure open $parent_dir
对于那些不知道如何以编程方式生成诱惑报告的人,下面是我的代码。 重要说明:您需要在Mac上安装诱人设备,以下代码才能正常工作。
public static void generateAllureReport() {
String pattern = "dd-MM-yyyy_HH:mm:ss";
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);
String reportfolder = "allure-report_" + simpleDateFormat.format(new Date());
executeShellCmd("allure generate allure-results");
executeShellCmd("mv allure-report " + reportfolder);
executeShellCmd("cp -R src/main/resources/config/allure-2.13.5 "+reportfolder);
executeShellCmd("cp src/main/resources/config/open_report_mac.sh "+reportfolder);
executeShellCmd("cp src/main/resources/config/open_report_windows.bat "+reportfolder);
}
public static void executeShellCmd(String shellCmd) {
try {
Process process = Runtime.getRuntime().exec(shellCmd);
process.waitFor();
} catch (Exception e) {
e.printStackTrace();
System.out.println("Error in Executing the command " + shellCmd);
}
}
答案 3 :(得分:0)
Allure生成一组文件,应该通过Web服务器查看。这是由于浏览器限制从磁盘读取文件。这是正确查看倾城报告所必需的。
所以在我看来,你应该在网络服务器上发布Allure的结果,并将电子邮件发送到报告的链接。作为旁注,发送带有嵌入式JavaScript的多兆字节电子邮件附件很少是一种好方法。