#selenium

/

      • jimevans has quit
      • admin-sl
        well, im good with using a `nodejs` base, but seems like i have to install `java`, `selenium` and all that then
      • True?
      • is why i was looking to see if there was a base image with all of that already baked
      • simonstewart
        Time to take a step back :)
      • diemol-sl joined the channel
      • So, you want to write your tests in JS?
      • diemol-sl
        I was going to say that
      • :)
      • simonstewart
        Great mind, diemol-sl. Great minds
      • admin-sl
        Correct. I currently have tests in `node.js`, using `package.json` to install `selenium-standalone` && atm `webdriver.io`.
      • simonstewart
        So, the hub and nodes take the place of "selenium-standalone"
      • admin-sl
        but, if i use a `Dockerfile` with a `nodejs` base it complains about `java`
      • simonstewart
        So you won't need java on your nodejs image
      • admin-sl
        so i take it i need something with `java` installed, or need to do that manualy
      • simonstewart
        Selenium uses a network protocol to communicate with the selenium server (be it Hub, a standalone server, or something like chromedriver, geckodriver, or the IEDriverServer)
      • That's why you pass a URL to the remote webdriver instance. It's normally "http://localhost:4444/wd/hub", but it can basically be anything
      • diemol-sl
        one option is to run your tests, using a node base image, and then put them together in a docker-compose file with the docker-selenium images
      • simonstewart
        Right
      • diemol-sl
        I have an example of that but with Java, in theory is to add “Script” at the end and that’s it :)
      • admin-sl
        got it. so, i can’t use docker-compose, this will run on a kubernetes cluster
      • against an app in another container
      • diemol-sl
        well, not really, but you can get the idea
      • simonstewart
        A kubernetes cluster is a little hardcore. You can just use docker-compose :)
      • admin-sl
        well, thats the purpose of this, actually. the app exists already on a kubernetes cluster.
      • simonstewart
      • admin-sl
        so im working on setting up some tests against it
      • simonstewart
        Oh. Ok
      • You need one hub, and many nodes.
      • admin-sl
        the cluster exists for lots of other reasons that i can’t change
      • simonstewart
        The nodes should be configured to register with the hub
      • admin-sl
        so, ideally, id just build a container w/selenium + my code in it && aim it at the running app & it would do its thing.
      • via IP address or whatever config
      • simonstewart
      • diemol-sl
        ah ok, so you want to have a deployment with only one container
      • simonstewart
      • admin-sl
        right. at the moment i’m trying to take what i have running locally && just containerize it. dont care too much about kubernetes specifics yet
      • simonstewart
        I'll let diemol-sl do the talking. He knows more than I do about this :)
      • admin-sl
        would like to just use a `Dockerfile` && see if i can `docker run` it
      • diemol-sl
        oh, those are big words @simonstewart :O, I don’t think so
      • admin-sl
        seems more than what i need to setup a hub + multiple nodes
      • diemol-sl
        but thanks :)
      • fa-tvonmoll-sl joined the channel
      • fa-tvonmoll-sl
        interesting
      • so yeah, with kube, you just have separate deployments for hub, ff, and chrome
      • moondoggy_ joined the channel
      • simonstewart
        I've not played with kubernetes yet. I should do that
      • fa-tvonmoll-sl
        so long as you name things accordingly (and they’re all in the same namespace), should be able to discover based on the internal dns
      • yeah, kube has been my muse for the past month or so
      • haven’t really tried to do webdriver stuff inside my cluster, though (i like mah saucelabs)
      • diemol-sl
        if you want to run those tests a bit faster, ideally you would need to deploy a Grid in k8s otherwise it is like deploying an app to run those tests sequentially
      • KaibutsuX joined the channel
      • but one way to go is to use one of the standalone images, and add the needed stuff from node, then run the tests there
      • it could be a big image so the deployment can take some time
      • admin-sl
        ok got it. i think that still might be larger scale that what I’m aiming to do. but, i may be thinking about it all wrong.
      • diemol-sl
        how many tests do you have?
      • admin-sl
        locally i just `run serve cmd` for app in one terminal, switch and `run test command` in another && watch the tests run.
      • just a couple, this is `hello-world` prototype level atm.
      • so the idea is, we have an app running on a cluster, it gets updated occasionally. we want to roll out a standalone container that uses selenium to hit the web UI, ping a few things & verify its responsive, then shut down.
      • so we can regularly verify the web console runs
      • fa-tvonmoll-sl
        right
      • admin-sl
        && ensure an update doesn’t kill it for users
      • w/o having to manually hit it
      • fa-tvonmoll-sl
        so the tests could still be containerized and run as a k8s batch
      • diemol-sl
        maybe you can have a deployment with a grid and another container with your tests
      • fa-tvonmoll-sl
        yeah, that
      • arnold89 joined the channel
      • arnold89 has quit
      • diemol-sl
        there is a chart that may help you to simplify the grid deployment https://github.com/kubernetes/charts/tree/maste...
      • admin-sl
        ok, looking up grid quick. still think its a lot bigger than what i need, but just a sec, thx!
      • hmm.
      • simonstewart
        Yikes! It's not just docker any more. It's kubernetes and helm. What the heck is helm?
      • fa-tvonmoll-sl
        helm is life
      • (package manager; saves you from having to re-implement everything yourself)
      • admin-sl
        so just for confirm, before going larger, as you can `FROM nodejs:latest` at the top of a `Dockerfile` to use a node.js base image, there isn’t an existing base image w/`java` and `selenium`?
      • selbot2
        standalone-server: http://goo.gl/Z4Z4aM Python: http://goo.gl/PXpx0Q IEDriverServer(32bit): http://bit.ly/1jik2D9 IEDriverServer(64bit): http://bit.ly/1lHYaTF
      • diemol-sl
        admin-sl is the idea just to run a few tests to monitor if the deployed app is ok?
      • arnold89 joined the channel
      • admin-sl
        meaning, i think we are running down the path too far, pretty sure i just need a base image so i dont need to `apt-get` all the java & everything.
      • diemol-sl yup. we want to just spin up 1 container, that has webdriver + selenium + our tests scripts, let it hit the web console in a headless browser & click test a few things.
      • so that can all be in one container, no prob.
      • in fact, that desirable. dont want to configure a bunch more bits to talk to each other.
      • diemol-sl
        ah ok, then I think you just need a container with Chrome, ChromeDriver and node installed
      • czart joined the channel
      • no need to install Java and the Selenium jar, with the Selenium bindings for JavaScript should be enough
      • admin-sl
        yeah, i was expecting this list of base images https://github.com/SeleniumHQ/docker-selenium would have something more or less like that.
      • that i could `FROM` and be on my merry way.
      • diemol-sl
        I was thinking that, maybe to build containers only with the browser and the driver, and from there build up the other ones
      • admin-sl
        right, if I have in my `package.json` as a dependency `"selenium-standalone": "^6.12.0"`
      • diemol-sl
        but I think I saw that somewhere, one moment
      • Adib has quit
      • I think this guy has some images that can help you https://github.com/yukinying/chrome-headless-br...
      • I haven’t tried them myself, but this should work for your use case
      • admin-sl
        oh nice, let me take a look at that.
      • def appreciate it.
      • dmarr joined the channel
      • any thoughts on ever providing an offical image for this use case? like, worth opening a github issue?
      • diemol-sl
        I had that idea, mainly to restructure how the images are built currently… you can open it and continue the discussion there :) maybe @ddavison has similar thoughts?
      • admin-sl
        awesome ok will do
      • ddavison-sl joined the channel
      • ddavison-sl
        quite a convo - let me catch up on the context
      • simonstewart has quit
      • simonstewart joined the channel
      • riotz has quit
      • riotz joined the channel
      • ok - yea. admin-sl don't have your tests in the same container as selenium. If you want to build your own, that's fine - one thing you could do, is just share volumes. modify our images to include a customized test runner. have the test runner read some directory that is shared from your test container
      • simonstewart has quit
      • admin-sl
      • ddavison-sl its not possible, or just not best practice?
      • generally i get you shouldn’t put multiple applications in one container, but in this case, the tests are tightly coupled to selenium
      • is why i ask
      • ddavison-sl
        define tightly coupled, because as simonstewart pointed out earlier, you could just run your hub/nodes, then your tests just point to the URL
      • simonstewart joined the channel
      • admin-sl
        Well, `hub/nodes` doesn’t exist, in my current local setup. its just webdriver.io + selenium-standalone running against a local version of the web-app on `localhost`
      • which works, so since the webapp runs in production in a container, im just aiming to package up a 30 line test script + the dependencies into a container that we can deploy & run.
      • fairuz joined the channel
      • thats probably why i keep stepping back when i see hub + nodes, I think thats prob a lot larger than what I need for this use case
      • simonstewart has quit
      • marxarelli is now known as marxarelli|afk
      • lucast-sl joined the channel
      • lucast-sl
        test
      • simonstewart joined the channel
      • nostromo_pilo-sl joined the channel
      • maeriens-sl joined the channel
      • moondoggy_ has quit
      • ddavison-sl
        ack
      • nolski
        Hey, does anyone know why all comments on selenium github issues are locked?
      • KaibutsuX has quit
      • admin-sl
        heh lost everyone. I must be totally off in my approach ,:)
      • lucast
        nolski: you're probably looking at the old archive
      • ddavison-sl
        are you talking about the google-code issues archive, nolski?
      • nolski
        yuuuuuuuuuup
      • Sorry google brought me there. Are those relevant?
      • lucast
        most shouldn't be
      • nolski
        I'm having an issue with proxy auth in firefox not seeming to work https://github.com/SeleniumHQ/selenium-google-c...
      • lucast
        if they were, they would have been transferred to the current issues
      • moondoggy_ joined the channel
      • nolski
        that issue was the best my google fu could get me
      • ddavison-sl
        the selenium project used to be held within google code. we had used google issues a time ago (circa 2015). all issues were migrated to github, and they are locked. the current issues are at https://github.com/seleniumhq/selenium/issues
      • nolski
        should I refile that under your new repo then?
      • Happy to write up a ticket :)
      • Dritz
      • eghm joined the channel
      • marxarelli|afk is now known as marxarelli
      • nolski
        Dritz++
      • Yup that looks similar
      • ddavison-sl
        ok - i get where you're going admin-sl - having just a simple standalone container that can run tests (like what you specified in the issue) this is an interesting use case.. let me brain dump for a sec
      • simonstewart has quit
      • it's a cool idea because if a person wants to run one-off tests in a small docker container, just create the docker file, specify the FROM, add the RUN directive. cool. which languages would it support? if these images were to support any languages, they would be java or python, not js
      • and if there were multiple language binding supports, that'd be _n_ number of more docker images to maintain. don't like that