Giter Site home page Giter Site logo

sylvaindumont / docker-node-karma-protractor-chrome Goto Github PK

View Code? Open in Web Editor NEW
53.0 8.0 32.0 121 KB

A docker image :whale: to run karma and protractor tests in headless container

License: MIT License

Dockerfile 100.00%
karma protractor gitlab-ci docker chrome chrome-headless alpine

docker-node-karma-protractor-chrome's Introduction

docker stars docker pulls docker build automated build travis  build

alpine headless:
debian headless:
xvfb:

Karma and Protractor with Chromium in a docker container

This image allows to run javascript tests in a headless machine like a CI server.

This image support karma and protractor test under chromium.

Unfortunately, chromium doesn't support container (travis-ci/travis-ci#938), you need to start chromium with --no-sandbox argument to avoid this.

usage

in a shell

docker run --rm -v $(pwd):/app -w /app -it weboaks/node-karma-protractor-chrome:alpine sh

in gitlab ci

job name:
  image: weboaks/node-karma-protractor-chrome:alpine

configuration

To configure karma and protractor, use this snippets:

karma

browsers: ['Chromium_no_sandbox'],
customLaunchers: {
  Chromium_no_sandbox: {
    base: 'ChromiumHeadless',
    flags: ['--no-sandbox']
  }
},

ChromiumHeadless is available since [email protected], on previous versions use:

base: 'Chromium',
flags: ['--no-sandbox', '--headless', '--disable-gpu', '--remote-debugging-port=9222']

protractor

capabilities: {
  'browserName': 'chrome',
  'chromeOptions': {
    'args': ['no-sandbox', 'headless', 'disable-gpu']
  }
},

tags

headless mode

Chromium recently added headless support. If you want to use headless mode use the version and follow instructions in this readme.

If you don't want to use the headless mode, use or and follow instructions in that readme

alpine headless

To use alpine instead of debian, follow headless instructions and add this to protractor config :

chromeDriver: '/usr/bin/chromedriver',

node versions

and use the latest LTS node.

Others debian headless node versions are avalaible via the debian-node12 debian-node14 debian-node16 tags.

Others alpine headless node versions are avalaible via the alpine-node12 alpine-node14 alpine-node16 tags.

root versions

debian* and alpine* have no root access, if you need root access use debian-root, alpine-root, or xvfb

pinned tags

headless, alpine, debian-node* and alpine-node* are automated build, rebuild each time a commit is pushed to this repo and each time an image is pushed to official node image. These tags are always up to date, but can break builds with a new node version or a new chromium versions.

debian-<commit-hash> and alpine-<commit-hash> tags are available to target a specific commit, they are never rebuilt and will have the same node and chromium version forever.

docker-node-karma-protractor-chrome's People

Contributors

sylvaindumont avatar wykks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-node-karma-protractor-chrome's Issues

Session not created for the chrome version

I tried to add protractor tests in pipeline, and pulled the image weboaks/node-karma-protractor-chrome:latest in our test, but this test can not work. Is it the matter that chrome version does not meet the chromedriver version? I get the following error message:

