Skip to content

Commit 3f10c5a

Browse files
sumitaroraBrocco
authored andcommitted
fix(@angular/cli): allow e2e tests to run if no-serve and port is provided
1 parent 169dc9e commit 3f10c5a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

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

+6
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ export const E2eTask = Task.extend({
3434
});
3535
} else if (e2eTaskOptions.baseHref) {
3636
additionalProtractorConfig.baseUrl = e2eTaskOptions.baseHref;
37+
} else if (e2eTaskOptions.port) {
38+
additionalProtractorConfig.baseUrl = url.format({
39+
protocol: e2eTaskOptions.ssl ? 'https' : 'http',
40+
hostname: e2eTaskOptions.host,
41+
port: e2eTaskOptions.port.toString()
42+
});
3743
}
3844

3945
if (e2eTaskOptions.specs.length !== 0) {

tests/e2e/tests/test/e2e-baseurl.ts

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default function () {
1313
.then(() => ngServe())
1414
.then(() => expectToFail(() => ng('e2e', '--no-serve')))
1515
.then(() => ng('e2e', '--no-serve', '--base-href=http://localhost:4400'))
16+
.then(() => ng('e2e', '--no-serve', '--port=4400'))
1617
.then(() => killAllProcesses(), (err: any) => {
1718
killAllProcesses();
1819
throw err;

0 commit comments

Comments
 (0)