Showing the test steps in an Allure report for a Jasmine Protractor framework test case

Is there a way to include test steps in an Allure report for Protractor? I am facing an issue where the test steps are not showing up as they do for Java language tests. The official Allure report documentation also does not provide any code samples for displaying test steps in a test case report. My test setup involves using Jasmine framework with async await (promises disabled) and JavaScript language. If anyone has insight on how to address this issue, I would greatly appreciate your help.

Answer №1

The current Allure adapter for Protractor Jasmine does not include a feature to record test steps, which many of us in the Jasmine and Allure community see as a limitation.

To work around this issue, I have come up with a different approach. I treat each 'describe' block in Jasmine as a test case and each 'it' block as a test step. By doing so, I am able to record every step along with its execution details.

I hope this workaround is useful to you. Feel free to reach out if you need further explanation.

Best regards,

Sid

Answer №2

Here's a workaround that might help:

const allure:any;

This code snippet retrieves the allure reporter constant. I know using 'any' is not ideal, but it gets the job done.

allure.createStep('This Step', () => { fn })();
async allure.createStep('Another Step', async () => { fn })();

This block of code creates self-executing functions to add steps with specified names to the report and execute the given function fn;

Additionally, you can utilize these other functions:

allure.addArgument('key','value');
allure.feature('Feature Name');
allure.epic('Epic Name');
allure.story('Story Name');
allure.description('Test description');
allure.createAttachment('name', dataObj, type);

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

Select a specific item from an array and reveal the corresponding item at the matching index in a separate array

I'm working on a project where I have a list of elements that are displayed using a ng-repeat and I am using ng-click to retrieve the index of the element in the array that I clicked on. Here is the HTML code snippet: <ul> <li ng-repeat=" ...

The CSS styling isn't being reflected on the button within the React component

Within my index.html file, where my React app is located, I have included a CSS stylesheet. Inside this stylesheet are the following CSS properties: #Webshop { background-color: white; height: 100%; width: 100%; } and #Webshop, button ...

What is the best way to notify administrator users when their accounts have exceeded the timeout period?

Working on the website for our high school newspaper, I've encountered a recurring issue on the admin page. Users are getting logged out after creating an article due to a time limit constraint. To address this problem, my goal is to implement an aler ...

What is the best way to postpone the loading of an image and show a loading.gif for a few seconds before it appears on the screen? (with the help of jQuery or JavaScript)

My dilemma involves two images: -loading.gif (a loading animation) -scenery.jpeg (the image I want to display after the loading process); Since scenery.jpeg is a small file, using the load() function will simply skip over loading.gif So, when I click t ...

How come my date computed property does not update reactively when changes occur?

I have a Date object in my data, and I need to convert the date into a string for a date picker component in Vuetify. The initial date is being read and displayed correctly. I am able to set the date as well - when I set a code breakpoint, I can see the ...

Dealing with multiple jQuery ajax requests - strategies for managing them

Whenever I click the button quickly while there is jQuery Ajax loading, it seems to get stuck. How can I manage multiple requests being fired at the same time? What is the solution for the following: Cancel/abort all previous requests and only handle th ...

Guide to implement a confirmation box in PHP

I recently set up a Joomla article and integrated the Sourcerer Joomla extension to include JavaScript and PHP in my project. Currently, I am developing a course purchase site where users can buy courses from owners and credits are deducted upon every purc ...

Contact form failing to deliver email notifications in PHP

Trying to implement a basic email function in PHP. Despite following the suggestions from similar questions, I am unable to send the email successfully. HTML <form id="contactMeForm"> <div class="formField"> <label for="senderN ...

Transform a single data point into pixels by converting its latitude and longitude coordinates

I am facing a specific challenge where I have hit a roadblock after conducting some research. The issue at hand is this: I am working with a raster image that has known dimensions (800 x 800 px) I have two points within this image with their pixel and g ...

jQuery breaks when working with ASP.NET forms

Essentially, it appears that using an ASP.NET page with the <form runat=server> tag can cause some jQuery scripts to break. To illustrate this issue, consider the following scenario: You have a simple webpage with only a checkbox, like so: <inpu ...

Error occurs while running NPM script

My current task involves updating the dependencies of a React application. One of the key scripts in this app is defined in the package.json file, which is responsible for generating a message bundle for each locale. "scripts": { "build:langs": "NODE_EN ...

Tips for saving JavaScript results to a form

Hey there! I'm looking to figure out how to save a JavaScript calculation within a form instead of just displaying an alert or outputting it on another page. Below is the JavaScript code I have for calculating prices. <script type="text/javascript ...

What is the process for clearing the input value of a View from another View?

My situation seems simple and straightforward, yet I am struggling to achieve the desired output. In this scenario, I have two HTML pages named Index.htm and Main.htm, as well as a script page named mscript.js. Index.htm contains a button (Clear), and Mai ...

Having trouble making changes to MUI TextFields once they've been filled in with data from an

My goal is to make MUI TextFields editable even after they have been filled with data from an API. The TextFields are getting populated successfully. I attempted using an onChange function, but it only allowed one additional character to be entered befor ...

Locate the position of an element within an array using AngularJS

Consider the following array: $scope.records = [ { "Name" : "Alfreds Futterkiste", "Country" : "Germany" }, { "Name" : "Berglunds snabbköp", "Country" : "Sweden" }, { "Name" : "Centro comercial Moctezum ...

Is there a way to transform the searchParams function into an object? Changing from URLSearchParams { 'title' => '1' } to { title : 1 }

Is there a way to convert the searchParams function into an object, transforming from URLSearchParams { 'title' => '1' } to { title : 1 }? I need this conversion to be applied for all values in the URLSearchParams, not just one. Cur ...

Json encode is not initialized

I am facing an issue with a simple ajax request that retrieves a json encoded array. The error message I keep receiving is that the response is not defined. I suspect I have misplaced the return statement in my function. Here is how the function looks: // ...

The accumulation of input using setInterval is not effective

I need some help with my code. Please take a look at this link here. I want the input to count up from zero and hide when I click the "change" button. But when I show the input again, I want its value to reset back to zero. Can anyone guide me on how to ...

Most effective method for detecting null or undefined values

Curious to know, what is the most efficient method for verifying if something is null or undefined within JSON arrays or objects in general? I have been utilizing if (value !== null && value !== undefined) { // Value isn't null or undefine ...

Exploring the functionality of buttons within jQuery Impromptu

My current project involves creating a survey composition tool. The main focus is on having a preview button that displays the values inputted by the user. <!doctype html> <html> <head> &l ...