0 votes
in AngularJS Packaging and Testing by
What is Protractor?

1 Answer

0 votes
by

Protractor is an end-to-end test framework for Angular. It runs your tests inside a real browser, interacting with it as real person would. Unlike unit tests, where we test individual functions, here we test the entire logic. Protractor is able to fill in forms, click buttons and confirm that the expected data and styling is displayed in the HTML document. Just like Karma, Protractor has its own configuration file at the root of your Angular project, protractor.conf:

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

exports.config = {

  allScriptsTimeout: 11000,

  specs: [

    './e2e/**/*.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: 'e2e/tsconfig.e2e.json'

    });

    jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));

  }

};

Related questions

0 votes
asked Apr 5, 2021 in Protractor by Robindeniel
0 votes
asked Apr 5, 2021 in Protractor by Robindeniel
...