0
votes

I try to run 'ng e2e' on this project

automate-end-to-end-e2e-testing-for-angular-7-using-protractor-jasmine

but this command does not following thing:

1- Run spec in browser (default browser configured is chrome which run with message ‘Chrome is being controlled by automated test software’)

2- Log test execution result on console as below.

termainl show this:

terminal message

and intellij IDEA shows on top of app.e2e-spec.ts page this message:

TSLint:FetalError:Failed to load

what's wrong?

1
Run npm install codelyzerSaddam Pojee
@SaddamPojee The package is installed with some warnings but e2e testing does not work after it.Mostafa Farhani
Can you post what written in Details section of the error?Saddam Pojee
I resolved this problem with using vpn.Mostafa Farhani

1 Answers

0
votes

I checked by running the code. It's pretty clear that protractor.conf.js file is missing in e2e folder.

That file is needed, as you have reference to the file in angular.json file at Line 113.

protractor.conf.js is responsible for providing config to Protractor for e2e testing. Typically, it looks like below:

// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts

const { SpecReporter } = require('jasmine-spec-reporter');

exports.config = {
  allScriptsTimeout: 11000,
  specs: [
    './src/**/*.e2e-spec.ts'
  ],
  capabilities: {
    'browserName': 'chrome'
  },
  directConnect: true,
  baseUrl: 'http://localhost:4200/',
  framework: 'jasmine',
  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 30000,
    print: function() {}
  },
  onPrepare() {
    require('ts-node').register({
      project: require('path').join(__dirname, './tsconfig.e2e.json')
    });
    jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
  }
};