Open mattsheppard opened 8 years ago
Is it the same behavior that #952?
No, I don't think it's the same issue from my reading - That one seems to be about the order of methods within the class correct, where as in this case the dependsOnGroups seems not to apply.
At a guess, I think it's not applying because the related @Test methods are on the superclass, not the same class which has the dependsOnGroups on the class, however that seems unexpected/undesirable unless I'm missing something.
Attached is a maven project with test cases which should occur in a specific order, which I think reveals incorrect behavior in terms of TestNG ordering.
To reproduce, unpack the attached zip and run the following
When I do this, I see the methods in the class called Concrete (or inherited into it) called before those in the Precondition class (which I've arranged to make the test fail), even though Concrete has a dependsOnGroups annotation which should force Precondition run first.
FYI, this is an attempt to simplify down a situation I saw in a much larger test set. It may be that further simplification is possible (e.g. the DataProvider used in Precondition may be unnecessary, but reflects the original structure I saw).
On the other hand, perhaps this scenario is not expected to work. I couldn't find any detailed documentation on how class level annotations are expected to apply when @Test annotations on methods are inherited from a super-class, but if such documentation does exist and explains the behavior
I'm seeing, I'd appreciate a pointer.
testng-order-test.zip