Search code examples
webdriver-io

WebdriverIO : Can we push code with dependencies only installed?


I am using webdriverIO v6

I have Installed just these two packages: npm install @wdio/cli as well as webdriverio

my tests are ruining smoothly in my local.

Is this ok to push to code-repo in git, does this work in Jenkis or Azure devops?

or is is required to install the --save-dev too to work in CI tools?

{
  "name": "test-package",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "wdio": "./node_modules/.bin/wdio wdio.conf.js"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@wdio/allure-reporter": "^6.1.23",
    "@wdio/cli": "^6.1.25",
    "@wdio/local-runner": "^6.1.25",
    "@wdio/mocha-framework": "^6.1.19",
    "@wdio/spec-reporter": "^6.1.23",
    "@wdio/sync": "^6.1.14",
    "chromedriver": "^83.0.1",
    "wdio-chromedriver-service": "^6.0.3",
    "webdriverio": "^6.1.25"
  },
  "dependencies": {}
}

Solution

  • This is nothing specific to wdio. This is a question which has been discussed multiple times in nodejs context.

    Many developers suggest not to include node_modules in the repo because of various reasons which are logical. Then there are reasons which might force you to do it. if you are doing it just to reduce the build time, be prepared for other implications. Below are links which might help you.

    https://flaviocopes.com/should-commit-node-modules-git/

    Should "node_modules" folder be included in the git repository