请有人帮我。 我们可以使用java selenium发送带截图的TestNG IR报告和屏幕截图吗?
现在暂时无法仅发送屏幕截图,我该如何在邮件中附加Test NG报告。 请提出建议
答案 0 :(得分:0)
Maven发送邮件目标允许您在构建期间发送邮件,也可以添加附件(可选)。您可以将以下目标添加到您的pom.xml中。在include标签中,您必须提供必须发送文件的相对路径。
<plugin>
<groupId>ch.fortysix</groupId>
<artifactId>maven-postman-plugin</artifactId>
<executions>
<execution>
<id>send a mail</id>
<phase>package</phase>
<goals>
<goal>send-mail</goal>
</goals>
<inherited>false</inherited>
<configuration>
<from>builder@myhost.com</from>
<subject>a subject</subject>
<failonerror>true</failonerror>
<mailhost>mail.dummy.ch</mailhost>
<mailuser>XXXXX</mailuser>
<mailpassword>XXXXX</mailpassword>
<htmlMessageFile>src/main/MailContent.html</htmlMessageFile>
<receivers>
<receiver>dani</receiver>
<receiver>sam@any-company.com</receiver>
</receivers>
<fileSets>
<fileSet>
<directory>${basedir}/src/main</directory>
<includes>
<include>**/*.pdf</include>
</includes>
</fileSet>
</fileSets>
</configuration>
</execution>
</executions>
</plugin>