From fd58c896cc571d302e939400483c5c646155eed6 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Mon, 9 Feb 2026 14:07:07 -0500 Subject: [PATCH] test: execute 'protractor' binary directly in 'browsers' E2E test The 'browsers' E2E test now executes the 'protractor' binary directly from 'node_modules' instead of using the 'protractor' Angular CLI builder. This further reduces the test's dependency on legacy CLI infrastructure and removes the need to manually configure an 'e2e' architect target in 'angular.json'. --- tests/e2e/tests/misc/browsers.ts | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/tests/e2e/tests/misc/browsers.ts b/tests/e2e/tests/misc/browsers.ts index b6c6a842f9c2..1212013a2c99 100644 --- a/tests/e2e/tests/misc/browsers.ts +++ b/tests/e2e/tests/misc/browsers.ts @@ -2,9 +2,8 @@ import express from 'express'; import * as path from 'node:path'; import { copyProjectAsset } from '../../utils/assets'; import { appendToFile, createDir, replaceInFile, writeFile } from '../../utils/fs'; -import { ng } from '../../utils/process'; +import { exec, ng } from '../../utils/process'; import { installPackage } from '../../utils/packages'; -import { updateJsonFile } from '../../utils/project'; /** * The list of development dependencies used by the E2E protractor-based builder. @@ -26,17 +25,6 @@ export default async function () { await installPackage(e2eDep); } - // Setup `protractor` builder. - await updateJsonFile('angular.json', (config) => { - config.projects['test-project'].architect['e2e'] = { - builder: '@angular-devkit/build-angular:protractor', - options: { - devServerTarget: '', - protractorConfig: 'e2e/protractor-saucelabs.conf.js', - }, - }; - }); - await appendToFile( 'src/app/app.config.ts', "import { provideProtractorTestingSupport } from '@angular/platform-browser';\n", @@ -97,13 +85,8 @@ describe('workspace-project App', () => { try { // Execute application's E2E tests with SauceLabs - await ng( - 'e2e', - 'test-project', - '--no-webdriver-update', - '--protractor-config=e2e/protractor-saucelabs.conf.js', - '--dev-server-target=', - ); + const binPath = path.join('node_modules', '.bin', 'protractor'); + await exec(binPath, 'e2e/protractor-saucelabs.conf.js'); } finally { server.close(); }