带有屏幕截图的TestNG IR报告我们可以使用java selenium发送邮件吗?

问题描述 投票:0回答:1

请有人帮助我。带有屏幕截图的TestNG IR报告我们可以使用java selenium发送邮件吗?

现在我只能发送截图我怎么能在邮件中附上测试NG报告。建议请

java selenium testng
1个回答
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>[email protected]</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>[email protected]</receiver>
                                </receivers>
                                <fileSets>
                                        <fileSet>
                                                <directory>${basedir}/src/main</directory>
                                                <includes>
                                                        <include>**/*.pdf</include>
                                                </includes>
                                        </fileSet>
                                </fileSets>
                        </configuration>
                </execution>
        </executions>
</plugin>
© www.soinside.com 2019 - 2024. All rights reserved.