Skip to content

Commit

Permalink
fix(@angular/cli): don't rerun protractor on rebuild (#4661)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipesilva authored Feb 13, 2017
1 parent d22e9ae commit 3a85ffc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 13 additions & 1 deletion packages/@angular/cli/commands/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/tests/misc/minimal-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '<h1>app works!</h1>';
Expand All @@ -40,5 +40,5 @@ export default function () {
e2e: { protractor: { config: './protractor.conf.js' } }
}),
}))
.then(() => ng('e2e'));
.then(() => ng('e2e', '--no-progress'));
}

0 comments on commit 3a85ffc

Please sign in to comment.