When I am running the tesng.xml
file by running it by right clicking on it ,the emailable-report.html
file is showing as per the latest test result ,but While running it from terminal by "mvn test
" test results are coming as per expected but emailable-report.html
file is updated as per the current result .
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
That's because your report is probably generated in target folder when you run it with maven and in test-output when running it via testng.xml directly. So you are probably expecting it to be in different place and you are opening wrong report, while your latest report is in target folder.
回答2:
I had the same problem, but the folder was ok. The problem is that the emailable-report.html generation occurs after all the execution, including the annotations @After.... What I did is using Reporter.getCurrentTestResult(); in @AfterTest before performing the email send action to have the file updated at the right time.