Coder Social home page Coder Social logo

Comments (5)

sriv avatar sriv commented on July 24, 2024 2

I suspect that the error in your project is getting handled somewhere and thus the project is not propogating an exception to gauge (which is something gauge needs to identify a failure, ex. assert will throw an exception on failure which gauge will analyse and report_

from html-report.

sriv avatar sriv commented on July 24, 2024 1

This is not a problem with html-report. Rather it seems that your tests are not getting marked as failed when the exceptions occur.

if you notice your console log, you'll see gauge sees all scenarios as passed.

Can you share what a sample project? or at least what is the implementation of the step where the error occurs?

from html-report.

sriv avatar sriv commented on July 24, 2024 1

Hi, some notes below:

The first thing a developer will think about is to handle errors with try / catch. You think that it is possible of an evolution to manage it differently ?

The norm AFAIK is that if you want the error to propagate, then you rethrow the exception in the catch block. Most testing libraries rely on exceptions to ascertain failure conditions. Take for example the junit assert. If you were to wrap assert in a try/catch, you'd notice that the tests are reported as passed even when the assert fails.

Even when I use the Custom messages in reports, it displays the error message in a step that is green (color) successful, which is paradoxical...

Gauge.writeMessage is a function that takes a string and puts it into the report. It has no sematic knowledge of what the string represents. The green colour is indicative of the fact that the scenario passed (i.e. no exceptions were passed on).

Gauge, by design, is framework agnostic and it relies on users to feed it the right inputs. I can understand this being a learning curve, but unless we tune Gauge to certain use cases, it will be tough to get this intelligence IMO. If you have ideas, please raise issues! It will be most interesting and helpful.

The reporting must be understandable by a non-technical person

I agree with this principle, but it is upto the individual writing the tests to bubble up the right contextual, domain specific message to the report.

from html-report.

zbrea avatar zbrea commented on July 24, 2024

Thank you for your quick response !
I put the same code in a new project created via gauge init, and suddenly the code works fine, it shows the error in the reporting.
Yet it is the same code, I do not understand the problem.
I am analyzing the structure of my old project and checking it with the pom file to find the cause of the problem.

Log in the new project for the same code:

Log2

from html-report.

zbrea avatar zbrea commented on July 24, 2024

Thank you very much for your tip, you are the best.
Eeffectively, I just deleted the try / catch, suddenly it works fine with a nice screenshot from my smartphone app. I'm very happy :)
It's been over a 2 weeks since I have been on this problem, I never thought that if I handle the error by myself, it will be ignored by .
I think you have to remember to take into account the errors handled by try/catch or throw.
The first thing a developer will think about is to handle errors with try / catch. You think that it is possible of an evolution to manage it differently ?

Here is an example of a method handled by a try catch :
image

Even when I use the Custom messages in reports, it displays the error message in a step that is green (color) successful, which is paradoxical, as following :
4

I want to display short messages with the Custom messages, but in failed steps like in "screenshot 0" in red color.
screenshot 0:
5

I prefer to display a short readable error from "screenshot 1" on my reporting html, than to have a long log like the one in the "screenshot 2" of the reporting .

The reporting must be understandable by a non-technical person (not a developer) !

screenshot 1 (Exception handled by try / catch) 👍 :
3

screenshot 2 (Exception handled by default by language, which is not understandable by a non-technical person)
ecran

from html-report.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.