Organizing test suites with Protractor

What is a test suite?

A test suite is a collection of test cases or specs designed to test a program for checking a particular behavior.

Test suites are usually divided according to system functionalities or the type of test performed.

Suites grouped by functionality:

Suites grouped by type of test:

Advantages of working with test suites

  • Organization: Create test suites allows the semantic and logical grouping of tests, improving their maintainability. The tests should be easy to maintain, otherwise they will become obsolete very fast.
  • Continuous integration: When you define the test suites in the configuration file, it is possible to run the test suite through the command line. In this way, the tests can be run periodically or whenever a deploy is performed, for example.

For a configuration file where the suites have been defined according to the image below, we can:

  • Run only the smoke test suite:

$ protractor protractor.conf.js --suite smoke

  • Run the smoke test and performance test suites:

$ protractor protractor.conf.js --suite smoke, performance