-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
base: main
Are you sure you want to change the base?
Conversation
README.md
Outdated
[Chorme for testing](https://github.com/GoogleChromeLabs/chrome-for-testing) | ||
in `node_modules/appium-chromedriver/chromedriver` directory with `appium driver run chromium install-chromedriver`. | ||
|
||
As same as [appium-chromedriver](https://github.com/appium/appium-chromedriver), |
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.
not sure if it also would make sense to introduce command line arguments for the same
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.
Do you mean giving CHROMEDRIVER_VERSION
and CHROMELABS_URL
would not be helpful? So, just gives appium driver run chromium install-chromedriver
to download latest version?
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.
it's fine to have env variables. I mean that maybe duplicating their functionality by adding --chromedriver-version and --chromelabs-url command line params it would be more convenient for end users.
package.json
Outdated
@@ -33,7 +33,8 @@ | |||
"README.md", | |||
"CHANGELOG.md", | |||
"LICENSE", | |||
"npm-shrinkwrap.json" | |||
"npm-shrinkwrap.json", | |||
"scripts/*.mjs" |
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.
simply include the whole scripts
dir
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.
not sure if we also need to add this folder to the list of linted sources
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.
Hm, I might miss somewhere. npx eslint scripts/install-chromedriver.mjs
worked but npx eslint .
ignored the scripts
.
scripts/install-chromedriver.mjs
Outdated
VERSION_LATEST; | ||
} | ||
|
||
async function formatCdVersion (ver) { |
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 cannot we import these functions and constants instead of duplicating them?
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.
same above
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.
Do you mean exporting them from appium-chromedriver
's index and import them from the module? No special reason but just to not modify the chromedriver side only for these usage in scripts. e.g. Move formatCdVersion from test to somewhere and exporting it.
Or importing them from appium-chromedriver/build/lib/constants
...? Then, appium-chromedriver may not know if the path could be used by other modules (this package.) so probably not good to do it
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.
there is no need to export from index. You may export directly from build/lib. See, for example, https://github.com/appium/appium-windows-driver/blob/dba67a91039f8919373e7e913f862c2b8dcda867/scripts/install-wad.mjs#L7
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.
Yea, then you mean import LATEST from 'appium-chromedriver/build/lib/constants';
correct? Then, the https://github.com/appium/appium-chromedriver should keep the structure to not break https://github.com/appium/appium-chromium-driver (this module). I wanted to avoid calling other package's internal path such as build/lib...
since it means https://github.com/appium/appium-chromedriver maintenance should keep taking care of https://github.com/appium/appium-chromium-driver
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.
you may still call the script directly from node_modules in appium-chromium-driver. Although, I would consider either adding a separate script to the latter then. Same with uia2 driver
updated with the latest chromedriver |
Let's add the same automatic download (latest one) which is removed from appium-chromedriver.
This command will give the below log's ability.
#363