9

Currently, I run ng e2e every time I make a change in my spec files and every time this command rebuilds the entire project ! is there a way to run the tests without rebuilding the entire project, just like ng test does it.

Yashwardhan Pauranik
  • 5,370
  • 5
  • 42
  • 65
Rachid O
  • 13,013
  • 15
  • 66
  • 92

3 Answers3

5

Just don't run ng e2e directly. It's very slow because it rebuild the whole project every time.

You can try npx protractor e2e/protractor.conf.js to run protractor directly.

Will Huang
  • 2,955
  • 2
  • 37
  • 90
  • 1
    the fastest workflow I've got was this `npx protractor ...` + vscode's rerun task keyboard shortcut. – armoucar Feb 18 '20 at 01:23
4

Remove

devServerTarget 

from angular.json e2e section.

This way angular won't run ng serve when running the end to end. You will have to have them running in a separate terminal.

Protractor won't re-run on file change.

carraua
  • 1,398
  • 17
  • 36
-1

I believe you can do it yourself with a bit of set up by leveraging the powers of Gulp. Just came across this while watching some slides:

http://ramonvictor.github.io/protractor/slides/#/53

flashjpr
  • 470
  • 6
  • 12