1

I have a listener class which is implementing ITestListener in which am initializing few variables to get the total test results pass/failed skipped etc. as follows:

int testPassed = context.getPassedTests().getAllResults().size();

int testFailed = context.getFailedTests().getAllResults().size();

int testSkipped = context.getSkippedTests().getAllResults().size();

int totalTests = testPassed + testFailed + testSkipped;

I want to use these variables in my pom.xml and then use those variables in turn to write a customized text file which we will be sending in the email body.

Is there any way out to do such thing ? Or we have to only write in a file using JAVA itself.

Ahmed Ashour
  • 5,179
  • 10
  • 35
  • 56
Andy
  • 21
  • 2

1 Answers1

0

See:

or:

  • write your variables to a .properties file and

  • use the properties-maven-plugin:

    The plugin reads property and xml files and declaring them as maven project properties

Community
  • 1
  • 1
Gerold Broser
  • 14,080
  • 5
  • 48
  • 107