What could be causing the sluggish performance of my protractor test cases?

I'm a beginner with Protractor. Utilizing Protractor and Jasmine for end-to-end automation testing on an Angular4 application. Noticed that when running a specific suite, it performs quickly. However, running all suites takes considerably longer to finish. Seeking ways to reduce the overall time. I've incorporated await and sleep in certain sections of my test cases. Any recommended practices or patterns to follow? At present, utilizing page objects for web elements and spec files for test cases.

Answer №1

Instead of using sleeps, it is recommended to utilize Protractor's Expected Conditions as they are more efficient and can prevent slowing down your tests.

It is common for tests to take some time to complete. For example, our work tests used to run for about half an hour until we parallelized them, reducing the time to around 10 minutes.

To parallelize your tests, make sure to update your protractor-config.js:


...
capabilities: {

    ...

    shardTestFiles: true,
    maxInstances: 3 // maximum number of browser instances to run in parallel
},

maxSessions: 3, // maximum number of browser sessions to run

For further information, refer to the Protractor Config Description.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

various issues with fonts and Uncaught Eval error

I've been encountering multiple font/style errors and an uncaught eval. I have attached a picture for reference. My Angular application is not functioning properly, and I suspect these errors may be the reason. However, I am unsure of their significan ...

Unable to retrieve content in NGX-Quill upon submission

I am currently using "ngx-quill": "^14.3.0" along with "@angular/core": "~12.2.0". It is registered in the app module: QuillModule (not for root). And also in the lazy loaded module: QuillModule (not for root). public editor = { toolbar: [ ...

Incorporating Paypal subscription functionality and refining subscription challenges

The angular project I'm working on requires configuring a PayPal payment gateway for create subscription, cancel subscription, and upgrade subscription functionalities. I have encountered two issues with PayPal: 1) The PayPal button has been success ...

The @angular/fire package is unable to locate the AngularFireModule and AngularFireDatabaseModule modules

I am facing some challenges while trying to integrate Firebase Realtime Database into my Angular project. Specifically, I am encountering difficulties at the initial step of importing AngularFireModule and AngularFireDatabaseModule. To be more specific, I ...

How to reveal hidden Div element at a specific index with Angular Material table

In my mat-table, there are several functionalities available: 1. The ability to add or remove rows 2. Adding data into a row using different controls such as combo-boxes, text boxes, etc. One of the controls is a text box labeled "Additional Information ...

Generate the Ionic build and save it to the /dist directory instead of the /www

Every time I execute the command ionic build, it generates a fresh /dist directory containing all the same files that are typically found in the /www directory. Despite my attempts to make updates to the /www folder, only the /dist folder gets updated. Wha ...

Using single-spa with Angular Parcel inside a mat-dialog

I have developed an Angular application and an Angular parcel that will be utilized by various applications within the organization utilizing different frameworks. When I try to display the parcel component directly in another component using the async c ...

Arranging Angular Array-like Objects

I am in possession of an item: { "200737212": { "style": { "make": { "id": 200001510, "name": "Jeep", "niceName": "jeep" }, "model": { "id": "Jeep_Cherokee", "name": "Cherokee", "nice ...

"Error: The dist directory is missing in the Angular Docker File

I am in the process of Dockerizing an Angular project and here is my Dockerfile: # 1. Building the Angular app using Node.js FROM node:12 as builder WORKDIR /app COPY package.json package-lock.json ./ ENV CI=1 RUN npm ci COPY . . RUN npm run build-web -- ...

Challenges encountered while developing Angular FormArrays: Managing value changes, applying validators, and resolving checkbox deselection

I am facing an issue with my Angular formArray of checkboxes. In order to ensure that at least one checkbox is selected, I have implemented a validator. However, there are two problems that I need to address: Firstly, when the last checkbox is selecte ...

The Google Javascript API Photo getURL function provides a temporary URL that may not always lead to the correct photo_reference

Currently, I am integrating Google Autocomplete with Maps Javascript API into my Angular 5 application. As part of my website functionality, I fetch details about a place, including available photos. The photo URL is obtained through the getURL() method. ...

Encountering the Selenium Webdriver HTTP error within an Angular 4 project

ERROR Detected Issue found in: ./node_modules/selenium-webdriver/http/index.js Module not found: Error: Unable to locate 'http' in 'C:\Users\aprajita.singh\Documents\Angular 4\Auto-Trender-Project\node_modules ...

What purpose does the # symbol serve in Angular when interpolating values?

Here is an example provided from the following link: https://angular.io/guide/lifecycle-hooks export class PeekABoo implements OnInit { constructor(private logger: LoggerService) { } // Implementing OnInit's `ngOnInit` method ngOnInit() { this ...

A guide to using Angular to emphasize text based on specific conditions met

Currently, I am developing a testing application that requires users to choose radio type values for each question. The goal is to compare the selected answers with the correct answers stored in a JSON file. To achieve this, I have implemented an if-else ...

Utilizing Observables for AngularJS Services across Multiple Components in a View

My current challenge lies in Angular, where I am struggling to implement Observables in a service that will be utilized by multiple components. The issue at hand involves having Component A and Component B nested inside Component C (in a tab style layout). ...

The process of upgrading all dependencies to a particular version

I need guidance on upgrading a project from Angular 6 to version 7. The challenge lies in updating numerous dependencies as well. Most tutorials available only cover upgrading to the latest version (v8), rather than a specific one. Can anyone provide ins ...

Organizing Telephone Number Entries in Angular

In my search for a way to format a phone number input field in Angularjs, I have come across many solutions, but none specifically for Angular 7. What I am looking to achieve is for the user to enter the textfield like so: 123456789 and have the textfi ...

Upon upgrading to Angular 8, the function this._delegate.setNgStyle is not recognized

Following the update of my project from Angular 7 to Angular 8 and resolving all errors caused by breaking changes, I am encountering a new issue: <div fxFill ngStyle.xs="overflow:auto"> This line is resulting in the following error: ERROR Type ...

Protecting API Key in Angular 2

After spending more than a day searching on Google, I may not be using the right keywords to find the answer I need. Here is my current setup: I have an ExpressJS API running with pm2 on port 3000 An Angular 2 app being served via nginx Both of these a ...

It can be time-consuming to render a large quantity of dynamic markers on Leaflet after receiving a response

Incorporating leaflet.js into my web project, I am faced with the challenge of creating a map view with dynamic markers. Upon receiving a response, I attempt to generate dynamic components based on the data and utilize change detection to monitor updates. ...