testcafe-reporter-cucumber-json icon indicating copy to clipboard operation
testcafe-reporter-cucumber-json copied to clipboard

Feature file steps not visible in html report

Open umerhamdan10 opened this issue 3 years ago • 15 comments

My steps are not visible in report. I just see my feature file name and scenario name.

Any one face same issue? I just se json don't have any information about the steps but have the scenarion information.

Help will be appriciated image

umerhamdan10 avatar Mar 10 '21 16:03 umerhamdan10

Same concern here, has it been designed this way? If so, can we do it on our own?

NHP95 avatar Mar 22 '21 10:03 NHP95

Hi @NHP95 and @umerhamdan10, it would be great if you could explain how you use this reporter: are you using it in a custom integration of cucumber with testcafé or just testcafé ?

Thanks!

hdorgeval avatar Mar 22 '21 22:03 hdorgeval

I integrate cucumber with testcafe.

https://www.npmjs.com/package/testcafe-reporter-cucumber-json

umerhamdan10 avatar Mar 23 '21 15:03 umerhamdan10

I used testcafe and gherkin-testcafe for the step definitions https://www.npmjs.com/package/gherkin-testcafe

On Tue, Mar 23, 2021 at 10:06 PM umerhamdan10 @.***> wrote:

I integrate cucumber with testcafe.

https://www.npmjs.com/package/testcafe-reporter-cucumber-json

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hdorgeval/testcafe-reporter-cucumber-json/issues/32#issuecomment-804979361, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHEOMGY3ZMXDAXMPT2OPCOLTFCU5ZANCNFSM4Y6L4RBQ .

NHP95 avatar Mar 23 '21 15:03 NHP95

I used testcafe and gherkin-testcafe for the step definitions https://www.npmjs.com/package/gherkin-testcafe On Tue, Mar 23, 2021 at 10:06 PM umerhamdan10 @.***> wrote: I integrate cucumber with testcafe. https://www.npmjs.com/package/testcafe-reporter-cucumber-json — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#32 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHEOMGY3ZMXDAXMPT2OPCOLTFCU5ZANCNFSM4Y6L4RBQ .

I am also using the same one

umerhamdan10 avatar Mar 23 '21 15:03 umerhamdan10

Hi @umerhamdan10 and @NHP95 , I have given a response in this issue

I think you might also be interested in this thread : hdorgeval/testcafe-reporter-cucumber-json#29

hdorgeval avatar Mar 23 '21 18:03 hdorgeval

so in short, the steps will never be visible?

On Wed, Mar 24, 2021 at 1:41 AM hdorgeval @.***> wrote:

Hi @umerhamdan10 https://github.com/umerhamdan10 and @NHP95 https://github.com/NHP95 , I have given a response in this issue https://github.com/wswebcreation/multiple-cucumber-html-reporter/issues/140

I think you might also be interested in this thread : hdorgeval/testcafe-reporter-cucumber-json#29 https://github.com/hdorgeval/testcafe-reporter-cucumber-json/issues/29

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hdorgeval/testcafe-reporter-cucumber-json/issues/32#issuecomment-805142247, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHEOMG43ONJ4TGY4IAWT473TFDOG3ANCNFSM4Y6L4RBQ .

NHP95 avatar Mar 24 '21 00:03 NHP95

Hi @NHP95, @umerhamdan10 , unfortunately there is no perfect and clean integration of Cucumber with TestCafé. TestCafé is an all-in-one tool (and it is a great tool) and not a library. This means it is not possible (at the time of writing this comment) to have a TestCafé feature file that is run by the cucumber runner. And because TestCafé has no notion of step inside a test function, you will not have any steps in the final json report.

This is why I suggested to infer these steps by injecting // Given ... // When ... // Then ... comments inside the test methods.

The JSON reporter is theoretically able to parse the source code of the test to extract these comments.

I would like to know if you really need something like this?

hdorgeval avatar Mar 24 '21 21:03 hdorgeval

Hi @hdorgeval, thank you for the reply and give the valuable information.

I did not get (This is why I suggested to infer these steps by injecting // Given ... // When ... // Then ... comments inside the test methods) this. How to do this.

Can you share example or your implementation.?

umerhamdan10 avatar Mar 25 '21 13:03 umerhamdan10

Hi @umerhamdan10 , it would be great if you could provide a functional github repo that shows how you use testcafe together with cucumber and the reporter, so that I can search for the best solution to inject the steps inside the json file report.

Thanks!

hdorgeval avatar Mar 27 '21 14:03 hdorgeval

For me, I used testcafe programming interface to create a test runner 'gherkin-testcafe' and then in the reporter function I passed in the 'cucumber-json'.

On Sat, 27 Mar 2021 at 21:40 hdorgeval @.***> wrote:

Hi @umerhamdan10 https://github.com/umerhamdan10 , it would be great if you could provide a functional github repo that shows how you use testcafe together with cucumber and the reporter, so that I can search for the best solution to inject the steps inside the json file report.

Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hdorgeval/testcafe-reporter-cucumber-json/issues/32#issuecomment-808743173, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHEOMG5THZYNY5CWMZPFCMTTFXU37ANCNFSM4Y6L4RBQ .

NHP95 avatar Mar 28 '21 03:03 NHP95

Hi, I'm also facing same issue! I'm using testcafe, cucumber and multiple-cucumber-html-reporter.

[ report_issue

MeghaKoshle avatar May 19 '21 18:05 MeghaKoshle

Hi @MeghaKoshle thank you for your feedback.

I would be happy to provide a solution, but for this, it would be great if someone in this thread could provide a working public repo that demonstrate the problem.

The root cause of what you report is that at runtime all gherkin syntax is translated into Testcafé syntax, because the final runner is TestCafé and not Cucumber itself; and in TestCafé world there is no notion of step.

By providing a working public repo, I can see what kind of information, the reporter can gather at runtime and therefore I can see what kind of solution I could provide.

Regards

hdorgeval avatar May 20 '21 17:05 hdorgeval

122158685-6c365c80-ceb0-11eb-8609-8b46c50e9ea0 @hdorgeval could you please have a look at this? https://github.com/damianszczepanik/cucumber-reporting

I was looking for a report with feature steps like mentioned in the provided url.

goelabhinav avatar Jun 16 '21 04:06 goelabhinav

A slightly aging issue thread, but one that is very relevant to me in my current project at the moment.

I understand that TestCafe has no notion of Cucumber/Steps and so gherkin-testcafe is - I assume - effectively converting the Cucumber to Testcafe; which Testcafe is then executing. And, as Testcafe has no notion of steps your reporter, which is embedding into Testcafe aslo has no notion of steps.

You mention, above, 'injecting // Given ... // When ... // Then ... comments inside the test methods' which would solve the problem; which I assume multiple-cucumber-html-reporter would then put inside 'Test Info' stuff. That is what I've been trying to work out how to do but cant find a way; be able to have a line reporter.info("This is runnin g in step xyz");

So, in a gherkin-testcafe solution, how do I write text to your reporter for inclusion into the generated json?

v-mwalk avatar Jul 14 '22 10:07 v-mwalk