Reputation: 69
I am trying to send an email of the allure report generated by the framework using selenium. I have read the documentation but could not find any answer on how to send email.
Could any one please point me to the correct direction?
Upvotes: 5
Views: 26670
Reputation: 451
Allure now has a command line argument to generate report into a single file
$ allure generate --single-file allure-results
Refer: Link
Upvotes: 2
Reputation: 2072
I've made a tool to build whole allure generate' result folder into a single html file viewable from browser: https://github.com/MihanEntalpo/allure-single-html-file
Upvotes: 2
Reputation: 459
I know this question is pretty old. I found some answers for hosting allure using a third party and amazon aws s3 bucket. The first one is not good from a security standpoint and the second one involves money. So let's look at the below one which is free. Hope this helps people who are struggling with the same issue.
The below steps are detailed and it works a hundred percent.
Code for open_report_windows.bat:
SET PARENTDIR=%cd%
cd %PARENTDIR%\allure-2.13.5\bin
allure.bat open %PARENTDIR%
Code for open_report_mac.sh:
parent_dir=$(pwd)
cd $parent_dir/allure-2.13.5/bin
allure open $parent_dir
For those who doesn't know how to generate allure-repor programmatically below is my code. Important Note: You need to have allure installed on your mac for the below code to work.
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);
}
}
Upvotes: 6
Reputation: 696
With Allure Docker Service container you can get an emailable report. https://github.com/fescobar/allure-docker-service#customize-emailable-report
Upvotes: 2
Reputation: 2743
In case you only need to send the report summary - it is not possible yet. Here you can find the ticket for such feature.
Upvotes: 3
Reputation: 6981
Allure generates a collection of files, that ought to be viewed via a web server. This due to the browsers restrictions on reading files from disk. This is needed to view Allure report correctly.
So in my mind you should post the result of Allure on a web server and the email the link to the report. As a side note, sending multi-megabyte email attachments with embedded JavaScript is rarely a good approach.
Upvotes: 1