4

I have my protractor scripts running. But on my current scenario, to run the tests it is needed to run each .js individually. I want to pack all the test files into one or pack all the test files into an executable (what it would be ideal because it won't be needed to have protractor installed on all the machines running the tests.

I appreciate any suggestions.

  • Why is it needed to run each individually ? – Michael Durrant Mar 25 at 9:29
  • Please add how you start your protractor server, do you do protractor conf.js and leave it running while running tests via another window/session ? – Michael Durrant Mar 25 at 11:00
0

You can adjust config to run all your tests:

For instance if you have todo-spec.js and todo-new-spec.js you can run both of them with:

exports.config = { 
  seleniumAddress: 'http://localhost:4444/wd/hub',
  specs: ['*-spec.js']
};

As for running protractor without having protractor, not sure about that.

Example that I tried to show this:

enter image description here

|improve this answer|||||
  • I put specs:['*spec.js'], as you suggested and then I got: W/configParser - pattern *spec.js did not match any files. Is this syntax correct? – Ingridd Brito Mar 25 at 9:46
  • 1
    Ah directory tests. Maybe ['./tests/*spec.js'] would work – Michael Durrant Mar 25 at 11:23
  • 1
    @IngriddBrito is your spec files under the same directory as config file , else you have to provide full path or /**/*js – PDHide Mar 25 at 11:24
  • 1
    Look to use blahblah.test.js or blahblah.spec.js for your filenames and then you'll be able to wildcard them appropriately. I suggest using originalFileName.test.js and keeping it in the same directory. This is a personal recommendation. i like to see the test right next to the code. Another directory starts to push it apart. Others will disagree with this. – Michael Durrant Mar 25 at 11:25
  • 1
    +1 to PDHide for the ** option. More at stackoverflow.com/a/28199633/631619 – Michael Durrant Mar 25 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.