2

I use Selenium webdriver js for automation testing, also I use Jest to run some test in parralell and my tests have this structure:

tests
 ┣ folder1
 ┃ ┣ suite1
 ┃ ┣ suite2
 ┃ ┣ suite3
 ┃ ┗ suite4
 ┣ folder2
 ┃ ┣ suite1
 ┃ ┣ suite2
 ┃ ┣ suite3
 ┃ ┗ suite4
 ┣ folder3
 ┃ ┣ suite1
 ┃ ┣ suite2
 ┃ ┗ suite3

I want to run in parallel [folder1, folder2, folder3], but all tests from this each should run in sequentially, if I use --runInBand it will run all suites in sequentially, does'n matter if it is from another folder

For example at the same time I want to start

suite1 from test1 + suite1 from test2 + suite1 from test3

If some suite will finished, it will start next suite from the same folder.

Why? Because if I will run it without --runInBand, it will open a chrome window for each test, and imagine how much RAM it will consume

skyboyer
  • 22,209
  • 7
  • 57
  • 64
  • Best practice is to not have tests dependent on each other. Given that, you should just run all tests in parallel and let the runner run them in whatever order is needed to execute efficiently. Why do you need to run them in this specific way? – JeffC Aug 31 '19 at 16:25
  • there is no one dependent test, I want to run it in this way because it will be faster, in my case 1 suite run in 1-2 min – Василий Радяну Aug 31 '19 at 16:27
  • Put all tests into a pool and let the runner run them, that's likely the fastest way. Depending on the runner you use, some have extra intelligence and uses run time, etc. to better balance the runs. – JeffC Aug 31 '19 at 16:29
  • Can you give an example ? – Василий Радяну Aug 31 '19 at 16:45
  • refer https://stackoverflow.com/questions/47291189/is-there-a-way-to-run-some-tests-sequentially-with-jest?rq=1 – kTn Dec 24 '19 at 12:34

0 Answers0