diff --git a/packages/angular_devkit/build_angular/src/protractor/index.ts b/packages/angular_devkit/build_angular/src/protractor/index.ts index 3899946c4ab8..2ae7bda8bec7 100644 --- a/packages/angular_devkit/build_angular/src/protractor/index.ts +++ b/packages/angular_devkit/build_angular/src/protractor/index.ts @@ -139,6 +139,12 @@ async function execute( } } + // Like the baseUrl in protractor config file when using the API we need to add + // a trailing slash when provide to the baseUrl. + if (baseUrl && !baseUrl.endsWith('/')) { + baseUrl += '/'; + } + try { return await runProtractor(context.workspaceRoot, { ...options, baseUrl }); } catch {