projects/ngrx.io/tools/examples/run-example-e2e.js
function runE2e() {
  if (argv.setup) {
    // Run setup.
    console.log('runE2e: setup boilerplate');
    const installPackagesCommand = `example-use-${argv.local ? 'local' : 'npm'}`;
    const addBoilerplateCommand = 'boilerplate:add';
    shelljs.exec(`yarn ${installPackagesCommand}`, { cwd: AIO_PATH });
    shelljs.exec(`yarn ${addBoilerplateCommand}`, { cwd: AIO_PATH });
  }

  const outputFile = path.join(AIO_PATH, './protractor-results.txt');

  return Promise.resolve()
    .then(() => findAndRunE2eTests(argv.filter, outputFile, argv.shard))
    .then((status) => {
      reportStatus(status, outputFile);
      if (status.failed.length > 0) {
        return Promise.reject('Some test suites failed');
      }
    }).catch(function (e) {
      console.log(e);
      process.exitCode = 1;
    });
}
function runE2e() {
  if (argv.setup) {
    // Run setup.
    console.log('runE2e: setup boilerplate');
    const installPackagesCommand = `example-use-${argv.local ? 'local' : 'npm'}`;
    const addBoilerplateCommand = 'boilerplate:add';
    shelljs.exec(`yarn ${installPackagesCommand}`, { cwd: AIO_PATH });
    shelljs.exec(`yarn ${addBoilerplateCommand}`, { cwd: AIO_PATH });
  }

  const outputFile = path.join(AIO_PATH, './protractor-results.txt');

  return Promise.resolve()
    .then(() => findAndRunE2eTests(argv.filter, outputFile, argv.shard))
    .then((status) => {
      reportStatus(status, outputFile);
      if (status.failed.length > 0) {
        return Promise.reject('Some test suites failed');
      }
    }).catch(function (e) {
      console.log(e);
      process.exitCode = 1;
    });
}
function runE2e ( ) { if ( argv . setup ) { // Run setup. console . log ( 'runE2e: setup boilerplate' ) ; const installPackagesCommand = ` ${ argv . local ? 'local' : 'npm' } ` ; const addBoilerplateCommand = 'boilerplate:add' ; shelljs . exec ( ` ${ installPackagesCommand } ` , { cwd : AIO_PATH } ) ; shelljs . exec ( ` ${ addBoilerplateCommand } ` , { cwd : AIO_PATH } ) ; } const outputFile = path . join ( AIO_PATH , './protractor-results.txt' ) ; return Promise . resolve ( ) . then ( ( ) => findAndRunE2eTests ( argv . filter , outputFile , argv . shard ) ) . then ( ( status ) => { reportStatus ( status , outputFile ) ; if ( status . failed . length > 0 ) { return Promise . reject ( 'Some test suites failed' ) ; } } ) . catch ( function ( e ) { console . log ( e ) ; process . exitCode = 1 ; } ) ; }
Run Protractor End-to-End Tests for Doc Samples

Flags
--filter to filter/select _example app subdir names
e.g. --filter=foo  // all example apps with 'foo' in their folder names.

--setup run yarn install, copy boilerplate and update webdriver
e.g. --setup

--local to use the locally built Angular packages, rather than versions from npm
Must be used in conjunction with --setup as this is when the packages are copied.
e.g. --setup --local

--shard to shard the specs into groups to allow you to run them in parallel
e.g. --shard=0/2 // the even specs: 0, 2, 4, etc
e.g. --shard=1/2 // the odd specs: 1, 3, 5, etc
e.g. --shard=1/3 // the second of every three specs: 1, 4, 7, etc
Run Protractor End - to - End Tests for Doc Samples