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

directive in Angular pointing to a specific controller

I'm confused about where this error is coming from because I thought I had the syntax correct. An error of type TypeError: undefined is not a function was encountered. This particular error occurs in line 13 of the directive, where it says var refre ...

Disabling GPS with HTML5/phonegap: A step-by-step guide

Looking to create a function that can toggle GPS on and off for both iPhone and Android devices ...

A single element containing two duplicates of identical services

I am encountering an issue with my query builder service in a component where I need to use it twice. Despite trying to inject the service twice, it seems that they just reference each other instead of functioning independently, as shown below: @Component( ...

Error: Uncaught object in AngularJS ngRoute

I keep encountering an uncaught object error in my browser console while trying to load my AngularJS application. I am unsure if this issue is related to ng-route.js or if it's something else, as the error message only says 'uncaught object' ...

Why does console.log in JavaScript exhibit different behaviors as evidenced by the code?

Exploring the behavior of console.log(obj) compared to console.log("obj"+"\n"+obj) in the code snippet below reveals two distinct output outcomes. const obj = new Object() obj.first = 'John' obj.last = 'Doe' obj.alive = true ob ...

Binding arguments to child functions within Vue components

When working with React, it's a common practice to bind parameters for child components in the following manner: <Child onChange={e => doThing(complex.variable.inParentScope[3], e.target.value)} foo="bar" /> In Vue, I want to ach ...

Items seem to vanish into thin air and become immovable when attempting to relocate them

I am attempting to create a unique grid layout with 3x3 dimensions, where each grid item represents a fragment of a single image. These items should have the capability to be dragged and dropped inside another 3x3 grid, in any desired sequence. I have hit ...

Issue: subscribe function is not definedDescription: There seems to be an

I'm currently trying to retrieve a value from an array based on a specific element, and then finding the exact matching element. Unfortunately, I've encountered an error with this.getProduct(name1: string) function even though I have already impo ...

Enhancing Javascript with ES6 for nested for loop operations

Hey there, I have a question about converting a nested for loop into an Array map/ES6 way. How does that work when dealing with nested for loops? for (var i = 0; i < enemy.ships.length; i++) { for (var n = 0; n < enemy.ships[i].locat ...

Selecting a value from a populated dropdown and checking the corresponding checkbox in SQL Server

There are 8 checkboxes in this example: <table style="border-collapse: collapse; width: 100%;" border="1"> <tbody> <tr style="height: 21px;"> <td style="width: 25%; height: 21px;"><strong>Technology</strong& ...

Analyzing JavaScript performance without causing your browser to crash

I recently experimented with profiling code and found that the most convenient method, at least on Firefox, was to utilize either console's time/timeEnd functions or profile/profileEnd methods, so I gave both a try. The issue I encountered was the li ...

Guide on Generating Dynamic JSON to Set and Retrieve Values for Forms and Displaying the Bound Values

I'm a beginner in Ionic 3 and I'm having trouble creating a page that redirects to another page without validation. I want to display the data on the new page, but it's not working. Please help! I also want to create a dynamic JSON object a ...

Tips for accessing every "results" (parameters) from an API

Here is the response I received after making an API call in my attempt to retrieve each "bloc" result using a .forEach. const app = express(); const axios = require('axios') jobList = []; app.get('/getAPIResponse', function(req, res) ...

Encountering a problem with the Ionic Modal Slider: unable to locate the matching element associated with delegate-handle= when using $

I am encountering a problem with my Ionic application that features multiple Angular controllers. Specifically, I have a LoginCtrl and RegisterCtrl controller set up. The issue arises when I try to trigger a modal with a slider from the RegisterCtrl by usi ...

An error occurred while trying to convert a circular data structure to JSON during an API request within another

Attempting to make an API call within another API call in this code, however encountering the following error: Error: Converting circular structure to JSON const express = require('express'); const router = express.Router(); const config = requi ...

Having trouble locating an element on a webpage? When inspecting the element, are you noticing that the HTML code differs from the source page?

I'm having trouble locating a specific element on a webpage. When I use the Inspect Element tool, I can see the HTML code with the element id = username, but when I check the page source, all I see is JavaScript code. Does anyone have any suggestions ...

AngularJS - Create Alert Pop-Up for Missing Input Fields

I've been struggling to set up my app so that it displays an alert when the user attempts to submit a form with an empty input box. Despite having a confirmation popup working in another part of the application, I can't seem to figure out why thi ...

An Easier Way to Incorporate an Image Insert Button into CKEditor

Having trouble displaying the Insert Image button in CKEditor 4.1.1? Here's my current configuration setup in config.js: CKEDITOR.editorConfig = function( config ) { // Customizing default configuration here. // For more details, check: http: ...

Laravel triggers a 'required' error message when all fields have been filled

As I attempt to submit a form using an axios post request in laravel, I encounter an issue with the validation of the name and age fields, along with an image file upload. Here is a breakdown of the form structure: Below is the form setup: <form actio ...

Showing text instantly upon clicking a radio button, in real-time

I'm working with a set of radio buttons that are linked to numbers ranging from 1 to 24. I need to show the selected number in another part of the page when a radio button is clicked. What would be the best way to achieve this? ...