0

I have 2 calasses, every class has 2 tests: Class A, Test 1 (priotity 1), test 2 (priority 2) Class B, Test 1 (priotity 1), test 2 (priority 2)

when i execute my tests the order is: A1 B1 A2 B2

i need it to run like this: A1 A2 B1 B2

here is a thread with a similar issue, but this does't work for me. I added group-by-instances="true" but it does't work.

enter link description here

Dotan Raz
  • 453
  • 9
  • 24
  • First of all why do you need priorities in your tests? Do you actually need to split tests into 2 classes? Have you considered using dependsOn, like dependsOnMethods or dependsOnGroups? – Mikhail May 22 '17 at 23:55
  • I cannot place 1000 tests inside a single class... The way i do it is 3 to 20 test methods on every class. Dependsonmethods can work, but not what im looking for – Dotan Raz May 23 '17 at 05:12
  • Here is the solution, [solution](https://stackoverflow.com/questions/42437975/run-test-based-on-defined-priority-with-multiple-classes-through-test-xml-file) – Nadia Zaman Jan 08 '19 at 07:34

1 Answers1

1

Just use dependsOnMethods instead of priority which is global for all the suite.

juherr
  • 5,640
  • 1
  • 21
  • 63
  • Ok, decided to use dependsOnMethods and it actually works as i need. Thanks – Dotan Raz May 23 '17 at 07:43
  • Update- dependaOnMethod is problematic. If the method before fails then the one after will fail due to error related to missing dependOnMethod.. so for now the only solution I have is to use method names according the abc. E.g A_method, B_method... – Dotan Raz May 31 '17 at 13:07
  • If the method before fails, the next ones are supposed to be skipped and not failed. And I don't understand your remark about missing "dependOnMethod". – juherr Jun 01 '17 at 06:52