I have recently been tasked with incorporating automated testing into my company's development life cycle for one of our products (the product is a web-based software application).
After doing some research into the various automated testing suites available, I decided to use Protractor, as it appears to provide all of the functionality that we will need, and also seems to be well documented & maintained.
I have successfully got Protractor set up and running with our application, and am now starting to design & implement the tests that we will require in order to ensure the functionality & stability of the product.
As things currently stand, all of the tests I have written are in the spec.js
file in a 'testing' folder within the project structure, and I have been using comments to document that file, and keep the tests grouped with other similar tests/ tests for the same 'part' of the software.
Since I am relatively new to automated testing, my question is: what is the best practice for developing an automated test suite that will be run on every release of your software? Is it best to define all of the tests within a single file (i.e. the spec.js
file I'm currently using), or is it better to have separate files for each part of the software you're testing, in order to keep the tests more structured? What are the reasons for/ against either approach? Or is it simply a case of preference?