Using the Python API is there anyway to get the Test Run's Status? - kiwi-tcms

I currently have a python program which exports Test Runs, Test Plans, and Test Cases to CSV.
I am using the TestRun Model but I cannot get the information highlighted in the status column seen here. Is there anyway to get this information?
Thanks!

I currently have a python program which exports Test Runs, Test Plans, and Test Cases to CSV.
This is great. Please consider contributing your script under https://github.com/kiwitcms/api-scripts
I am using the TestRun Model but I cannot get the information highlighted in the status column seen here. Is there anyway to get this information?
Note: these screenshots are old!
There is no TestRun.status field, the status is only a visual property which is calculated by the UI based on the presence or absence of TestRun.stop_date field. If this field is null/None then the status is "Running", otherwise it is "Stopped".
In the current TR search page for example we query the TestRun.filter API with a
stop_date__isnull=True parameter.

Related

ADNStoreFront Multistore AddtoCartForm function crashing page

I am trying to modify an existing XML package of Aspdotnetstorefront Multistore. It's an internal XML package to show the variants of a certain product. What I did to start with was to copy-paste the whole code as is and throw it into a new custom XML package. The problem is that it works fine in the original package but not in the copied package. When I try to run it the function "AddtoCartForm" crashes the page and show the following error while display in red the line that contains the function call:
An HtmlHelper is required for this method. Make sure to specify one when you call the RunXmlPackage method
The format of the function is:
<xsl:value-of select="aspdnsf:AddtoCartForm(ProductID, VariantID, 1, 1, $SelectedSize, $SelectedColor)" disable-output-escaping="yes"/>
I removed the line with the function just to be sure and then everything else works fine. I have no idea what's wrong here. Everything is identical unless by the structure of the url which calls the package:
For the internal package it is: \product\123456
For the custom package it is: \topic\packagename?ProductID=123456
I checked the XML produced by the SPs, the runtime and requested data and it's basically the same in both cases. The ProductID and VariantID values are there. SelectedColor and SelectedSize are not in the XML (not even in the internal package) so it may be just providing null value and probably it's not necessary anyway.
And there is more. If I supress the productid value from the url like this:
\topic\packagename
It won't crash the page (but also won't render because there will be not be any value to process).
In any way I cannot see why it wouldn't work just passing the variable in the querystring (that is basically what it does in the original package even in a different format) and the var value (productid) it getting there. However it seems that it is indeed the url format that is not pleasing the package but it doesn't make too much sense to me. I am over this for several days already and nothing I do seem to produce any positive result. :-(
I looked up online for some documentation but didn't get lucky and didn't find absolutely anything. In extreme cases I try to reach the Vortx support (and they usually answers me giving some valueable clue) but this time it seems that for this specific issue there will not be any help unless I pay an obscene hour fee and unfortunately it's out of question... LoL!
Any idea?
UPDATE: We don't use Multistore regular search tool. Due to the nature of our products (recycled car parts) we have a custom search tool that will try to find 'similar' items that MAY fit the user needs when we don't have the EXACT part. I don't know if you are ware of but several mechanical car parts are interchangeable among different models and makes (like alternators, AC compressors, battery, suspension, cooling system, etc), so when one of our customers needs a part to fix his car he won't tell us the part code; instead he will tell us the car model, year, and generic name of the part so we will try to find the part for him. It does mean that a certain Corolla part will fit perfectly in a Honda Accord and so on. Some times we have some parts in stock that MAY fit his car but we are not absolutely sure. When it happens we will show those parts for the customer and he will decide if he can take his chances. For the sake of customer comfort we want to show all these parts in the same page, but since they normally are variants of different products we cannot use the regular product page for this purpose (because the product page will only show variants of ONE product at time). For this reason I am going to write a package - a modified version of the product page - that will do that but I am struggling with the AddtoCartForm function. In fact I JUST found a workaround by adding the item to the cart accessing directly the /shoppingcart/addtocart script and now my problem is being to force it return to a specific url after to add the item to the shopping cart...
The error has to do with the topic token able to properly get html helper filled out.
I do question why testing is being done on a topic. To test a new product xmlpackage I normally change change the xmlpackage for just one product in a testing environment.
If chaning the product xmlpackage isn't possible then I suggest using the XmlPackageController/engine instead. Which is documented on page https://help.aspdotnetstorefront.com/1000/xml_packages.htm under the heading of "Invoking XML Packages by Themselves". If using the XmlPackageController make certain that the allowengine attribute is set to true in the xmlpackage otherwise that will throw an error as well.

Behave print all tests to a text file

I have been asked to provide a list of every behave Feature and Scenario we run as part of our regression pack for a document to an external client (not the steps)
As our regression test suite is currently around 50 feature files with at least 10 scenarios in each I would rather not copy and paste manually.
Is there a way to export the Feature name and ID and then the name and ID of each scenario that comes under that feature either to a CSV or text file?
Currently our behave tests are run locally and I am using PyCharm IDE to edit them in.
I have found a roundabout way to do this.
Set Behave to export to an external txt file using the command
outfiles = test_list
Then use the behave -d command to run my tests as a dry run.
This then populates the txt file with the feature, scenario and step of every test.
I can export this to Excel and through filtering can isolate the feature and scenario lines removing the steps and then use text to columns to split the feature/scenario description from its test path/name.
If there is a less roundabout way of doing this it would be good to know as it looks like this is information we will need to be able to provide on a semi regular basis moving forwards.
You can take advantage of context.scenario to get scenario name and feature name and then write them into a text file.
You should put these code in after_scenario in environment.py so that you also can get the scenario status.
I am using this for export scenario name, status and feature name into a text file. Each will be separated by "|". I later import this file to a excel file for reporting.
Here is the code you can use for reference:
def write_scenario_summary(context, scenario, report_path):
try:
# scenario status could be [untested, skipped, passed, failed]
status = scenario.compute_status().name.upper()
feature = ReportingHelper.get_feature_name(scenario)
logging_info = '{status} | {feature} | | {scenario_name}'.format(
status=status,
feature=feature,
scenario_name=scenario.name)
print(logging_info, file=open(report_path, 'a'))
def get_feature_name(scenario):
feature_file_path = scenario.feature.filename
return os.path.basename(feature_file_path)
Hope it helps.

Cannot get query results using RabDB

I use a very specialized database called RabDB (http://www.rabdb.org). From the project website:
RabDB is a database created to explore the universe of the Rab family of small GTPases, key regulators of the Eukaryotic endomembrane system, predicted by the Rabifier classification pipeline in the sequenced eukaryotic genomes.
However, I run into a beginner problem: Upon submitting a query in the RabDB browser at http://www.rabdb.org/browser/profile, I only receive the following Response:
Error #9999. Please look under the table.
This is very easy to solve: You need to implement a transformer called "tiny turbo changer". It's based on series 2 and can be used starting from 6+.
Hope that helps.
Thanks!

How to integrate the Reporter.log("Login failed.") with custom testng report using the IReporter?

I have been trying to generate a custom testng report similar to the emailable-report.html which is generated by default in testng. In my test case, I have added reporter.log statement to check the flow of test execution, but these logs are not getting printed in the custom report.
Is there a way to integrate the log statement in the custom report ?
In order for the messages logged via Reporter.log() to show up in your test reports, you would basically need to retrieve them using Reporter.getOutput(result) (Here result is of type org.testng.ITestResult). Invoking this method you would get a list of strings which represents the output associated with that particular ITestResult object. You would need to dump these lines into your report.
For a sample, take a look at this section of the EmailableReporter2.java from TestNG.

Bugzilla: bugs are not showing up (show up in DB and everything seems to be fine)

I just installed Bugzilla locally and it seems that everything is fine. I can create new products and components. I can also file new bugs and they show up in the database.
But when I want to view them in the web interface, they won't show up.
Instead, at the top of the page this shows up:
Product: ARRAY(0x3735378 Component: ARRAY(0x4275650) Resolution: ARRAY(0x42755a8)
and then below the "Zarro Boogs found."
I couldn't find any information on that on the web, did anybody have similar issues? Thank you!
Please check the bugs table in techzilla database and verify if the bug details are getting updated.
The cgi file which corresponds to the listing of bugs is buglist.cgi.
Template file is:-global/message.html.tmpl
"Zarro Boogs found." is showing because, the values are not correctly entering in the query to display the buglist.
It is evident from the display,
Product: ARRAY(0x3735378 Component: ARRAY(0x4275650) Resolution: ARRAY(0x42755a8)
it is because of the looping problem.
check the display code in the template file or buglist file and correct the loop, then it will dsiplay properly
Jenifer,
Yes, It is because of the zero value in the query. We can check it, by printing the query and checking the value in DB.
Inserts a Named Query (a "Saved Search") into the database, or updates a Named Query that already exists..
We had similar problem. Bugs were not showing in search result list. The problem was in the name of the product when the name of the product was with diacritics (e.g. Czech, Slovak, etc...). When the name of the product is in US ASCII it is all Ok.

Resources