2
votes

Angular 7 comes with default structure for e2e test looks like follows:

enter image description here

How Can I organise my tests in multiple files. for example

enter image description here

I want to avoid having so long testing files and these businees units have nothing to do with its others.

Question: how can I split my protractor test, into multiple files and folder and how can I run them after

Environment: Angular 7.10

1

1 Answers

4
votes

If you don't want to have src directory under e2e directory and have the structure as you defined. Then, just change specs variable in protractor.conf.js file to './**/*.e2e-spec.ts'. Angular application will run all the e2e tests, one by one just like how it does for unit tests files.

Solution:

exports.config = {
  ...
  specs: [
    './**/*.e2e-spec.ts'
  ],
  ...
};