[07:22:55] I/update - chromedriver: unzipping chromedriver_2.46.zip
[07:22:55] I/update - chromedriver: setting permissions to 0755 for /home/pipeline/df901498-b87a-49b6-8a8e-823651ba55a6/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.46
(node:491) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[07:22:56] I/launcher - Running 1 instances of WebDriver
[07:22:56] I/direct - Using ChromeDriver directly...
[07:22:56] E/launcher - session not created: Chrome version must be between 71 and 75
(Driver info: chromedriver=2.46.628388 (4a34a70827ac54148e092aafb70504c4ea7ae926),platform=Linux 4.4.0-139-generic x86_64)
[07:22:56] E/launcher - SessionNotCreatedError: session not created: Chrome version must be between 71 and 75
(Driver info: chromedriver=2.46.628388 (4a34a70827ac54148e092aafb70504c4ea7ae926),platform=Linux 4.4.0-139-generic x86_64)
at Object.checkLegacyResponse (/home/pipeline/df901498-b87a-49b6-8a8e-823651ba55a6/node_modules/selenium-webdriver/lib/error.js:546:15)
at parseHttpResponse (/home/pipeline/df901498-b87a-49b6-8a8e-823651ba55a6/node_modules/selenium-webdriver/lib/http.js:509:13)
at doSend.then.response (/home/pipeline/df901498-b87a-49b6-8a8e-823651ba55a6/node_modules/selenium-webdriver/lib/http.js:441:30)
at process._tickCallback (internal/process/next_tick.js:68:7)
From: Task: WebDriver.createSession()
at Function.createSession (/home/pipeline/df901498-b87a-49b6-8a8e-823651ba55a6/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
at Function.createSession (/home/pipeline/df901498-b87a-49b6-8a8e-823651ba55a6/node_modules/selenium-webdriver/chrome.js:761:15)

Headless not working since last update

Since the last update weboaks/node-karma-protractor-chrome:headless isn't working anymore. Looks like chrome got some problems.

The error repeats then until failure of pipeline (for me after 6 times).

Part of the stacktrace 17 06 2019 07:24:03.967:INFO [karma-server]: Karma v4.1.0 server started at http://0.0.0.0:9876/ 17 06 2019 07:24:03.975:INFO [launcher]: Launching browsers Chrome_Custom with concurrency unlimited 17 06 2019 07:24:03.980:INFO [launcher]: Starting browser ChromeHeadless 17 06 2019 07:24:09.476:ERROR [launcher]: Cannot start ChromeHeadless

DevTools listening on ws://127.0.0.1:9222/devtools/browser/344ff4f9-7316-4e63-818c-2ce61fa42693
[0617/072404.531886:FATAL:proc_util.cc(97)] Check failed: fstatat(proc_self_fd, de->d_name, &s, 0) == 0.
#0 0x55bb61387209
#1 0x55bb612d24d6
#2 0x55bb612ea8fc
#3 0x55bb624c25ba
#4 0x55bb624be5f1
#5 0x55bb64b82e36
#6 0x55bb623d5067
#7 0x55bb64b86db4
#8 0x55bb60e2dd77
#9 0x55bb60e3919a
#10 0x55bb60e2bb15
#11 0x55bb64f65783
#12 0x55bb64f65885
#13 0x55bb60e359be
#14 0x55bb5ea16add ChromeMain
#15 0x7f076f4d92e1 __libc_start_main
#16 0x55bb5ea168fa _start

Received signal 6
#0 0x55bb61387209
#1 0x55bb612d24d6
#2 0x55bb6138761b
#3 0x55bb61387c7e
#4 0x7f077d0b00e0
#5 0x7f076f4ebfff gsignal
#6 0x7f076f4ed42a abort
#7 0x55bb613871e5
#8 0x55bb612ea870
#9 0x55bb624c25ba
#10 0x55bb624be5f1
#11 0x55bb64b82e36
#12 0x55bb623d5067
#13 0x55bb64b86db4
#14 0x55bb60e2dd77
#15 0x55bb60e3919a
#16 0x55bb60e2bb15
#17 0x55bb64f65783
#18 0x55bb64f65885
#19 0x55bb60e359be
#20 0x55bb5ea16add ChromeMain
#21 0x7f076f4d92e1 __libc_start_main
#22 0x55bb5ea168fa _start
r8: 0000000000000000 r9: 00007ffc1607abe0 r10: 0000000000000008 r11: 0000000000000246
r12: 00007ffc1607b640 r13: 00007ffc1607b800 r14: 0000000000000069 r15: 00007ffc1607b650
di: 0000000000000002 si: 00007ffc1607abe0 bp: 00007ffc1607ae20 bx: 0000000000000006
dx: 0000000000000000 ax: 0000000000000000 cx: 00007f076f4ebfff sp: 00007ffc1607ac58
ip: 00007f076f4ebfff efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
Calling _exit(1). Core file will not be generated.

The headless tag does not work anymore due to an update of ChromeDriver

Since a couple of days ago, we can't run protractor tests with the weboaks/node-karma-protractor-chrome:headless image. The reason has to do with a new version of chromedriver (2.43). Protractor tries to automatically download the most recent chromedriver version. Based on our logs everything was working fine until version 2.42. A few days ago, 2.43 was released and we get this error:

[11:05:30] I/downloader - curl -o/code/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.43.zip https://chromedriver.storage.googleapis.com/2.43/chromedriver_linux64.zip
[11:05:31] I/update - chromedriver: unzipping chromedriver_2.43.zip
[11:05:32] I/update - chromedriver: setting permissions to 0755 for /code/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.43
(node:1398) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[11:05:40] I/launcher - Running 1 instances of WebDriver
[11:05:40] I/direct - Using ChromeDriver directly...
[11:06:40] E/runner - Unable to start a WebDriver session.
[11:06:40] E/launcher - Error: SessionNotCreatedError: session not created: Chrome version must be >= 69.0.3497.0
  (Driver info: chromedriver=2.43.600233 (523efee95e3d68b8719b3a1c83051aa63aa6b10d),platform=Linux 4.9.93-boot2docker x86_64)
    at Object.checkLegacyResponse (/code/node_modules/selenium-webdriver/lib/error.js:505:15)
    at parseHttpResponse (/code/node_modules/selenium-webdriver/lib/http.js:509:13)
    at doSend.then.response (/code/node_modules/selenium-webdriver/lib/http.js:440:13)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
[11:06:40] E/launcher - Process exited with error code 100
An unexpected error occurred: undefined

I noticed that you have fresh images but none of them is using node 8.

Do you plan to update the headless tag or maybe create a debian-node8 tag? That would be great for us :)

