Skip to content
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

feat: add install-chromedriver command #366

Merged
merged 20 commits into from
Oct 23, 2024
Merged

Conversation

KazuCocoa
Copy link
Member

Let's add the same automatic download (latest one) which is removed from appium-chromedriver.

This command will give the below log's ability.

kazu $ appium driver run chromium install-chromedriver
WARN Appium Appium encountered 1 warning while validating drivers found in manifest /Users/kazu/github/appium-chromium-driver/node_modules/.cache/appium/extensions.yaml
WARN Appium Driver "chromium" has 1 potential problem: 
WARN Appium   - Driver "chromium" (package `appium-chromium-driver`) may be incompatible with the current version of Appium (v2.6.0) due to its peer dependency on Appium ^2.11.5. Please install a compatible version of the driver.
dbug ChromedriverGoogleapisStorageClient Parsed 776 entries from storage XML
info ChromedriverGoogleapisStorageClient The total count of entries in the mapping: 546
info ChromedriverChromelabsStorageClient The total count of entries in the mapping: 4975
dbug ChromedriverStorageClient Selecting chromedrivers whose versions match to 130.0.6723.58
dbug ChromedriverStorageClient Got 5 items
dbug ChromedriverStorageClient Selecting chromedrivers whose platform matches to mac:arm64
dbug ChromedriverStorageClient Got 1 item
dbug ChromedriverStorageClient Excluding older patches if present
dbug ChromedriverStorageClient Versions mapping: {
dbug ChromedriverStorageClient   "130": [
dbug ChromedriverStorageClient     "130.0.6723.58"
dbug ChromedriverStorageClient   ]
dbug ChromedriverStorageClient }
dbug ChromedriverStorageClient Got 1 driver to sync: [
dbug ChromedriverStorageClient   "130.0.6723.58/chromedriver-mac-arm64.zip"
dbug ChromedriverStorageClient ]
dbug ChromedriverStorageClient Retrieving 'https://storage.googleapis.com/chrome-for-testing-public/130.0.6723.58/mac-arm64/chromedriver-mac-arm64.zip' to '/var/folders/l5/4djs4rts6dg8jxwjv45wkr_w0000gn/T/2024920-54661-1rq3y7o.td0k/0.zip'
dbug Support Traversed 2 directories and 3 files in 2ms
dbug ChromedriverStorageClient Moving the extracted 'chromedriver' to '/Users/kazu/github/appium-chromium-driver/node_modules/appium-chromedriver/chromedriver/mac/chromedriver-mac-arm64_v130.0.6723.58'
dbug ChromedriverStorageClient Permissions of the file '/Users/kazu/github/appium-chromium-driver/node_modules/appium-chromedriver/chromedriver/mac/chromedriver-mac-arm64_v130.0.6723.58' have been changed to 755
info ChromedriverStorageClient Successfully synchronized 1 chromedriver
✔ install-chromedriver successfully ran
kazu $ CHROMEDRIVER_VERSION=131.0.6778.3 appium driver run chromium install-chromedriver
WARN Appium Appium encountered 1 warning while validating drivers found in manifest /Users/kazu/github/appium-chromium-driver/node_modules/.cache/appium/extensions.yaml
WARN Appium Driver "chromium" has 1 potential problem: 
WARN Appium   - Driver "chromium" (package `appium-chromium-driver`) may be incompatible with the current version of Appium (v2.6.0) due to its peer dependency on Appium ^2.11.5. Please install a compatible version of the driver.
dbug ChromedriverGoogleapisStorageClient Parsed 776 entries from storage XML
info ChromedriverGoogleapisStorageClient The total count of entries in the mapping: 546
info ChromedriverChromelabsStorageClient The total count of entries in the mapping: 4975
dbug ChromedriverStorageClient Selecting chromedrivers whose versions match to 131.0.6778.3
dbug ChromedriverStorageClient Got 5 items
dbug ChromedriverStorageClient Selecting chromedrivers whose platform matches to mac:arm64
dbug ChromedriverStorageClient Got 1 item
dbug ChromedriverStorageClient Excluding older patches if present
dbug ChromedriverStorageClient Versions mapping: {
dbug ChromedriverStorageClient   "131": [
dbug ChromedriverStorageClient     "131.0.6778.3"
dbug ChromedriverStorageClient   ]
dbug ChromedriverStorageClient }
dbug ChromedriverStorageClient Got 1 driver to sync: [
dbug ChromedriverStorageClient   "131.0.6778.3/chromedriver-mac-arm64.zip"
dbug ChromedriverStorageClient ]
dbug ChromedriverStorageClient Retrieving 'https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.3/mac-arm64/chromedriver-mac-arm64.zip' to '/var/folders/l5/4djs4rts6dg8jxwjv45wkr_w0000gn/T/2024920-54819-14lyp1m.o995/0.zip'
dbug Support Traversed 2 directories and 3 files in 1ms
dbug ChromedriverStorageClient Moving the extracted 'chromedriver' to '/Users/kazu/github/appium-chromium-driver/node_modules/appium-chromedriver/chromedriver/mac/chromedriver-mac-arm64_v131.0.6778.3'
dbug ChromedriverStorageClient Permissions of the file '/Users/kazu/github/appium-chromium-driver/node_modules/appium-chromedriver/chromedriver/mac/chromedriver-mac-arm64_v131.0.6778.3' have been changed to 755
info ChromedriverStorageClient Successfully synchronized 1 chromedriver
✔ install-chromedriver successfully ran
kazu $ ls /Users/kazu/github/appium-chromium-driver/node_modules/appium-chromedriver/chromedriver/mac/
chromedriver-mac-arm64_v130.0.6723.58 chromedriver-mac-arm64_v131.0.6778.3

