How to force the spec execution in specified order?

Spec Hierarchy as below.

  1. modules
  2. pages
  3. spec
    3a) PackageB -> TC001
    3b) PackageA -> TC001

i need to run the specs in below order
gradlew test --tests “PackageB -> TC001” --tests “PackageA -> TC001”

but always running in

“PackageA -> TC001” - as first
"PackageB -> TC001" - as second

To guarantee test execution order, you would need to define separate Test tasks that filter just the specs that you want for each one. The order that the tasks run can be controlled, but not the execution order of --tests provided at the command line.