diff --git a/packages/@angular/cli/commands/e2e.ts b/packages/@angular/cli/commands/e2e.ts index 094374b3568d..e9bd5fef43be 100644 --- a/packages/@angular/cli/commands/e2e.ts +++ b/packages/@angular/cli/commands/e2e.ts @@ -56,7 +56,19 @@ const E2eCommand = Command.extend({ }); // Protractor will end the proccess, so we don't need to kill the dev server - return serve.run(commandOptions, () => e2eTask.run(commandOptions)); + return new Promise((resolve, reject) => { + let firstRebuild = true; + function rebuildCb() { + // don't run re-run tests on subsequent rebuilds + if (firstRebuild) { + firstRebuild = false; + return resolve(e2eTask.run(commandOptions)); + } + } + + serve.run(commandOptions, rebuildCb) + .catch(reject); + }); } else { return e2eTask.run(commandOptions); } diff --git a/tests/e2e/tests/misc/minimal-config.ts b/tests/e2e/tests/misc/minimal-config.ts index 5e94c7545619..420cbf48b94f 100644 --- a/tests/e2e/tests/misc/minimal-config.ts +++ b/tests/e2e/tests/misc/minimal-config.ts @@ -15,7 +15,7 @@ export default function () { }], e2e: { protractor: { config: './protractor.conf.js' } } }))) - .then(() => ng('e2e')) + .then(() => ng('e2e', '--no-progress')) .then(() => writeMultipleFiles({ './src/script.js': ` document.querySelector('app-root').innerHTML = '

app works!

'; @@ -40,5 +40,5 @@ export default function () { e2e: { protractor: { config: './protractor.conf.js' } } }), })) - .then(() => ng('e2e')); + .then(() => ng('e2e', '--no-progress')); }