Skip to content

Commit 3a85ffc

Browse files
authored
fix(@angular/cli): don't rerun protractor on rebuild (#4661)
1 parent d22e9ae commit 3a85ffc

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

packages/@angular/cli/commands/e2e.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,19 @@ const E2eCommand = Command.extend({
5656
});
5757

5858
// Protractor will end the proccess, so we don't need to kill the dev server
59-
return serve.run(commandOptions, () => e2eTask.run(commandOptions));
59+
return new Promise((resolve, reject) => {
60+
let firstRebuild = true;
61+
function rebuildCb() {
62+
// don't run re-run tests on subsequent rebuilds
63+
if (firstRebuild) {
64+
firstRebuild = false;
65+
return resolve(e2eTask.run(commandOptions));
66+
}
67+
}
68+
69+
serve.run(commandOptions, rebuildCb)
70+
.catch(reject);
71+
});
6072
} else {
6173
return e2eTask.run(commandOptions);
6274
}

tests/e2e/tests/misc/minimal-config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default function () {
1515
}],
1616
e2e: { protractor: { config: './protractor.conf.js' } }
1717
})))
18-
.then(() => ng('e2e'))
18+
.then(() => ng('e2e', '--no-progress'))
1919
.then(() => writeMultipleFiles({
2020
'./src/script.js': `
2121
document.querySelector('app-root').innerHTML = '<h1>app works!</h1>';
@@ -40,5 +40,5 @@ export default function () {
4040
e2e: { protractor: { config: './protractor.conf.js' } }
4141
}),
4242
}))
43-
.then(() => ng('e2e'));
43+
.then(() => ng('e2e', '--no-progress'));
4444
}

0 commit comments

Comments
 (0)