Home > Net >  TestNG is only running first test on each class
TestNG is only running first test on each class

Time:08-27

I'm currently working on Intellij with Appium (7.3.0), Java (1.8) and TestNG (6.14.3), it was working fine on Friday and now it is only running the first test on each class like enter image description here

I have two listeners before and after each method, I've tried debugging and the OnTestSuccess of the first one and it completes normally, and the OnTestStart of the next one does not even start and jumps to the next class.

This only happens when I try to run an XML with more than 1 class, (it runs normally with XML files with one class)

Other thing I have noticed is that when it was working normally, the console showed a list of the tests (that could not be found by regex) and now is not showing.

I appreciate your help, thanks in advance.

Update: Apparently the problem is that the tests now run in different order, they used to run in order

  • Class 1
    • Test A (priority 1)
    • Test B (priority 2)
  • Class 2
    • Test C (priority 1)
    • Test D (priority 2)

But now they run

  • Class 1
    • Test A (priority 1)
  • Class 2
    • Test C (priority 1)
  • Class 1
    • Test B (priority 2)
  • Class 2
    • Test D (priority 2)

How can I make it run like before? Thanks in advance

CodePudding user response:

Probably not a fix, but I managed to solve this behavior on TestNG version 6.9.10 where priority was bugged leading to run one class after the other one

  • Related