Toumi
Toumi

Reputation: 3165

protractor test across multiple files

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

Upvotes: 2

Views: 896

Answers (1)

Saddam Pojee
Saddam Pojee

Reputation: 1598

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'
  ],
  ...
};

Upvotes: 4

Related Questions