Perform a sequence of test functions to display as individual tests on BrowserStack

I am faced with a challenge in my web application where I have a series of functions that simulate login and run through various features. These functions are written in JS using nightwatch.js and selenium via browserstack. The issue is that all the functions report as one large test in browserstack. Is there a way to make each function report as a separate test in browserstack?

this.Settings = function(browser) {
         browser

         .url(Data.urls.settings)
         .waitForElementVisible("div.status-editor .box", 1000)

         Errors.checkForErrors(browser);

         browser.end();
};  

this.TeamPanel = function(browser) {
        browser

        Errors.checkForErrors(browser);

        browser.end();
};   

Answer №1

It appears that you are utilizing the same remote browser instance for all of your test functions, resulting in them being executed as a single test case on BrowserStack. To rectify this, it is necessary to create a new driver instance before each test function. This parallelization logic can be implemented within your framework or by utilizing a sample nightwatch framework such as the one available at https://github.com/browserstack/nightwatch-browserstack

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

I am looking for a sample code for Tizen that allows scrolling of a <div> element using the bezel

Seeking a functional web application in Tizen that can scroll a div using the rotating bezel mechanism. I have dedicated several hours to getting it to work without success. I keep revisiting the same resources for the past three days: View Link 1 View Li ...

Determining the length and angle of a shadow using X and Y coordinates

I'm currently tackling the task of extracting data from a file generated by a software program that has the ability to add a shadow effect to text. The user interface allows you to specify an angle, length, and radius for this shadow. https://i.stack ...

Changing a date string to MM DD format in React without using plain JavaScript

I'm familiar with how to handle this outside of React. My issue is that I have a date string coming from an API within an object, and I need to reformat it. The current format is "2022-12-13T06:00Z" but I want it to display as "December 13". The objec ...

Unable to reach a variable within the class itself

I'm facing an issue with my MobX store. In my Store class, when I try to access this.user.permits.db, I get an error stating that this.user is undefined. I am confused as to why I can't access the @observable user. src/ui/store/store.js file: ...

Sending parameters to async.parallel in Node.js

My goal is to create a simple example that demonstrates the concept I have described. Below is my attempt at a minimal example, where I expect to see the following output: negative of 1 is -1 plus one of 2 is 3 Here is the code I've written: var asy ...

Using either Javascript or jQuery, I want to set a value within an if statement

Can I set a value within an if statement, like this: if (a = jQuery("#user > .mask.fix > .a1").css('display') != 'none'){ b = a + 'hello'; //b=jQuery("#user > .mask.fix > .a1").css('display')+&apos ...

Display the returned view following an AJAX request

Currently, I am trying to search for a specific date in the database using ajax to trigger the function. However, I am encountering a 404 error when I should be receiving the desired outcome, and the ajax call is entering an error mode. Here is the snippet ...

Modify button behavior on click after the initial press

Struggling to make this work the way I want. I have a button that should execute Javascript function A when clicked, and in function A, I need to change the onclick attribute to function B. This way, on the second tap of the button, it will trigger functio ...

Integrate the dForm plugin with a convenient time picker widget

Currently, I am attempting to integrate a time picker widget into a jQuery plugin called dForm. The specific timepicker widget can be found at the following link: https://github.com/jonthornton/jquery-timepicker Despite reviewing the dForm documentation, ...

Uploading PDF files using PHP without the need for traditional input boxes

Currently, I am utilizing a JavaScript code to add annotations to a PDF document within the browser. Once I have completed adding annotations, I save the modified document on my device and then proceed to upload it using another form. However, my goal is ...

Launch the webdriver on an existing Firefox browser session

I am seeking guidance on how to launch Selenium WebDriver in a new tab of an existing Firefox instance. The reason for this is because whenever my Java program (WebDriver) opens Firefox, I need to set profile parameters in my code. This requires me to log ...

Two states each offering a distinct perspective

I am currently working on modularizing my application using angular-ui-router to create a website with two states: main and checkout. In the main state, I want to have multiple "section" tags defined as ui-view items. However, it seems like there is an iss ...

Discovering a URL within the text of an email in Gmail using Python 3

I am working on a program that can automatically read emails and click on hyperlinks within the email content. A taxi company sends job contracts via email with a link that needs to be clicked immediately upon receipt. To accomplish this task, I am utili ...

What is the recommended element for managing data in React?

Let's consider a scenario where we have 2 main components: class App extends React.Component { state = { comments: [1, 2, 3, 4] } render() { return ( <Comments /> ) } } class Comments extends React.Component { rende ...

Unable to create new tab using selenium with Java in the updated Chrome version 65.0.3325.162

Here is the code I have written to create a new tab, open a new window, and switch back to the default window. CreateNewTab: jse.executeScript("window.open();"); Switch to OpenNewWindow: defaultWindowName = driver.getWindowHandle(); for(String winHandl ...

Creating a unique Angular filter involves combining different techniques and functionalities to tailor

Hey there! I'm just diving into the world of Angular JS and I'm looking to filter any Twitter text that comes back containing a hashtag, and turn that word into a clickable link. For example: If the returned twitter text is "The quick brown #f ...

JavaScript Bug Report

Currently, I am immersed in a project that encompasses various languages like HTML, JS, and PHP. While working on one of the PHP functions, I stumbled upon an unexpected anomaly. To dissect it better, I decided to break it down into simpler functions: &l ...

Learn how to increase spacing in React applications

I'm currently utilizing the Grid component from @material-ui to present my data. Within this Grid, I have several nested grids, each representing a different section. I've implemented the container spacing attribute of the Grid and set it to the ...

How can you prevent an element from overflowing when employing window.pageYOffset and using a switch case to alter the background color at specified pixel thresholds?

I want the <body> element's background-color to change every 500px as I scroll down. I've scoured the web for answers, but still can't figure out what's going wrong. Please review the code. However, Firefox Browser indicates that ...

Is there a way to make an accordion close from a nested component in react?

I'm in the process of developing a page to update product information on an e-commerce platform using NextJS. On the individual item page, I have structured the image upload section within an accordion. After the images are uploaded, I want to reset t ...