Skip to content

Fix Chromium version - #2

Merged
sadym-chromium merged 9 commits into
GoogleChromeLabs:mainfrom
sadym-chromium:sadym/install-chrome
Dec 2, 2025
Merged

sadym-chromium merged 9 commits into
GoogleChromeLabs:mainfrom
sadym-chromium:sadym/install-chrome

Conversation

@sadym-chromium

Copy link
Copy Markdown
Collaborator

Instead of relying on local setup, use the consistent browser version. This helps for repro issues in the specific chrome versions.

Comment thread macos-selenium-mochajs/test.js Outdated
let driver;

before(async function() {
const buildId = fs.readFileSync('.browser', 'utf8').trim();

@alexnj alexnj Dec 1, 2025

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make this optional — by default it would download the latest, so that we don't have to keep the templates updated as newer Chromes release, but have the option available who wants specific version to reproduce an issue?

I'm thinking of moving version out of .browser and into here with a getSpecificChromeVersion(version: string): string function within the template, and having that line commented by default, or something like that? WDYT?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. Added respect for env variable BROWSER_VERSION and documented it.

Comment thread macos-selenium-mochajs/test.js Outdated
@@ -17,17 +17,40 @@
const { Builder, By, until } = require('selenium-webdriver');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really cool, and thanks for the corrections! We'll need to update the other non-js templates as well.

@sadym-chromium
sadym-chromium requested a review from alexnj December 2, 2025 11:15
@sadym-chromium

Copy link
Copy Markdown
Collaborator Author

@alexnj I assume I addressed your issues and merging this PR to unblock myself. I can address any other concerns in a follow-up PR.

@sadym-chromium
sadym-chromium merged commit 37ead3b into GoogleChromeLabs:main Dec 2, 2025
2 checks passed

@alexnj alexnj left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some more feedback.

run: npm test

- name: Dump log
- name: Dump latest ChromeDriver log

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to keep non-latest logs?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be reverted, as failed chrome logging picks up the last known good log -- which is confusing.

@@ -1,28 +1,99 @@
# Template for macOS, Selenium, MochaJS
# Template for Selenium, MochaJS

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This template uses the latest macOS.

BROWSER_VERSION=144.0.7557.0 npm test
```

If `BROWSER_VERSION` is not provided, the script automatically resolves and downloads

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably need to mention where one needs to provide BROWSER_VERSION, preferably in a way that works across all templates. Perhaps this can be a variable in the test script itself.


Verbose logging for ChromeDriver is enabled by default. Logs are captured and saved
to individual files within the **`logs/`** directory, with each filename timestamped
(e.g., `logs/chromedriver-2025-12-02T10:00:00.000Z.log`). This ensures that logs are

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't log of each run be preserved by the CI file system itself, for each run?

before(async function () {
// The chrome and chromedriver installation can take some time. Give 5
// minutes to install everything.
this.timeout(5 * 60 * 1000);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this specific to non-standard/non-Canary builds?

detectBrowserPlatform,
ChromeReleaseChannel,
} = require('@puppeteer/browsers');
const winston = require('winston');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this dependency?

* environment variable like `BROWSER_VERSION=142.0.7444.175`
*/
const BROWSER_VERSION =
process.env['BROWSER_VERSION'] ??

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I was hoping we could keep the test script rather simple, so it's not confusing for an end user to know what to modify. Perhaps we should move these boilerplate to a separate file and just include, so that the test script itself is short (and sweet?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants