What is the best way to execute multiple Protractor test suites simultaneously?

Exploring Protractor for the first time. My goal is to run multiple test suites in a sequence. I have a complex angular form with various scenarios, each with its expected results. I want to execute all tests with just one command. Initially, I tried entering comma-separated values like:

protractor config.js --suite=rf1_breast, rf1_ovarian, rf1_pancreatic

But encountered an error:

Error: more than one config file specified

This seems strange as there's only one config file in the directory where I'm running protractor.

Here's my config.js:

exports.config = {
  seleniumAddress: 'http://localhost:4444/wd/hub',
  capabilities: { 'browserName': 'chrome' },
  framework: 'jasmine2',
  suites: {
    rf1_breast: './rf1-ashkenazi-hboc/Breast/specs/*_spec.js',
    rf1_ovarian: './rf1-ashkenazi-hboc/Ovarian/specs/*_spec.js',
    rf1_bladder_fail: './rf1-ashkenazi-hboc/Bladder-expected-fail/specs/*_spec.js',
    rf1_pancreatic: './rf1-ashkenazi-hboc/Pancreatic/specs/*_spec.js',
    rf1_prostate: './rf1-ashkenazi-hboc/Prostate/specs/*_spec.js'
  },
  onPrepare: function() {
    /* global angular: false, browser: false, jasmine: false */
    browser.manage().window().setSize(1600, 1600);
    // Disable animations so e2e tests run more quickly
    var disableNgAnimate = function() {
      angular.module('disableNgAnimate', []).run(['$animate', function($animate) {
        $animate.enabled(false);
      }]);
    };

    browser.addMockModule('disableNgAnimate', disableNgAnimate);
},
  jasmineNodeOpts: { showColors: true }
};

Any suggestions on a better approach to running each scenario?

Answer №1

Remember to not include spaces following commas:

In your command line, enter: protractor config.js --suite rf1_breast,rf1_ovarian,rf1_pancreatic

Answer №2

When configuring your application in config.js

If you wish to execute the script as a suite, simply comment out the spec line

// specs: ['src/com/sam/scriptjs/alertexamplespec.js']

Specify the suite name and location accordingly

 suites: {
      //Enter the suite name and its location. Use * to run all specs or provide specific names
        smoke: ['./smoke/*.spec.js'],
        endtoend: ['src/com/sam/scriptjs/*.spec.js'],
//You can also select particular test specs 
testfew: ['./smoke/editorder.spec.js','./smoke/cancelorder.spec.js']

},  

After that, in the command prompt, type protractor filenameconfig.js

Answer №3

Consider organizing your test suite into multiple files for better readability and maintenance. Here is an example configuration with individual test files:

exports.config = {
     allScriptsTimeout: 11000,
     specs: [
       './e2e/**/1.Landing.Page.ts',
       './e2e/**/2.Confirmation.Page.ts', 
       './e2e/**/3.PersonalData.Page.ts',
       './e2e/**/4.sms.Page.ts',
       './e2e/**/5.idCard.Page.ts'
     ],
}

This approach has been effective in my experience.

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

JavaScript Hangman Game Malfunctioning

I am in the process of creating a basic hangman game to be played on a web browser. Whenever the user clicks a button, it triggers a function called pickWord(): <button onclick="pickWord()" id="restart">Choose A Word</button> This functi ...

"Moisten" a JavaScript object instance using a JSON array, similar to the way PHP does

When populating PHP objects with data, I typically use the following method: public function hydrate(array $data){ foreach($data as $key=>$value){ $method = 'set'.ucfirst($key); if(METHOD_EXISTS($this,$method)){ ...

How to integrate angular-ui-bootstrap with webpack

I'm attempting to integrate https://github.com/angular-ui/bootstrap with Webpack: import angular from 'angular'; import uiRouter from 'angular-ui-router'; import createComponent from './create.component'; import tabs fro ...

Performing a Protractor test on an Angular 5 application

We're in the process of transitioning our ui-library from AngularJS to Angular 5. I'm encountering challenges with the protractor tests. I need guidance on how to update the old AngularJS test to align it with Angular 5. If anyone has dealt wit ...

Issue with electron-vue: Unable to modify Vuex state when using RxJS subscribe

I need help with my code involving two functions in the mutations and two pieces of state const state = { files: [], uploadProgress: 0 } const mutations = { SET_UPLOAD_IMAGE: (state, files) => { state.files = files }, UPLOAD_IMAGE: ( ...

The onclick functionality is not functioning properly within email communications

My JavaScript code contains an AJAX call within Datatables, and this snippet of code is causing an issue: { "data": null, "width": "10%", "render": function(data){ icon2 = '<center><button type="button" class="btn btn-info ...

Adding styles dynamically using methods is not supported in Vue.js

When it comes to adding styles to an HTML element from methods, I ran into a small hiccup. Here's what I tried: <div class="add-profile-img" v-bind:style="getBackgroundImg()"> The method in question is: getBackgroundImg: function() { return { ...

Creating a Configuration File for POST Requests in NodeJS Express

In my NodeJS application using Express, I currently have a hardcoded method for handling URL POST Request Calls and responding with JSON Files. This means that every time I need to add more POST Request Inputs or specify which JSON File to use, I have to m ...

When using Google Maps in an Android webview, an error occurs stating that the user has denied geolocation

I'm having trouble loading Google Maps v3 (Javascript) in an Android web view An error keeps occurring: User denied geolocation Using Ionic, it works flawlessly in desktop Chrome (ionic serve) and iOS devices. The error only appears on Android. ...

Having trouble with Angular2's Maximum Call Stack Exceeded error when trying to display images?

I am facing an issue in my Angular2 application where I am trying to display an image in Uint8Array format. The problem arises when the image size exceeds ~300Kb, resulting in a 'Maximum Call Stack Exceeded' error. Currently, I have been able to ...

Transitioning one element's opacity to zero while concurrently increasing another element's opacity to replace it

There are a total of 3 div elements and 3 links included in this setup. The goal is to only display one div at any given time. Upon clicking on a link corresponding to a different div, the current one should fade out while the selected one fades in seamle ...

Sinon and Chai combination for testing multiple nested functions

I attempted to load multiple external JavaScript files using JavaScript. I had a separate code for the injection logic. When I loaded one JavaScript file, the test case worked fine. However, when I tried to load multiple JavaScript files, the test case FA ...

Tips on rearranging the location of a div element within a directive

I have created a custom directive that displays two divs, Div1 and Div2, with a splitter in the middle: Splitter Image Now, I am looking for a way to swap the positions of these two divs dynamically using an Angular directive. I thought about using ng-swi ...

The method of inserting a JSON dates object to deactivate specific days

I am currently utilizing a date picker component that can be found at the following link: While attempting to use the disabledDays section below, I have encountered an issue where I am unable to apply all three options. The blockedDatesData option works o ...

React useEffect appended script not activating

I'm having trouble loading a script that should generate an iframe and display a weather widget upon trigger. I am able to append the script correctly, but it doesn't seem to be called and does not create the iframe. Even when I directly add the ...

Could someone assist me in figuring out the reason behind my fetch method sending undefined values?

Looking for some assistance with my fetch implementation issue. I am currently working on integrating stripe into my online grocery store website utilizing a node.js server with express, and ejs for frontend integration. The client-side JavaScript uses a f ...

Guide on extracting data from a JavaScript table using Python

Looking to extract information from a table on this page: . There are a total of 18 pages, but the url remains constant for each page. My usual method involves using BeautifulSoup to scrape data from HTML pages. However, in this case, the required data is ...

Can anyone share best practices for writing unit tests for $scope.broadcast and $scope.$on in Jasmine?

Greetings, I am new to the AngularJs/NodeJs realm, so please bear with me if this question seems basic to some. Essentially, I have two controllers where the first controller broadcasts an 'Id' and the second controller retrieves that Id using $ ...

Custom markers in Angular Leaflet using geojson are a great way to

Can you create your own custom marker icons in GeoJSON? I have attempted various methods to achieve the desired result without success... Here is an example code snippet from a geojson FeatureCollection where I am trying to include a custom icon: { ...

When using node.js with MySQL, the insert statement with a WHERE clause does not execute properly

Snippet: function setValue(currentVal) { idOutput = currentVal; encodedVal = Base.encode(idOutput); var baseInsert = {ShortUrlCode: encodedVal}; console.log(idOutput); console.log(encodedVal); con.q ...