-
Notifications
You must be signed in to change notification settings - Fork 2
Fix Chromium version #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
dec3b57
c481a05
ab693bc
3e02162
39a25c1
9c0b7ec
b0790ed
d4cf619
f9e962b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,4 @@ | ||
| node_modules | ||
| node_modules/ | ||
| .cache/ | ||
| .idea/ | ||
| logs/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "printWidth": 80, | ||
| "singleQuote": true | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,99 @@ | ||
| # Template for macOS, Selenium, MochaJS | ||
| # Template for Selenium, MochaJS | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This template uses the latest macOS. |
||
|
|
||
| This repository provides a template for reproducing any ChromeDriver bug. | ||
| This repository serves as a boilerplate for reproducing ChromeDriver regressions | ||
| across platforms using Selenium WebDriver and MochaJS. | ||
|
|
||
| ## Steps to Reproduce | ||
| Its primary purpose is to provide a standardized, isolated environment where you can | ||
| quickly set up and verify a specific ChromeDriver bug, making it easier to share and | ||
| debug. | ||
|
|
||
| The test in `test/regression.js` follows these steps: | ||
| ## Your Goal | ||
|
|
||
| 1. Initializes a new Chrome browser session. | ||
| 2. Navigates to a URL. | ||
| 3. Asserts that the page title is correct. | ||
| To use this template, you are expected to extend the `ISSUE REPRODUCTION` test case | ||
| in `test.js` with the precise steps that demonstrate the ChromeDriver regression you | ||
| are investigating. The aim is to create a reproducible test case that reliably fails | ||
| when the bug is present and passes when it's resolved. | ||
|
|
||
| This sequence of actions fails with ChromeDriver 126, but works with 125. | ||
| ## Overview | ||
|
|
||
| The test script (`test.js`) performs the following actions: | ||
|
|
||
| 1. **Environment Setup**: Automatically downloads a specific version of Chrome | ||
| (Canary by default) and the matching ChromeDriver binary into a local `.cache` | ||
| directory using `@puppeteer/browsers`. | ||
| 2. **WebDriver Initialization**: Configures Selenium to use the downloaded binaries | ||
| explicitly, ensuring version compatibility. | ||
| 3. **Test Execution**: | ||
| - Navigates to `https://www.google.com` to verify the setup. | ||
| - Includes a placeholder test case (`ISSUE REPRODUCTION`) where you can add your | ||
| specific reproduction steps. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Node.js installed. | ||
|
|
||
| ## Installation | ||
|
|
||
| Install the necessary dependencies: | ||
|
|
||
| ```bash | ||
| npm install | ||
| ``` | ||
|
|
||
| ## Running the Tests | ||
|
|
||
| 1. Install dependencies: | ||
| ```bash | ||
| npm install | ||
| ``` | ||
| 2. Run the tests: | ||
| ```bash | ||
| npm test | ||
| ``` | ||
| To run the tests with the default configuration (latest Chrome Canary): | ||
|
|
||
| ```bash | ||
| npm test | ||
| ``` | ||
|
|
||
| ### Targeting a Specific Chrome Version | ||
|
|
||
| You can specify a particular version of Chrome/ChromeDriver using the | ||
| `BROWSER_VERSION` environment variable. This is useful for testing against a specific | ||
| build or regression testing. | ||
|
|
||
| ```bash | ||
| # Example: Targeting a specific build ID | ||
| BROWSER_VERSION=144.0.7557.0 npm test | ||
| ``` | ||
|
|
||
| If `BROWSER_VERSION` is not provided, the script automatically resolves and downloads | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably need to mention where one needs to provide |
||
| the latest build from the Chrome Canary channel. | ||
|
|
||
| ## Logging and Debugging | ||
|
|
||
| ### Test Output Logs | ||
|
|
||
| The test runner uses `winston` for logging info about the setup process (e.g., binary | ||
| locations). You can control the verbosity using the `LOG_LEVEL` environment variable. | ||
|
|
||
| - **Standard Output:** `npm test` | ||
| - **Debug Output:** `LOG_LEVEL=debug npm test` | ||
|
|
||
| ### ChromeDriver Logs | ||
|
|
||
| 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 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
||
| preserved across multiple test runs and are crucial for debugging WebDriver issues. | ||
|
|
||
| ## Customizing the Test | ||
|
|
||
| Open `test.js` and modify the `ISSUE REPRODUCTION` test block to include the steps | ||
| required to reproduce your specific issue. | ||
|
|
||
| ```javascript | ||
| it('ISSUE REPRODUCTION', async function () { | ||
| // Add test reproducing the issue here. | ||
| await driver.get('https://example.com'); | ||
| // ... assertions and interactions | ||
| }); | ||
| ``` | ||
|
|
||
| ## GitHub Actions | ||
|
|
||
| The included GitHub Actions workflow in `.github/workflows/macos-selenium-mochajs.yml` will automatically run the tests on every push and pull request. | ||
| The included GitHub Actions workflow in | ||
| `.github/workflows/macos-selenium-mochajs.yml` will automatically run the tests on | ||
| every push and pull request. | ||
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.