Don't print code in Selenium HTML report - python-3.x

In HTML report when a test case fails I don't want the code to appear in the report, only the statements needs to be printed (example of problem). Can anyone help me out here?
I am using Python 3.6, pycharm and generating HTML reports with the help of pytest-html.

Use try and except with in your code and may be include something like below
raise NoSuchElementException("An Error has been registered")

Looking at the documentation under 'Modifying the results table'
https://github.com/pytest-dev/pytest-html
It seems like you should be able to modify the output, which also includes removing. I would suggest trying this approach because the only requirement you have is not displaying the exceptions in the HTML output.
Avoid using try-except constructions in such a way that it suppresses the stacktrace in general, as this will make debugging failed test cases harder to do.

Related

Issue with viewing data transformation with PyTorch

I am currently trying to process data for a simple network. This is the code I entered:
Screenshot here
I keep getting this error message but can't find any syntax problems or anyone else with this issue, I'm guessing it's something to do with my vienv because I've seen tutorials of people with no issues and that exact code. It's possible I haven't imported a package into my IDE and I am using anaconda and PyCharm if that helps.
Anyway, this is the error message I keep getting.
Error Message
You need to use transforms.ToTensor() instead of transforms.ToTensor when passing to transforms.Compose.

Tasty xml *and* html generation?

I would like to use both tasty-ant-xml and tasty-html simultaneously. However,
defaultMainWithIngredients (antXMLRunner:htmlRunner:defaultIngredients)
Doing this and supplying both --html and --xml options at the command line seems to only use the xml output. Is there a way I can get both (and ideally also output to the console as usual) without running the test suite multiple times?
You should be able to do this using composeReporters. I haven't tried it, but something like this should work:
defaultMainWithIngredients
(( antXMLRunner `composeReporters`
htmlRunner `composeReporters`
consoleTestReporter
) : defaultIngredients)
(and if it doesn't, please open an issue)

Karate + Cucumber report missing Doc Strings for the called scenario responses

Cucumber report is missing the doc strings for the responses from a called scenario.
in a given scenario, i am calling multiple scenarios using Call ()
its printing randomly sometimes response from the called scenarios and sometimes not. This is preventing us visualizing the data flow between API in the test report.
Although the karate-log is having the response from that called scenario, its just the cucumber reporting is not printing it. we are using karate 0.9.4, cucumber reporting 4.6.0.
When statement not printing Doc String
I am trying to print it like this.
When Statement with Doc string
Please try with 0.9.6.RC3 - if it still doesn't work it is a bug and please follow this process (we need a way to replicate): https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

Scenario.write on Cucumber Java- HTML Reports

Could anyone help me on this issue?
If I use scenario.write, It is not going to a respective step. for example, if
I use scenario.write in #When it is going to next step that is under #Then.
Do you know why this is happening????
Screen shot of my code and report:
This is Bug in Cucumber.io version whereas info.cukes library is working as expected
Logged defect(#1349)in https://github.com/cucumber/cucumber-jvm/issues

Read Jenkins build console output and set email content

I have certain errors which I set in my code, which should add corresponding error messages to the email content of the final build email.
I was thinking of printing something such as ("EMAIL CONTENT ERROR: _______") to the console, reading through it (in a pre-send groovy script?), and adding corresponding error messages for each error found.
I was thinking of using a pre-send groovy script, setting the mimeMessage object(was reading jenkins email-ext documentation). Would this be viable?
Also, I have never used groovy before, so pointers to how to approach this would be extremely helpful(or a link to where i can find an implementation of something with a similar idea of reading console). Any advice would be greatly appreciated. Thanks in advance!
Can you check attaching "Build Log" This would highlight all the process of build process.
This is a very similar concept to the question here. The technique there was to use the log parser plugin to scan the console output for you, and then use groovy to add all the errors into an email.
This is generally a pretty good idea because it also means that you can view the same set of highlighted errors from jenkins itself, rather than just the email.
There are a couple of ways this is different from your setup, the main points are:
Yes, write errors directly to the console in a known format
Set the log parser up with regular expressions that find your error format
Instead of a pre-send script, in this case you would use a groovy template for your email generation
The template reads the error list from the console parser and adds them to your email. Each one is a link that links back to the jenkins console output.

Resources