Search code examples
angularjasmineprotractore2e-testingangular-e2e

npm run e2e returns nothing in the terminal


I create my application using Angular 7, here is my package.json snippets:

"scripts": {
    "ng": "ng",
    "standardize": "prettier **/*.ts --write",
    "start": "npm run standardize && ng serve --port 5000",
    "build": "npm run standardize && ng build",
    "test:debug": "ng test --source-map=false",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
  },
"dependencies": {
    "@angular/animations": "^7.1.4",
    "@angular/cdk": "~7.2.0",
    "@angular/common": "^7.1.4",
    "@angular/compiler": "^7.1.4",
    "@angular/core": "^7.1.4",
    "@angular/flex-layout": "^7.0.0-beta.22",
    "@angular/forms": "^7.1.4",
    "@angular/http": "^7.1.4",
    "@angular/material": "^7.2.0",
    "@angular/platform-browser": "^7.1.4",
    "@angular/platform-browser-dynamic": "^7.1.4",
    "@angular/router": "^7.1.4",
    "core-js": "^2.6.1",
    "hammerjs": "^2.0.8",
    "rxjs": "~6.3.3",
    "rxjs-tslint": "^0.1.6",
    "zone.js": "~0.8.26"
  },
"devDependencies": {
    "@angular-devkit/build-angular": "^0.8.8",
    "@angular/cli": "^7.1.4",
    "@angular/compiler-cli": "^7.1.4",
    "@angular/language-service": "^7.1.4",
    "@types/jasmine": "^2.8.14",
    "@types/jasminewd2": "^2.0.6",
    "@types/node": "~8.9.4",
    "codelyzer": "~4.3.0",
    "cross-conf-env": "^1.1.2",
    "dev-norms": "1.3.6",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~3.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "npm-run-all": "^4.1.5",
    "prettier": "^1.15.3",
    "protractor": "^5.4.2",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "^3.1.1",
    "webpack-dev-server": "^3.1.14"
  }

It's time to do some tests, but when i try to test by typing in terminal "npm run e2e" it gives me 0 feedback except this one:

PS E:\dev\local-weather-app> npm run e2e

> localcast-weather@1.1.1 e2e E:\dev\local-weather-app
> ng e2e

PS E:\dev\local-weather-app>

Previously I executed "npm test" and that command worked correctly


Solution

  • If you are trying to run protractor test

    Add the below one to your package.json

    "e2e": "protractor config.js",

    Then run npm run e2e

    Now your test will run.

    Hope it helps you