AngularJS End to End (E2E) Testing | Protractor Last Updated : 30 Nov, 2020 Comments Improve Suggest changes Like Article Like Report Protractor is an end-to-end test framework developed for Angular and AngularJS applications. It run tests against the application interacting with it as a real user would, running in a real browser. In this article, we are going to create a basic test. Pre-requisite: Installation and Setup of Protractor Approach: We are going to create a basic test program in which we are going to check whether the title of the Angular web app is correct or not. All the Protractor tests will have a file which will contain the configuration and this will be the initial file that will initiate the test. Let's create this file with the name conf.js. conf.js: JavaScript exports.config = { // Capabilities to be passed to the // webdriver instance. // Here we are specifying the browser // to be chrome capabilities: { 'browserName': 'chrome' }, // Framework to use. Jasmine is // being used here. framework: 'jasmine', // The test file which are relative // to the current working directory // when protractor is called. specs: ['test.js'], // Options to be passed to Jasmine. jasmineNodeOpts: { defaultTimeoutInterval: 30000 } }; Now let's create our test file test.js. In this file, we are going to access an AngularJS web app and then check if the title is correct or not. Browser is a global created by Protractor, which is used for browser-level commands such as navigation with browser.get. The describe and it syntax is from the Jasmine framework where describe is a description of your test while it is the steps for the test. The spec file named test.js: JavaScript describe('Protractor Demo App', function () { it('should have a title', function () { // Open the AngularJS webpage browser.get( 'http://juliemr.github.io/protractor-demo/'); // Check if the title is 'Super // Calculator' or not. expect(browser.getTitle()) .toEqual('Super Calculator'); }); }); Finally, we are ready to run our file using the command given below:protractor conf.jsThis will run the configuration file and the test will be run as shown in the screenshot below: Output: Comment More infoAdvertise with us Next Article How to Use Loading in Interceptor? - Angular 17 G gurrrung Follow Improve Article Tags : AngularJS AngularJS-Misc Similar Reads AngularJS End to End (E2E) Testing Protractor Installation and Setup The Protractor is an end-to-end test framework developed for Angular and AngularJS applications. It runs tests against the application interacting with it as a real user would, running in a real browser. Features of Protractor: Tests using browser: Protractor uses native events and browser-specific 2 min read How To Perform Unit Testing For Angular Apps? Unit testing in Angular involves testing individual components, services, pipes, or directives in isolation to ensure they behave correctly. By writing unit tests, developers can catch bugs early, make refactoring safer, and ensure that each part of the application works as intended.PrerequisitesHTM 6 min read How to Use Loading in Interceptor? - Angular 17 In Angular applications, HTTP interceptors are a powerful feature that allows you to intercept and modify HTTP requests and responses. One common use case for interceptors is to display a loading indicator to the user while an HTTP request is in progress. This improves the user experience by providi 5 min read Angular Exercises, Practice Questions and Solutions Are you eager to elevate your web development skills with Angular or seeking to refine your expertise? Immerse yourself in our Angular Exercises, Practice Questions, and Solutions designed for both novices and seasoned developers. Our interactive platform offers engaging coding challenges, progress 3 min read How to create module with Routing in Angular 9 ? Angular applications are modular, and NgModules is Angular's own modular architecture. NgModules are containers for closely integrated application domains, workflows, or feature sets that comprise cohesive code blocks. Their scope is governed by the NgModule they include, and they can contain compon 4 min read Generate an angular@16 project within nx workspace Nx Workspace is a powerful tool that provides monorepo-style development for Angular projects. It offers enhanced capabilities for managing multiple applications, libraries, and shared code within a single workspace. In this article we will see how to generate an Angular 16 project withing NX worksp 2 min read Like