Guide on executing protractor suites with various users

I have a config file that I usually use to execute a single user and multiple test suites. However, I am currently facing an issue where I need to run certain protractor suites with User A and other protractor test suites with User B. I am unsure of how to accomplish this in protractor.

exports.config = {
  capabilities: {
    browserName: 'chrome'
  },
  suites: {
    loginAndNavigate: 'e2e/specFiles/LoginAndNavigateSpec.js',
    homepage: 'e2e/specFiles/policiesList_HomepageSpec.js',
    versionPage: 'e2e/specFiles/ER_VersionsPageSpec.js',
    policyDetails: 'e2e/specFiles/policyDetailsPageSpec.js'
  },
  seleniumServerJar: '../node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-2.53.1.jar',
  chromeDriver: '../node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.26',
  baseUrl: 'https://shared.qa.com/EdgeAuth/logindirect.jsp',
  params: {
    login: {
      user: ‘user ',
      password: 'abc123'
    }
  },
  onPrepare: function() {
    global.EC = protractor.ExpectedConditions;
    browser.getCapabilities().then(function(c) {
      console.log(c.get('browserName'));
    });
    global.Utils = require('./e2e/utils.js');
    require('./e2e/matchers.js');
    require('./e2e/customLocators.js');
  },
  framework: 'jasmine2',
  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 100000
  }
};

Answer №1

When executing the test, you have the option to input new parameters for both user and suite details.

To update the user details in the params object, use --params.login.user "User B" to override the configuration file settings.

For defining the suites to run, utilize --suite=loginAndNavigate for a single suite, or

--suite=loginAndNavigate,homepage
for multiple suites.

It is essential to use the appropriate combination of these options based on your requirements.

https://github.com/angular/protractor/blob/master/lib/config.ts

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

Unable to integrate multiple webpack projects: Uncaught SyntaxError occurs due to a missing closing parenthesis after the argument list

My website features a section where clients can track their projects. One aspect of the site involves viewing a blueprint created using THREE.js and bundled with webpack. I have been tasked with adding another type of blueprint to the site. I have success ...

Blurring isotopes within Google Chrome

While working with isotope in Google Chrome, I noticed that all items have the following CSS code: -webkit-transform: translate3d(properties); In Chrome, every even element [2,4,6,8,10,12,14...] appears blurred, whereas in Firefox everything looks normal ...

Using jQuery to automatically select a specific radio button after the load() function is executed

I'm trying to dynamically load radio buttons into a div using the JQuery load() function. However, I'm facing an issue when it comes to checking a specific radio button by its value. The problem is that the code doesn't seem to be working w ...

What are the best practices for managing user forms and uploading files?

How should data in text fields and file upload fields be handled according to best practices? This question is a more generalized version of one I previously asked, which can be found here. Let's consider the scenario of a user registering an accoun ...

Dealing with an Undefined Property: Troubleshooting Guide

Encountering an error message Uncaught TypeError: Cannot read property 'top' of undefined at VM32939 own.js:819 resulting from var hands_corrected = (hands_original.top + 680) this issue arises because "hands_original" is not used in any par ...

Ways to stop Google Places API from generating outcomes from a particular country

After carefully reviewing the entire documentation at https://developers.google.com/maps/documentation/javascript/reference/places-service#LocationRestriction, I am still unable to find a solution to my problem. I have successfully limited Google autocomp ...

Using React to Identify the Chosen Option on a Custom Toggle Button

I have successfully implemented a toggle switch using HTML and CSS in my React app. I am now looking for a way to detect the selected option whenever it changes. For instance, if OR is chosen, I would like it to be saved in the selectedOption state, and if ...

Attach a tab-icon to a picture

I am looking to add a tab to the bottom border of an image within a gallery. This tab needs to be right up against the image border with no space in between. When clicked, this tab should activate a small JavaScript function that will display the content ...

Retrieve the element within the existing element by utilizing XPath

Having a series of questions with multiple options within. Upon selecting the desired question element as question_element Having trouble accessing the initial text box within this element. I attempted question_element.find_elements_by_xpath("//textarea ...

Unable to exclude specific files using VSCode's "files.exclude" feature

In my workspace settings file, the configuration for excluding certain files is as follows: { "files.exclude": { "**/*.js": { "when": "$(basename).ts" }, "app/**/*.js.map": { "when": "$(basename).ts" ...

ag-Grid open-source server-side filtering

Currently, I am utilizing the ag-grid community version for my project. I am inquiring whether it includes support for server side filtering and paging. If not, what alternative methods can be used to implement filtering with the ag-grid community versio ...

What is the process for "unleashing" the X Axis following the execution of chart.zoom()?

After setting the scroll strategy to setScrollStrategy(AxisScrollStrategies.progressive), I noticed that my chart was scrolling too quickly due to the fast incoming data. To address this, I decided to set a specific initial zoom level for the chart using c ...

Using Javascript to dynamically add SVGs from an array

Having issues with displaying SVG images in a quiz I'm building. I have a folder full of SVGs that correspond to each multiple choice option, but I can't seem to get the pathway right for them to show up properly. I've tried using template l ...

What is the process for generating an array of objects using JavaScript?

I am struggling to create an array of objects using JavaScript and facing errors with new lines added where I need to split the messages and collect row numbers. The row numbers should be comma-separated if it is a repetitive error message. I found a solu ...

When trying to log the parsed JSON, it unexpectedly returns undefined even though it appears to be in good

Everything was working fine until a couple of days ago. Let's consider this as my PHP script: echo json_encode(array('stat'=>'ok')); I am sending an AJAX request to this script: $.post(base_url+'line/finalize/', {t ...

Repeater employs Endless Scrolling feature within DotNetNuke

I've integrated DotNetNuke into my custom module and I'm following the standard ASP.NET programming techniques (dragging/dropping). The project involves a posting service that uses a repeater with infinite scrolling and a masonry effect. I have f ...

Cannot render <Image> inside <Section> component

As a beginner in React, I am attempting to create an app following a tutorial. In my component, I utilized the figure tag but it's not showing up when inspecting element in Chrome. Here are the code snippets: The tutorial includes a div tag as a chil ...

Displaying just the initial ten items with AngularJS and dir-pagination-controls

<tr dir-paginate="plan in access |itemsPerPage: 10" total-items="planCount" current-page="current"> <td>{{plan._id}}</td> <td>{{plan.name}}</td> <td>{{plan.email}}</td> <td>{{plan.cont ...

Reset the checked state in React JSX to false by using a reset button

After attempting to reset selected radio buttons on this list, it seems like the change I made from {checked} to {user.checked} in input check is causing issues. This modification can be traced back to UserListElement.tsx In an effort to resolve this issu ...

Issues with retrieving the subsequent anchor element using Jquery Slider

(Apologies for the lengthy post. I like to provide detailed explanations.) Just starting out with Jquery, trying my hand at creating a custom image slider from scratch. Got the slider working with fade effects using this code: Javascript: $(document).re ...