How test steps could be displayed for a test case in allure report for jasmine protractor framework

942 Views Asked by At

How can i show the test steps in allure report for protractorTest steps are not displaying as it displays for java language. Even the allure report official documentation does not show any code snippet for displaying the test steps of a test case in a allure reportNo any proper code implementation i guess for test steps to be displayed in allure report. I am using Jasmine framework with async await (promises disabled) with Javascript language. Kindly help, If anyone know about this?

2

There are 2 best solutions below

0
Sid On

Allure adapter for Protractor Jasmine doesn't have any feature as of now to record the test steps. Most of the Jasmine and Allure users like us are looking at this as a limitation.

As a workaround I'm using both these frameworks together with a different analogy. As per standard every describe block in Jasmine is a test suite and every it block is a test case. So in order to record the test steps I treat every describe block as a test case and every it block as test step. That way we can record every step as well as its execution details.

Hope this helps you. Let me know if you need more elaboration.

Regards,

Sid

0
DopplerDan On

There is a work around:

declare const allure:any;

This pulls the allure reporter constant. Yes, the 'any' makes me feel dirty but this works.

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

Creates a self executing function to create a step in the report by that name and executes the function fn;

As a sidebar, you also have these functions:

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