Git Product home page Git Product logo

Comments (8)

sylvaindumont avatar sylvaindumont commented on May 27, 2024

Hi,

You need to mount your current folder into the image
docker run -v $(pwd):/home -w /home weboaks/node-karma-protractor-chrome npm test

You should run the image in the root folder of your project. The entrypoint will execute any command you pass to it.

from docker-node-karma-protractor-chrome.

simondrabble avatar simondrabble commented on May 27, 2024

What's the recommended way to install protractor into this image? And for my curiosity, why is it not included as part of the image itself?

Because the (default) user isn't root, I get this:

bash-4.4$ npm install -g protractor
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!   stack: 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/node/.npm/_logs/2018-09-17T19_03_21_595Z-debug.log

from docker-node-karma-protractor-chrome.

sylvaindumont avatar sylvaindumont commented on May 27, 2024

@simondrabble the recommended way is to add protractor to your devDependencies and install it alongside your project dependencies.
If you want to install protractor globally, you can use the debian-root or alpine-root tags.

from docker-node-karma-protractor-chrome.

simondrabble avatar simondrabble commented on May 27, 2024

That should work, thanks! It just seemed weird to me that this image doesn't have "batteries included" like I would expect.

from docker-node-karma-protractor-chrome.

sylvaindumont avatar sylvaindumont commented on May 27, 2024

Most of the time, protractor and karma are installed via depDependencies, and would be installed two times if they were already installed globally. Not including them is the image reduce the image size for these users.

from docker-node-karma-protractor-chrome.

simondrabble avatar simondrabble commented on May 27, 2024

Sounds reasonable. Thanks again!

from docker-node-karma-protractor-chrome.

simondrabble avatar simondrabble commented on May 27, 2024

One more qq: where/ how should webdriver be installed? I don't see a way to start it under protractor. You might want to consider adding some more "getting started/ using this image" documentation :)

from docker-node-karma-protractor-chrome.

sylvaindumont avatar sylvaindumont commented on May 27, 2024

On the debian based variants, just use webdriver installed by protractor. On the alpine based variants, this webdriver isn't compatible with musl, and we have to use one already installed in the image (in /usr/bin/chromedriver)

from docker-node-karma-protractor-chrome.

Related Issues (20)

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.