Test files are not executing via maven command but able to when manually.
Answered
I am testing a playwright automation where to validate my application, I have written passing dummy test scripts in a file. So, when I manually run the test file via button, it gets executed and showing as passed.
But, when I try to run it via “mvn -Dtest=testAlerts.TestExample test”, it builds successfully but,
[INFO] Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
But it has 2 passing test scripts.
1 comment
Sort by
Date
Votes
Have you tried adding Surefire (for unit tests) and your test framework dependency (e.g., JUnit 5 or TestNG) to pom.xml, and ensuring the test class name matches patterns?
Please sign in to leave a comment.