Suites vs Specs Protractor

感情迁移 提交于 2019-11-26 22:47:24

Suites are incredibly useful for organizing your tests.

The question actually goes down to differences between a suite and a test case in general. Quote from the wikipedia "Test suite" definition:

a collection of test cases that are intended to be used to test a software program to show that it has some specified set of behaviours. A test suite often contains detailed instructions or goals for each collection of test cases and information on the system configuration to be used during testing.

In other words, a test suite is a collection of specs/testcases united by a common property, logic. For instance, you may have suites for different types of functionality of your application, homepage, search etc:

suites: {
  homepage: 'tests/e2e/homepage/**/*Spec.js',
  search: [
    'tests/e2e/contact_search/**/*Spec.js',
    'tests/e2e/venue_search/**/*Spec.js'
  ] 
},

And/or, you may have specs grouped into suites by the type of tests:

suites: {
  smoke: 'tests/e2e/smoke/*.js',
  performance: 'tests/e2e/performance/*.js'
},

Or, you may put all of your "regression" tests into a separate suite. Or, you can apply your own logic to group specs.

It is important to note that a single spec can be a part of multiple test suites.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!