Root Tag help

Is there a debian-node-8-root anywhere?
I couldn't find it.

There are a lot of tags with root pointing to commits, it's not easy to understand what they are related to.

Chromium cannot be started from last rebuild

Hi,

From the last rebuild (2018-07-30T10:39:06.251Z), my pipeline (Karma unit test on Angular 6.0 app) is broken with the error :

30 07 2018 13:10:40.395:ERROR [launcher]: Cannot start Chromium
	Error relocating /usr/lib/chromium/chrome: hb_font_set_variations: symbol not found
Error relocating /usr/lib/chromium/chrome: hb_face_get_table_tags: symbol not found
Error relocating /usr/lib/chromium/chrome: hb_font_set_ptem: symbol not found

30 07 2018 13:10:40.395:ERROR [launcher]: Chromium stdout: 
30 07 2018 13:10:40.395:ERROR [launcher]: Chromium stderr: Error relocating /usr/lib/chromium/chrome: hb_font_set_variations: symbol not found
Error relocating /usr/lib/chromium/chrome: hb_face_get_table_tags: symbol not found
Error relocating /usr/lib/chromium/chrome: hb_font_set_ptem: symbol not found

Just to be sure it was not a problem with my new development, I tried to run the pipeline with a branch not modified from some days and with a PASSED status on the last run, and it failed too.

I'm using alpine-node8 image version.

Does someone has the same problem and has fixed it ?

Tests failing on ci

Any idea I am getting error UnexpectedAlertOpen previously these tests were passing also they are still passing for me locally. Is it due to new update of this package?
screen shot 2560-11-14 at 3 26 40 pm

Changes in alpine-node version

Hi, the update that you've made on alpine version (9 days ago) broke my pipeline with karma tests:

- 22 11 2019 19:00:35.332:ERROR [config]: Error in config file!
- { inspect: [Function: inspect] }

Then i setted up to alpine-node10:

    image: weboaks/node-karma-protractor-chrome:alpine-node10

and everything is back to normal.

Greetings from Brazil ;P

image node tags & root access

Is it possible to have tags that control node version and root access, something like debian-nodeX-root?

  • do you support node 15, in README it will be fine to update which node version is supported by the image tag?
  • debian-root have node 12 & npm 6 which is fixed and too low based on node LTS

Regards, Tomaž

Chromium version seems to be incompatible with chromedriver

I'm using the latest container in a bitbucket pipelines configuration.

