1
votes

I have several Protractor config files with various configurations, for example; local and remote execution.

I have created a folder within the application root, which holds all additional protractor config files. I've left the standard protractor.conf file in the application root folder.

The specs are contained in the e2e folder contained in the application root.

As well as specifying the config to execute, I also need to specify which specs to execute at specific build steps during CI builds.

I am running the command from the application root folder, which contains the angular-cli.json file.

When I use both --config and --specs options with the following command:

ng e2e --config protractor-config\protractor-remote.conf --specs e2e\login.e2e-spec.ts

The config file is found however; it seems no specs are found:

Executed 0 of 0 specs SUCCESS in 0.002 sec.

If I only use the --config option with the below command, all specs contained in the chosen protractor config file run to completion as expected:

ng e2e --config protractor-config\protractor-remote.conf

If I only use the --specs option with the below command, the specs specified in the command run to completion as expected:

ng e2e --specs e2e\login.e2e-spec.ts

I appreciate any guidance,

Thanks

1

1 Answers

3
votes

I've found the argument passed for the --specs option is relative to the directory of the config file being executed whereas the argument passed to the --config option is relative to the current working directory. I can't find this stated in the current Angular CLI documentation.

For example, in the case above when passing the argument for the --specs option, I had to navigate up one directory to the application root folder using ..\

The following command worked:

ng e2e --config protractor-config\protractor-remote.conf --specs ..\e2e\navigation.e2e-spec.ts