Skip to content

Commit 6c9e388

Browse files
alan-agius4dgp1130
authored andcommitted
test: move chrome driver path login inside the protractor config check
The chrome driver path is only needed when protractor config is available.
1 parent 365295c commit 6c9e388

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

tests/legacy-cli/e2e/tests/misc/cli-exit-interop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default async function () {
1818
await setRegistry(false);
1919
await createProjectFromAsset('13.0-project', true);
2020

21-
// A missing stylesheet error will trigger the stuck process issue with v12 when building
21+
// A missing stylesheet error will trigger the stuck process issue with v13 when building
2222
await moveFile('src/styles.css', 'src/styles.scss');
2323
await expectToFail(() => noSilentNg('build'));
2424

tests/legacy-cli/e2e/utils/project.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,17 +177,18 @@ export async function useCIChrome(projectDir: string = ''): Promise<void> {
177177
const karmaConf = path.join(projectDir, 'karma.conf.js');
178178

179179
const chromePath = require('puppeteer').executablePath();
180-
const protractorPath = require.resolve('protractor');
181-
const webdriverUpdatePath = require.resolve('webdriver-manager/selenium/update-config.json', {
182-
paths: [protractorPath],
183-
});
184-
const webdriverUpdate = JSON.parse(await readFile(webdriverUpdatePath)) as {
185-
chrome: { last: string };
186-
};
187-
const chromeDriverPath = webdriverUpdate.chrome.last;
188180

189181
// Use Puppeteer in protractor if a config is found on the project.
190182
if (fs.existsSync(protractorConf)) {
183+
const protractorPath = require.resolve('protractor');
184+
const webdriverUpdatePath = require.resolve('webdriver-manager/selenium/update-config.json', {
185+
paths: [protractorPath],
186+
});
187+
const webdriverUpdate = JSON.parse(await readFile(webdriverUpdatePath)) as {
188+
chrome: { last: string };
189+
};
190+
const chromeDriverPath = webdriverUpdate.chrome.last;
191+
191192
await replaceInFile(
192193
protractorConf,
193194
`browserName: 'chrome'`,

0 commit comments

Comments
 (0)