+ ng e2e --protractor-config=e2e/protractor.pipeline.conf.js
Your global Angular CLI version (9.0.5) is greater than your local
version (9.0.4). The local Angular CLI version is used.
To disable this warning use "ng config -g cli.warnings.versionMismatch false".
[09:46:09] I/file_manager - creating folder /opt/atlassian/pipelines/agent/build/node_modules/protractor/node_modules/webdriver-manager/selenium
[09:46:09] I/config_source - curl -o/opt/atlassian/pipelines/agent/build/node_modules/protractor/node_modules/webdriver-manager/selenium/chrome-response.xml https://chromedriver.storage.googleapis.com/
[09:46:09] I/downloader - curl -o/opt/atlassian/pipelines/agent/build/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_80.0.3987.106.zip https://chromedriver.storage.googleapis.com/80.0.3987.16/chromedriver_linux64.zip
[09:46:09] I/update - chromedriver: unzipping chromedriver_80.0.3987.106.zip
[09:46:09] I/update - chromedriver: setting permissions to 0755 for /opt/atlassian/pipelines/agent/build/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_80.0.3987.106
Compiling @angular/forms : es2015 as esm2015
Compiling @angular/elements : es2015 as esm2015
chunk {main} main.js, main.js.map (main) 9.9 MB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 162 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]
chunk {scripts} scripts.js, scripts.js.map (scripts) 177 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 219 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 3.8 MB [initial] [rendered]
Date: 2020-03-06T09:46:52.915Z - Hash: 39c984b642ba795fdca4 - Time: 39537ms
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
: Compiled successfully.
[09:46:53] I/launcher - Running 1 instances of WebDriver
[09:46:53] I/direct - Using ChromeDriver directly...
[09:46:53] E/launcher - session not created: This version of ChromeDriver only supports Chrome version 80
(Driver info: chromedriver=80.0.3987.16 (320f6526c1632ad4f205ebce69b99a062ed78647-refs/branch-heads/3987@{#185}),platform=Linux 4.19.78-coreos x86_64)
[09:46:53] E/launcher - SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 80
(Driver info: chromedriver=80.0.3987.16 (320f6526c1632ad4f205ebce69b99a062ed78647-refs/branch-heads/3987@{#185}),platform=Linux 4.19.78-coreos x86_64)
at Object.checkLegacyResponse (/opt/atlassian/pipelines/agent/build/node_modules/selenium-webdriver/lib/error.js:546:15)
at parseHttpResponse (/opt/atlassian/pipelines/agent/build/node_modules/selenium-webdriver/lib/http.js:509:13)
at /opt/atlassian/pipelines/agent/build/node_modules/selenium-webdriver/lib/http.js:441:30
at processTicksAndRejections (internal/process/task_queues.js:97:5)
From: Task: WebDriver.createSession()
at Function.createSession (/opt/atlassian/pipelines/agent/build/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
at Function.createSession (/opt/atlassian/pipelines/agent/build/node_modules/selenium-webdriver/chrome.js:761:15)
at Direct.getNewDriver (/opt/atlassian/pipelines/agent/build/node_modules/protractor/built/driverProviders/direct.js:77:33)
at Runner.createBrowser (/opt/atlassian/pipelines/agent/build/node_modules/protractor/built/runner.js:195:43)
at /opt/atlassian/pipelines/agent/build/node_modules/protractor/built/runner.js:339:29
at _fulfilled (/opt/atlassian/pipelines/agent/build/node_modules/q/q.js:834:54)
at /opt/atlassian/pipelines/agent/build/node_modules/q/q.js:863:30
at Promise.promise.promiseDispatch (/opt/atlassian/pipelines/agent/build/node_modules/q/q.js:796:13)
at /opt/atlassian/pipelines/agent/build/node_modules/q/q.js:556:49
at runSingle (/opt/atlassian/pipelines/agent/build/node_modules/q/q.js:137:13)
[09:46:53] E/launcher - Process exited with error code 199

Build error

os: osx 10.12
docker version: 17.06.1

When i execute the docker build .

This is the error i've got.

This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'openjdk-7-jre-headless' has no installation candidate
The command '/bin/sh -c apt-get update &&     DEBIAN_FRONTEND="noninteractive"     apt-get install -y --no-install-recommends     chromium     libgconf-2-4     openjdk-7-jre-headless     && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100```

New headless version is not compatible with puppeteer's bin (error while loading shared libraries: libXss.so)

Hi there,

So with the new version, we cannot use puppeteer anymore, it will fail to start chrome saying libXss.so is missing.
image

What up with that ?

We are using karma with puppeteer's bin (process.env.CHROME_BIN = require('puppeteer').executablePath();) with the image weboaks/node-karma-protractor-chrome:headless in our .gitlab-ci.yml.

We use puppeteer's bin to make sure we are testing against the same Chrome version as our PCs.
It was working before the newest publish, but now it won't start the browser at all .. 😐

Thanks for your help !

selenium is not starting its server

I know this is not the place to ask about this, but I'm getting this error when starting the webdriver

$ webdriver-manager start
[14:49:27] I/start - java -Djava.security.egd=file:///dev/./urandom -Dwebdriver.chrome.driver=/usr/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.35 -Dwebdriver.gecko.driver=/usr/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.19.1 -jar /usr/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.8.1.jar -port 4444
[14:49:27] I/start - seleniumProcess.pid: 164
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/openqa/grid/selenium/GridLauncherV3 : Unsupported major.minor version 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:803)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:442)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:64)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:354)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:312)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
[14:49:27] I/start - Selenium Standalone has exited with code 1

My question is if I can use this docker image just to run the protractor without karma ? according to this Stackoverflow, the problem is about mismatched versions of Java and Selenium but this image is using openJDK 8 jre; so there shouldn't be a problem with that right?
I'm using gitlab runner for this test and using the following commands in .gitlab-ci.yml

  script:
     - apt-get update
     - apt-get install -y openjdk-8-jdk
     - npm install -g protractor
     - webdriver-manager update
     - webdriver-manager start
     - protractor protractor.conf.js


Chrome version mismatch

Selenium webdriver fails to launch with this image due to a Chrome version mismatch. Any suggestions?

[17:48:16] E/launcher - session not created: This version of ChromeDriver only supports Chrome version 79
  (Driver info: chromedriver=79.0.3945.36 (3582db32b33893869b8c1339e8f4d9ed1816f143-refs/branch-heads/3945@{#614}),platform=Linux 4.19.78-coreos x86_64)
[17:48:16] E/launcher - SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 79
  (Driver info: chromedriver=79.0.3945.36 (3582db32b33893869b8c1339e8f4d9ed1816f143-refs/branch-heads/3945@{#614}),platform=Linux 4.19.78-coreos x86_64)
    at Object.checkLegacyResponse (/opt/atlassian/pipelines/agent/build/node_modules/selenium-webdriver/lib/error.js:546:15)
    at parseHttpResponse (/opt/atlassian/pipelines/agent/build/node_modules/selenium-webdriver/lib/http.js:509:13)
    at /opt/atlassian/pipelines/agent/build/node_modules/selenium-webdriver/lib/http.js:441:30
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
From: Task: WebDriver.createSession()
    at Function.createSession (/opt/atlassian/pipelines/agent/build/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
    at Function.createSession (/opt/atlassian/pipelines/agent/build/node_modules/selenium-webdriver/chrome.js:761:15)
    at Direct.getNewDriver (/opt/atlassian/pipelines/agent/build/node_modules/protractor/built/driverProviders/direct.js:77:33)
    at Runner.createBrowser (/opt/atlassian/pipelines/agent/build/node_modules/protractor/built/runner.js:195:43)
    at /opt/atlassian/pipelines/agent/build/node_modules/protractor/built/runner.js:339:29
    at _fulfilled (/opt/atlassian/pipelines/agent/build/node_modules/q/q.js:834:54)
    at /opt/atlassian/pipelines/agent/build/node_modules/q/q.js:863:30
    at Promise.promise.promiseDispatch (/opt/atlassian/pipelines/agent/build/node_modules/q/q.js:796:13)
    at /opt/atlassian/pipelines/agent/build/node_modules/q/q.js:556:49
    at runSingle (/opt/atlassian/pipelines/agent/build/node_modules/q/q.js:137:13)

Angular unit/karma tests can not connect to Chrome?

Dear Sylvain,

I am very happy to have found your Docker image because I have been trying to get my Angular2 e2e/Protractor tests to run in a Docker environment. With this image that works.

However, my Angular unit/karma tests are not able to run. I get the following error message:

root@45525908b9da:/angular-project# ng test
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
Built project successfully. Stored in "dist/".
⠋ Building
START:
⠹ Building10 06 2016 20:13:26.954:INFO [karma]: Karma v0.13.22 server started at http://localhost:9876/
10 06 2016 20:13:26.965:INFO [launcher]: Starting browser Chrome

Build successful - 4986ms.

Slowest Trees                                 | Total               
----------------------------------------------+---------------------
BroccoliTypeScriptCompiler                    | 2743ms              
SASSPlugin                                             | 1069ms              
vendor                                        | 503ms               
HandlebarReplace                              | 290ms               

Slowest Trees (cumulative)                    | Total (avg)         
----------------------------------------------+---------------------
BroccoliTypeScriptCompiler (1)                | 2743ms              
SASSPlugin (1)                                | 1069ms              
vendor (1)                                    | 503ms               
HandlebarReplace (1)                          | 290ms               

10 06 2016 20:14:27.028:WARN [launcher]: Chrome have not captured in 60000 ms, killing.
10 06 2016 20:14:27.038:INFO [launcher]: Trying to start Chrome again (1/2).
10 06 2016 20:15:27.042:WARN [launcher]: Chrome have not captured in 60000 ms, killing.
10 06 2016 20:15:27.050:INFO [launcher]: Trying to start Chrome again (2/2).
10 06 2016 20:16:27.113:WARN [launcher]: Chrome have not captured in 60000 ms, killing.
10 06 2016 20:16:27.119:ERROR [launcher]: Chrome failed 2 times (timeout). Giving up.

Finished in 0 secs / 0 secs

Interestingly, on this image: https://hub.docker.com/r/pimterry/node-karma/~/dockerfile/ I CAN run my unit tests. But then the e2e tests fail.

I have been staring myself blind trying to figure out what's going on. But I am no Docker expert by any means. I hope you can shine some light on what I am missing and what I can do to fix it. Either in your image or otherwise.

Kind regards,
Rein

Upgrade Chromium to latest stable?

Hi,

Is there any chance you update the Chromium browser to latest stable (v77.0.3865)?

EDIT: I can NOT even find version 72 in the chromedriver npm package:
https://www.npmjs.com/package/chromedriver?activeTab=versions

😕

In my project I'm using chromedriver v77. Currently resulting into this error:

[23:08:19] E/launcher - session not created: This version of ChromeDriver only supports Chrome version 77
  (Driver info: chromedriver=77.0.3865.40 (f484704e052e0b556f8030b65b953dce96503217-refs/branch-heads/3865@{#442}),platform=Linux 4.19.0-6-amd64 x86_64)
[23:08:19] E/launcher - SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 77

Thanks in advance.

Regards,
Melroy

Ps. I try to use Docker image weboaks/node-karma-protractor-chrome:debian-node10 in my Gitlab CI.

Rename to chromium

This image actually contain chromium, not chrome. It should be renamed accordingly

Failing in bitbucket pipelines. Need help

Throws error

/var/lib/apt/lists/partial is missing

screen shot 2018-02-21 at 7 13 00 pm

Here's my pipeline .yml

image: weboaks/node-karma-protractor-chrome:headless
pipelines:
  default:
    - step:
          script:
            - apt-get update
            - apt-get install -y xvfb
            - yarn
            - npm run lint
            - npm run test:xvfb
            - npm run pree2e
            - npm run e2e:xvfb
            - ./node_modules/.bin/ng build -prod

Lost UI Shared context

When I try to run chromium in this container, I get this error:

sudo docker run --rm -it weboaks/node-karma-protractor-chrome:debian-node8  bash

node@8a0d8e3717e1:/tmp/mypanel$ /usr/bin/chromium --headless --no-sandbox --disable-gpu
[0314/140349.851451:ERROR:gpu_process_transport_factory.cc(1009)] Lost UI shared context.
[0314/140349.852041:ERROR:instance.cc(49)] Unable to locate service manifest for metrics
[0314/140349.852050:ERROR:service_manager.cc(890)] Failed to resolve service name: metrics

chromeOptions not accepting window-size argument

dockerfile:

FROM node:9-alpine

RUN echo @edge http://nl.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories \
    && apk add --no-cache \
    python \
    build-base \
    git \
    bash \
    openjdk8-jre-base \
    # chromium dependencies
    nss@edge \
    chromium-chromedriver@edge \
    chromium@edge 
   USER node

  ENV CHROME_BIN /usr/bin/chromium-browser
  ENV CHROME_PATH /usr/lib/chromium/

Protractor.conf.js :

chromeDriver: '/usr/bin/chromedriver',
directConnect: true,

capabilities: {
    'browserName': 'chrome',
    'chromeOptions': {
       args: ['no-sandbox','headless','window-size=1366,768'],

Error

UnhandledPromiseRejectionWarning: WebDriverError: no such session

Tried
1.In jenkinsfile :

    agent {
        
       	dockerfile {
		label "din"
		args "-v /tmp:/tmp --name Builder --net host --privileged -v /dev/shm:/dev/shm -e SCREEN_WIDTH=1366 -e SCREEN_HEIGHT=768"
		}
	
    }
  1. Tried In protractor.conf.js :
'window-size=1366,768'
'window-size=1366x768'
'--window-size=1366x768'
'screen-size=1366x768'
  1. tried updating protractor to [email protected] (was at 5.1) and using
'goog:chroomeOptions' : {
   args: ['no-sandbox','headless','window-size=1366,768'],
}

Detailed Error :

> protractor  protractor.conf.js

[20:23:30] D/launcher - Running with --troubleshoot
[20:23:30] D/launcher - Protractor version: 5.1.2
[20:23:30] D/launcher - Your base url for tests is undefined
(node:104) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[20:23:30] I/launcher - Running 1 instances of WebDriver
[20:23:30] I/direct - Using ChromeDriver directly...
[20:23:30] D/runner - WebDriver session successfully started with capabilities Capabilities {
  'acceptSslCerts' => true,
  'applicationCacheEnabled' => false,
  'browserConnectionEnabled' => false,
  'browserName' => 'chrome',
  'chrome' => { chromedriverVersion: '2.33 (6b5fa7bf9d0fa9821c8666484)',
  userDataDir: '/tmp/.org.chromium.Chromium.kodpec' },
  'cssSelectorsEnabled' => true,
  'databaseEnabled' => false,
  'handlesAlerts' => true,
  'hasTouchScreen' => false,
  'javascriptEnabled' => true,
  'locationContextEnabled' => true,
  'mobileEmulationEnabled' => false,
  'nativeEvents' => true,
  'networkConnectionEnabled' => false,
  'pageLoadStrategy' => 'normal',
  'platform' => 'Linux',
  'rotatable' => false,
  'setWindowRect' => true,
  'takesHeapSnapshot' => true,
  'takesScreenshot' => true,
  'unexpectedAlertBehaviour' => '',
  'version' => '64.0.3282.168',
  'webStorageEnabled' => true }
[20:23:30] D/runner - Running with spec files /jenkins/workspace/test_dev-YR7ZQV3UNW7VJ4GXEBWMEBAA/Modules/features/test.feature
******************************************************************************************
>>>>>>>>>>> Feature  :Test <<<<<<<
>>>>>>>>>>> Scenario : test1<<<<<<
*******************************************************************************************

(node:104) UnhandledPromiseRejectionWarning: WebDriverError: no such session
  (Driver info: chromedriver=2.33 (6b5fa7bf9d0fa982e74b7c8666484),platform=Linux 3.10.0-693.5.2.el7.x86_64 x86_64)
    at Object.checkLegacyResponse (/jenkins/workspace/test-bot_dev-YR7ZQV3UNW7JSL4PEPEGXEBWMEBAA/node_modules/selenium-webdriver/lib/error.js:505:15)
    at parseHttpResponse (/jenkins/workspace/test-bot_dev-YR7ZSL4PEPEGXEBWMEBAA/node_modules/selenium-webdriver/lib/http.js:509:13)
    at doSend.then.response (/jenkins/workspace/test-bot_dev-YR7ZQV3UNW7BWMEBAA/node_modules/selenium-webdriver/lib/http.js:440:13)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:182:7)
(node:104) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:104) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Stackoverflow :

Stackoverflow..

Protractor hangs on "I/launcher - 1 instance(s) of WebDriver still running" while using shardTestFiles: true in docker

I am getting this issue where 1 instance of webdriver remains forever until I abort the test run in jenkins. Protractor hangs at

I/launcher - 1 instance(s) of WebDriver still running

Setup (protractor | headless chrome | docker | jenkins)
protractor 5.3.2
chromedriverVersion: '2.40.565383'
chrome 'version' => '68.0.3440.75'
platform=Linux 3.10.0-862.3.2.el7.x86_64 x86_64)

Docker image :

FROM node:9-stretch
RUN apt-get update && 
DEBIAN_FRONTEND="noninteractive" 
apt-get install -y --no-install-recommends 
chromium
dbus-x11
dumb-init
libgconf-2-4 
openjdk-8-jre-headless 
&& rm -rf /var/lib/apt/lists/*
USER node
ENV CHROME_BIN /usr/bin/chromium
ENV DBUS_SESSION_BUS_ADDRESS /dev/null

protractor.conf.js

directConnect: true,
capabilities: {
shardTestFiles: true,
maxInstances: 6,

    'browserName': 'chrome',
    'chromeOptions': {
        args: ['no-sandbox','headless','disable-gpu','window-size=1366,768','enable-logging' ,'v=1','disable-dev-shm-usage'],
    }
},

Tried using : ENV DBUS_SESSION_BUS_ADDRESS /dev/null as suggested by few who faced similar issue in docker file but error still exist.

How do you use this docker image

Hi,
I've tried something like :
docker run weboaks/node-karma-protractor-chrome npm test

but I get :

npm ERR! Linux 4.9.4-moby
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "test"
npm ERR! node v7.4.0
npm ERR! npm v4.0.5
npm ERR! path /package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open '/package.json'
npm ERR! enoent ENOENT: no such file or directory, open '/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR! /npm-debug.log

Should I run the docker image in the root folder of my project and the entrypoint will execute any command I pass to it?

cheers.

Not able to delete httpOnly:true secure: true cookie using deleteAllCookies() in headless chrome in protractor in docker

Issue : not able to delete httpOnly:true , secure: true cookie using browser.driver.manage().deleteAllCookies() in headless chrome in protractor in docker.

Able to do same in my local setup : windows > protractor > chrome

Setup : protractor 5.3.2 , chromedriverVersion: '2.37.544315 , chrome 'version' => '66.0.3359.117', platform=Linux 3.10.0-862.3.2.el7.x86_64 x86_64) . Docker image : node:9-stretch.

Docker file options:

args "-v /tmp:/tmp --privileged  --net=host --shm-size=2gb"

Chrome options :

 args: ['no-sandbox','headless','disable-gpu','window-size=1366,768'],

Code sample :

    browser.manage().getCookies().then(function (cookies) {       
        console.dir(cookies);
            browser.driver.manage().deleteAllCookies();
            browser.sleep(5000).then(function (completed) {
                browser.manage().getCookies().then(function (cookies) {
                    console.dir(cookies);
                           });
    });
});

Stackoverflow - link

Original problem started with logout failure in our application using automation . On clicking logout button , a pop up appears with logout url (anchor element with href) , On clicking that element , logout happens (i.e redirection to several urls through UAA and ultimately landing on login page again). Behind the scene probably clearing auth cookie it seems or invalidating the session or cookie. Last week clicking on the logout anchor element started failing with failure on clicking . protarctor session simply times out on click

so initial thoughts were that click is failing , and i tried using browser.get('app_url/logout') instead of directly clicking on link . This too times out . I have verified that browser.get() works fine for change in hash or different url in docker setup.(earlier their was a issue logged in chrome <65 ) . I also verified that click on link works fine , its not a click problem

I feel that the issue is when app tries to clear cookies , the protractor session hangs their and times out while in docker setup . All this works absolutely fine in my local machine (windows). While digging in this issue , i found out that cookies are not getting cleared in docker for same protractor code , while in local they get cleared

Please created versioned Dockerfiles

The change to Node 8 in the last days has broken our pipelines.

We need to build against node 7 to verify that all will be built correctly.

It would be much better if we could specify:

weboaks/node-karma-protractor-chrome:node7 or

weboaks/node-karma-protractor-chrome:1.0.1

so that we can explicitly always use the same version.

a latest version:

weboaks/node-karma-protractor-chrome:latest could then be the version that has always the latest changes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.