Suites vs Specs Protractor
Asked Answered
A

1

8

I have recently picked up a project using Protractor.

I am having troubles understand the difference between a suite and a specs. I am also having trouble with a suites when I am running a folder of test's after that folder is ran I run another folder of test and it fails all the test. Any help would be great listed below is what or suite looks like.

Example:

suites: {
    CSRSmokeTest: '../smoke/Video/**.js'
    DesktopSmokeTest: '../smoke/deskTop/**.js'
},
Addressee answered 19/5, 2015 at 16:19 Comment(2)
A suite is one or more specs, logically grouped. For instance, if you only want certain tests to run during a Smoke test, you'd put those specs (tests) into a Suite for Smoke Tests.Hodge
i've grouped my specs as config.js file specs:[testcase1.js,testcase2.js,testcase3.js] and each spec is executed one after another is their a more better way to organise my specs and runConrado
C
35

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.

Codd answered 19/5, 2015 at 17:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.