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

xml report user messages #39

Open
jseckar opened this issue May 4, 2021 · 1 comment
Open

xml report user messages #39

jseckar opened this issue May 4, 2021 · 1 comment

Comments

@jseckar
Copy link

jseckar commented May 4, 2021

Describe the bug
I haven't found any way how to add an information into xml report ( tag) in dotnet. Console.WriteLine() writes message to console output but not to xml report. GaugeMessages.WriteMessage() also does not work (no console output, no xml output).

To Reproduce
Steps (or project) to reproduce the behavior:

  1. Initialise a gauge project
  2. Install xml-report
  3. Run the gauge command
  4. See error
$ gauge init csharp
$ gauge run specs

Logs
<testsuites> <testsuite id="1" tests="1" failures="0" package="C:\Users\Josef.Seckar\Documents\GaugeTests\my-tests\specs\Test1.spec" time="3.006" timestamp="2021-05-03T14:56:10" name="Specification Heading" errors="0" hostname="BRN-JSECKAR1"> <properties></properties> <testcase classname="Specification Heading" name="Power" time="3.006"></testcase> <system-out></system-out> <system-err></system-err> </testsuite> <testsuite id="2" tests="2" failures="1" package="C:\Users\Josef.Seckar\Documents\GaugeTests\my-tests\specs\Test2.spec" time="0.084" timestamp="2021-05-03T14:56:10" name="Specification Heading" errors="0" hostname="BRN-JSECKAR1"> <properties></properties> <testcase classname="Specification Heading" name="Voltage" time="0.084"> <failure message="Read voltage.&#xA;Step Execution Failure: &#39;Expected value to be between 4.5 and 5.5, but found 4.491639574752953.&#39;" type="Read voltage.&#xA;Step Execution Failure: &#39;Expected value to be between 4.5 and 5.5, but found 4.491639574752953.&#39;"> at FluentAssertions.Execution.FallbackTestFramework.Throw(String message)&#xD;&#xA; at FluentAssertions.Execution.TestFrameworkProvider.Throw(String message)&#xD;&#xA; at FluentAssertions.Execution.DefaultAssertionStrategy.HandleFailure(String message)&#xD;&#xA; at FluentAssertions.Execution.AssertionScope.FailWith(Func1 failReasonFunc) at FluentAssertions.Execution.AssertionScope.FailWith(Func1 failReasonFunc)&#xD;&#xA; at FluentAssertions.Execution.AssertionScope.FailWith(String message, Object[] args)&#xD;&#xA; at FluentAssertions.Numeric.NumericAssertions1.BeInRange(T minimumValue, T maximumValue, String because, Object[] becauseArgs) at testing.Voltage.ReadVoltage() in C:\Users\Josef.Seckar\Documents\GaugeTests\my-tests\Voltage.cs:line 18





`

Expected behavior
A text written by Console.WriteLine() (GaugeMessages.WriteMessage()) shall be displayed in <system-out> tag.

Versions:

gauge -v
Gauge version: 1.1.8
Commit Hash: b1501f4

Plugins
-------
dotnet (0.3.1)      
html-report (4.0.12)
screenshot (0.0.1)
xml-report (0.2.3)

**Additional context**
Add any other context about the problem here.
@sriv sriv transferred this issue from getgauge/gauge May 7, 2021
@sriv
Copy link
Member

sriv commented Jun 1, 2021

Console.WriteLine() should write to xml-report system-out tag. I could see this in a sample project.

If you have a project where this isn't working, I can take a deeper look.

GaugeMessages.WriteMessage does not write to stdout, and hence is not redirected to the xml-report's system-out tag.

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

No branches or pull requests

2 participants