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

Configure using --browsers-json #56

Closed
marksievers opened this issue Jul 17, 2017 · 6 comments
Closed

Configure using --browsers-json #56

marksievers opened this issue Jul 17, 2017 · 6 comments

Comments

@marksievers
Copy link

marksievers commented Jul 17, 2017

Firstly, excellent tools! I've only been using Selenoid for about a day, and I'm really, really impressed.

What I haven't been able to do, is build / configure the aerokube/selenoid image with my selection of browsers and versions using ./cm selenoid configure ....

For example, I have a limited browsers.json file I want to use:

{
    "firefox": {
        "default": "28.0",
        "versions": {
            "28.0": {
                "image": "selenoid/vnc:firefox_28.0",
                "port": "4444",
                "path": "/wd/hub"
            }
        }
    }
}

If I'm understanding the documentation, I should be able to do that with --browsers-json.

selenoid$./cm selenoid configure --help
Create Selenoid configuration file and download dependencies

Usage:
  cm selenoid configure [flags]

Flags:
  -j, --browsers-json string      browsers JSON data URL (in most cases never need to be set manually) (default "https://raw.githubusercontent.com/aerokube/cm/master/browsers.json")

But running the following command just yields the default configuration (2 of the latest of each browser)

./cm selenoid configure [--browsers-json browsers.json]
# where browsers.json is in the same directory as cm

Docker Version: 17.06.0-ce, build 02c1d87
Cm Version: 1.1.2 & 1.2.0

@vania-pooh
Copy link
Member

@marksievers

  1. We decided to not implement this sync feature in cm code because is can be easily solved with existing command line tools. Take a look at the following documentation section: http://aerokube.com/selenoid/latest/#_syncing_browser_images_from_existing_file
  2. Now regarding --browsers-json. This flag in fact specifies where another browsers.json file (with completely different contents) is located. This second file stores information about webdriver binaries and is used only when Docker is not installed. So by default cm downloads this file here: https://github.com/aerokube/cm/blob/master/browsers.json So this flag is useless in your case.

@marksievers
Copy link
Author

@vania-pooh Thank you for the follow up.

Regarding point 2; understood - not what I thought it was intended for.

Regarding point 1, I understand the function of the command (pulling images from dockerhub based on the versions in a browsers.json file) but I don't see how that fits in to configuring Selenoid with the available browsers. My expectation is that I am able to produce a aerokube/selenoid image that when spun up as a container has the above browsers.json (firefox v28 only) in /etc/selenoid/browsers.json (or has it passed to it) - is this correct or am I going about it the wrong way using cm?

@vania-pooh
Copy link
Member

@marksievers currently there is no way to download an exact version. The only supported feature is to download last N versions of the browser. E.g.:

$ ./cm selenoid start --browsers firefox,chrome --last-versions 10

In your case --last-versions should be something like 26 (v54 - v28), but this will download v28 and all versions newer than it. So if you wish only v28 - currently we expect to create such config manually as it is rather rare case. The most popular case is to have last N versions this is why we implemented it. Another flag --browsers allows to limit desired browsers (comma separated without space).

@marksievers
Copy link
Author

marksievers commented Jul 17, 2017

@vania-pooh Awesome, thank you for the clarification!

And wonderful suite of tools again, really well done!

@marksievers
Copy link
Author

marksievers commented Jul 17, 2017

As an update on this, what I did find worked for me was the following:

  1. As Ivan mentioned, using jq to pull the required images.
  2. Using the selenoid standalone binary which DOES accept a custom browsers.json using the --conf flag.

@vania-pooh
Copy link
Member

@marksievers selenoid accepts any valid configuration. cm is a one command setup.exe for the most common cases able to automatically pull images and generate config. That's the difference.

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

No branches or pull requests

2 participants