#363

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
package.json Outdated
@@ -33,7 +33,8 @@
"README.md",
"CHANGELOG.md",
"LICENSE",
"npm-shrinkwrap.json"
"npm-shrinkwrap.json",
"scripts/*.mjs"
Copy link
Contributor

Choose a reason for hiding this comment

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

simply include the whole scripts dir

Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if we also need to add this folder to the list of linted sources

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm, I might miss somewhere. npx eslint scripts/install-chromedriver.mjs worked but npx eslint . ignored the scripts.

Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps the global eslint config is only configured to verify .js files. We need to extend that and include mjs/cjs as well

Copy link
Contributor

@mykola-mokhnach mykola-mokhnach Oct 23, 2024

Choose a reason for hiding this comment

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

for now lets have the following pattern: (mjs|cjs|js|ts)

@KazuCocoa KazuCocoa marked this pull request as draft October 21, 2024 08:20
@KazuCocoa KazuCocoa marked this pull request as ready for review October 22, 2024 02:27
@KazuCocoa
Copy link
Member Author

updated with the latest chromedriver

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@@ -1,15 +1,15 @@
{
"name": "appium-chromium-driver",
"version": "1.3.54",
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to keep package.lock? we have shrinkwrap though

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe? I just respected existing one. Let me do the removal after this PR

README.md Outdated
- macOS/Linux: `CHROMEDRIVER_VERSION=131.0.6778.3 appium driver run chromium install-chromedriver`
- Windows: `$env:CHROMEDRIVER_VERSION='131.0.6778.3'; appium driver run chromium install-chromedriver; Remove-Item Env:\CHROMEDRIVER_VERSION`
- `CHROMELABS_URL`
- Let the command get the list of available chromedrivers from instead of the default `https://googlechromelabs.github.io`.
Copy link
Contributor

Choose a reason for hiding this comment

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

from the given mirror instead of the default one

@KazuCocoa KazuCocoa merged commit 4fb78e4 into main Oct 23, 2024
25 checks passed
@KazuCocoa KazuCocoa deleted the add-download-chromedriver branch October 23, 2024 07:30
github-actions bot pushed a commit that referenced this pull request Oct 23, 2024
## [1.4.0](v1.3.57...v1.4.0) (2024-10-23)

### Features

* add install-chromedriver command ([#366](#366)) ([4fb78e4](4fb78e4))
Copy link

🎉 This PR is included in version 1.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants