Protractor + chrome direct connect circleci 2.0

chrome
nodejs
docker
2.0

#1

Hello,

could you please provide a full example environment running on node 6 and the latest Google chrome using the direct connection (no selenium). For example you can generate https://github.com/angular-fullstack/generator-angular-fullstack project and run e2e test on circle ci 2.0.

I am trying to use one of your docker images with browsers, but it fails on known exceptions such as session deleted because of page crash from unknown error - https://github.com/elgalu/docker-selenium/issues/20

But have no idea how to fix on your docker implementation and how to set bigger memory or run in privileged mode. Using command: [’-v /dev/shm:/dev/shm’] is throwing errors like cannot exec ‘-v /dev…’ I guess that I am setting something else than run commands on docker image.

So any help here would be a greatly approchiated.

Thanks a lot!

Cheers,
Andrej


#2

Have you tried the machine executor?

https://circleci.com/docs/2.0/executor-types/#machine-executor


#3

Not yet, but this is so obvious that everybody who is using selenium + chrome must have this problem, so I am expecting a real life example, so far I have not found that much…

Do you mind to provide a running example? Btw. on your current version 1.0 + Ubuntu 16.04 I am able to run it smoothly, so I am expecting to mount kinda same docker circleci1.0 transition and have the same results in circleci 2.0, otherwise it is really hard to find out all required dependencies and configuration myself especially for that very fragile headless testing with chrome+selenium.

Anyway thank you very much for your help.


#4

This is the first I’ve seen the ‘session deleted’ error from Selenium. We’re still in beta to address problems like this.

Regarding the machine, it’s not well documented yet so it’s best to just SSH in and run some commands. I can see chromedriver installed, and Java 8, so you might not need much to get it running.


#5

Is it work on docker image now? @rohara , @azachar


#6

Ok, I have tried, it is work now.

build-and-test:
docker:
  - image: circleci/node:8.9-stretch-browsers
working_directory: ~/test
steps:
  - checkout
      # https://github.com/sstephenson/bats/issues/229
  - run: curl -Lo- "https://raw.githubusercontent.com/bpkg/bpkg/master/setup.sh" | sudo bash
  - run: sudo bpkg install -g sstephenson/bats

  - run: mkdir ~/bin
  - run: |
         curl -L -o ~/bin/jq \
         https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 && \
         chmod +x ~/bin/jq
  - run: npm i
  - run: npm run pretest
  - run: node_modules/.bin/webdriver-manager update
  - run:
      command: NODE_ENV=development node server/server.js
      background: true
  - run: sleep 5
  - run: node_modules/.bin/protractor test/e2e/ui_test/protractor_conf_chrome/protractor.conf.js
  - store_artifacts:
      path: ~/test/test-results.xml
  - save_cache:
      key: v1-web-dev-{{ .Branch }}-{{ checksum "package.json" }}
      paths:
        - ./node_modules


#7