3

Can anyone help me out how to run spec in order, because the application which i am working has many specs and when i use command

'specs': '*.js',

all specs are executed but not in the order which i have written them, i don't want to special all my specs name in single spec like for example

'specs' : [ 'test1.js','test2.js',.... ]

because i have lots of specs. Can anyone help me with how to run specs in order? i want

test1.js to be executed 1st, test2.js to be executed 2nd and so on

Suhail Ahmed
  • 504
  • 1
  • 9
  • 19

1 Answers1

2

That's what suites are for, to organize your tests. It's a parameter in your config file, i.e.

suites : {
    login: 'tests/login/*.spec.js,
}

You can also specify this as an array:

suites : {
    mySuite: [
        'test1.spec.js',
        'test2.spec.js'
    ]
}

These will execute in the order you specify here. Here's a good answer describing the purpose of suites: Suites vs Specs Protractor

Community
  • 1
  • 1
Gunderson
  • 3,263
  • 2
  • 16
  • 34