mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
This commit does three things that all related and required to get rid of `webdriver-manager`: * Our puppeteer protractor setup in AIO relies on webdriver-manager because we install a corresponding chromedriver based on the puppeteer chromium version. We would like to get rid of this brittle setup. * We don't use `puppeteer` in many places because we manage chromium and the driver through Bazel. This commit removes the remaining puppeteer usage and replaces it with the Bazel-managed canonical browser * We need to migrate the AIO production URL tests to Bazel. These weren't part of Aspect's migration. This is needed so that we can drop puppeteer and use the Bazel browser setup. * Migrates some at-runtime TS `ts-node` test setup to proper idiomatic Bazel code. Needed because it depends on code that also had to be migrated to Bazel given the production e2e test Bazel migration (above points). Note: The xregexp dependency had to be added to the root project because `ts_library` does not support compilation deps from `@aio_npm`. This is something we will fix anyway when we have a more modern toolchain! PR Close #49025
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
|
|
module.exports = async function () {
|
|
const targetUrl = process.env.TARGET_URL;
|
|
if (!targetUrl) {
|
|
throw new Error('No target URL via `TARGET_URL` environment variable set.');
|
|
}
|
|
|
|
protractor.browser.baseUrl = targetUrl;
|
|
|
|
const {loadLegacyUrls, loadRemoteSitemapUrls} = await import('../shared/helpers.mjs');
|
|
const [sitemapUrls, legacyUrls] = await Promise.all([
|
|
loadRemoteSitemapUrls(browser.baseUrl),
|
|
loadLegacyUrls(),
|
|
]);
|
|
|
|
console.info('Determined testing URLs', {sitemapUrls, legacyUrls});
|
|
|
|
if (sitemapUrls.length <= 100) {
|
|
throw new Error(`Too few sitemap URLs. (Expected: >100 | Found: ${sitemapUrls.length})`);
|
|
} else if (legacyUrls.length <= 100) {
|
|
throw new Error(`Too few legacy URLs. (Expected: >100 | Found: ${legacyUrls.length})`);
|
|
}
|
|
|
|
protractor.browser.params = {
|
|
sitemapUrls: sitemapUrls,
|
|
legacyUrls: legacyUrls,
|
|
};
|
|
};
|