Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logger improvement possibility #29

Open
JoanEsquivel opened this issue Oct 1, 2020 · 2 comments
Open

Logger improvement possibility #29

JoanEsquivel opened this issue Oct 1, 2020 · 2 comments

Comments

@JoanEsquivel
Copy link

Hi @hdorgeval
It is a pleasure to me to be here again!

I have an amazing idea(that may be impossible) but in case it is possible to implement, might be so good.

I have been trying this package https://www.npmjs.com/package/testcafe-reporter-html-logger-custom and it has a "log" function to get steps in JSON and then get them printed out in HTML.

Just wondering if something like that can be mixed with the logic u use with this package.

Appreciate you read this and hope you are fine.

@hdorgeval
Copy link
Owner

Hi @JoanEsquivel, I will have a look to this reporter and see what I can do for you.

@hdorgeval
Copy link
Owner

Hi @JoanEsquivel , I think I understand your requirement.

I have developed in the past a static analyser of testcafe feature files that was able to extract steps from test method like this:

test("Scenario: scenario example", async () => {
  // Only on devci
  code omitted for brevity

  // Given I signed in the App
  code omitted for brevity

  // When I enter my name
  code omitted for brevity

  // And I enter my email
  code omitted for brevity

  // Then I can send my feedback to TestCafe team
  code omitted for brevity
});

You can have a look at : https://github.com/hdorgeval/testcafe-static-analyser

I think this approach is even better than the one provided by the testcafe-reporter-html-logger-custom because you do not clutter your test code, and the benefit is that you increase clarity of your test code by just inserting Given/When/Then comments, and those comments will be automatically converted to a Gherkin step in the final report.

The only limitation is that when a test fails you will not know at which step it has failed.

Please tell me if my analysis is good and if this is what you are looking for.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants