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

The client implementation for Chromedriver storage #131

Merged
merged 7 commits into from
Jul 1, 2019

Conversation

mykola-mokhnach
Copy link
Contributor

This is the POC implementation of Chromedriver storage client. The client is able to retrieve all chromedrivers from the storage, which match to the server OS and architecture. It is also possible to limit the drivers selection by particular chromedriver version or by minimum browser version.

I'm still not quite sure on where to invoke chromedrivers synchronisation, but any feedback on the current implementation or feature requests are welcome

@rkavalap
Copy link
Contributor

@mykola-mokhnach. This is cool. I would also have a reference of the new storage client as part of install.js to fetch all required versions, as well as within chromedriver.js which would choose the appropriate binary to launch based on the chrome version / android system webview version within automation

lib/storage-client.js Outdated Show resolved Hide resolved
lib/storage-client.js Outdated Show resolved Hide resolved
@mykola-mokhnach
Copy link
Contributor Author

@dpgraham @imurchie @jlipps @KazuCocoa

What do you think would be the best place/strategy to invoke chromedriver sync. @umutuzgur proposed to add additional server arguments, so if Appium is started with these then the sync is executed.

My idea was to trigger that automatically in case the driver cannot match existing chromedriver executables to the webview version.

I would be happy to consider your proposals

@dpgraham
Copy link
Contributor

I vote for not putting it behind a flag.

@KazuCocoa
Copy link
Member

KazuCocoa commented Jun 23, 2019

Automatically, mykola's idea, sounds good to me, but I believe some cloud providers would like to disable the downloading feature.
So, adding a flag to disable (or enable) the downloading feature is pretty fine, I think.

@umutuzgur
Copy link
Member

@KazuCocoa That was my main reason as well. Cloud providers usually have control over Appium's behaviour usually over the server flags, e.g --relaxed-security. They wouldn't wan't this sync to happen automatically or via endpoints. Otherwise, there is a need of endpoint blacklisting

@mykola-mokhnach
Copy link
Contributor Author

mykola-mokhnach commented Jun 23, 2019

ok, I will consider automagical driver(s) download in case there is no match for the current webview/chrome version AND if relaxed security in general (or particularly this feature) is allowed.

Any objections?


const log = logger.getLogger('ChromedriverStorageClient');

async function walkDir (dir) {
Copy link
Member

Choose a reason for hiding this comment

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

this seems like the kind of thing that should already exist in the node std lib or if not, that we could put into appium-support/fs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

might be, I'll do it later

lib/storage-client.js Outdated Show resolved Hide resolved
* @param {string} content - Release notes of the corresponding chromedriver
* @returns {AdditionalDriverDetails}
*/
parseNotes (content) {
Copy link
Member

Choose a reason for hiding this comment

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

let's hope they don't change their notes format 🤞

@jlipps
Copy link
Member

jlipps commented Jun 24, 2019

ok, I will consider automagical driver(s) download in case there is no match for the current webview/chrome version AND if relaxed security in general (or particularly this feature) is allowed.

sounds like a good approach to me.

@mykola-mokhnach mykola-mokhnach changed the title [POC] The client implementation for Chromedriver storage The client implementation for Chromedriver storage Jun 27, 2019
@mykola-mokhnach
Copy link
Contributor Author

mykola-mokhnach commented Jun 27, 2019

Ok, added the final changes. The fact that the corresponding server feature is enabled will be checked in the corresponding driver (aka BaseDriver instance). Then it will only be necessary to set the isAutodownloadEnabled option of Chromedriver to true in order to activate the automated download feature.

}
const workingCds = cds.filter((cd) => {
const versionObj = semver.coerce(cd.minChromeVersion);
return versionObj && chromeVersion.major === versionObj.major;

Choose a reason for hiding this comment

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

why use ”==“ ,the chromedriver ability to support multiple versions,A range should be set
image

Copy link
Contributor

Choose a reason for hiding this comment

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

Since Chrome 73 the versions of Chrome and Chromedriver have been aligned. Chrome 74.x.x requires Chromedriver 74.x.x. Chrome 76.x.x requires Chromedriver 76.x.x

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.

7 participants