'Protractor - Shard By Suite

It looks like Protractor currently allows you to shard by file. Is there way to split it up by suite, if there are files within each suite that are order dependent (each suite being independent)?



Solution 1:[1]

This functionality might be achievable by setting multiple capabilities each with their own specs property containing only scripts from a particular suite.

Each capability would not be sharded so all tests in each capability would run in sequence but each capability would run parallel.

maxSessions:5 allows 5 capabilities to run at the same time

  maxSessions: 5,
  multiCapabilities: [
    {
      browserName: 'chrome',
      maxInstances: 1,
      specs: [
        '../suite1/test1.js',
        '../suite1/test2.js',
        '...',
      ],
    },
    {
      browserName: 'chrome',
      maxInstances: 1,
      specs: [
        '../suite2/test1.js',
        '../suite2/test2.js',
        '...,'
      ],
    },
  ]

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 DublinDev