I have an API Collection in Postman, and I have saved a few examples for each request.
When I try to save the Test Results though, only the JavaScript code is saved in the examples, and not the actual results (same goes for when exporting the whole API Collection).
Is there any other way I can do this to export the Test Results too?
as far as I know, you can't save test results but you can run test collection on Newman and save the result
Try creating a report, it will include all the results of your test.
You can install newman-reporter-htmlextra with the following command:
npm install -g newman-reporter-htmlextra
Then you can execute Newman with report enabled:
newman run xxxxx.json -r htmlextra
The resulting HTML report will be saved in newman directory on the current directory.
Related
I'm using TestCafe Studio to create my tests and executing the tests written in .testcafe format using the testcafe docker container. Further I'm using 'Drone' as CI environment.
Below is the command that I use to execute my tests
`- /opt/testcafe/docker/testcafe-docker.sh -c 3 chromium -q --skip-js-errors --ass`ertion-timeout 60000 --selector-timeout 60000 CommonScenarios/*.testcafe
When a test failure occur I will not get enough information about the test failure. For example below is an error log printed.
1) AssertionError: expected false to be truthy
Browser: Chrome 91.0.4472.124 / Linux 0.0
7
Is there any way that I can get enough details about which step is actually failing when the tests are executed in .testcafe format?
(When I ran .js format of the test it gives which line is failing)
This looks like a bug in TestCafe Framework. I opened an issue in the GitHub repository: https://github.com/DevExpress/testcafe/issues/6424. Subscribe it to be notified of updates.
As a simple solution, you can convert your *.testcafe fixture file to *.js. Also, there is a more complex workaround - it allows you to determine which step is failing:
Open the *.testcafe file in VS Code or some other editor. You will see that it looks like a JSON file.
Find an object with the "name" property whose value corresponds to your test name: "name": "Your-failed-test-name"
Look at the "commands" array. Find an object with the "callsite" property whose value is equal to the number that you can see in the error console output. This object specifies the failed step.
Note that the format of this file is intended for internal use, and it is not recommend to modify it manually.
I am doing mocha unit testing for my JavaScript functions. I am running mocha in a browser not using Node. I am using require.js to load files.
When I do mocha.run() it shows reports in the browser.
Now I want to make a Jenkins job to display the report.
So how do I generate the report file so that I can provide it to Jenkins?
Running the command:
$ npm install mocha-junit-reporter --save-dev
Will generate an XML file that you can give to Jenkins
Run the command
$ mocha ./test.js --reporter mocha-junit-reporter --reporter-options ./test-results.xml
For docker file use below command
CMD ["mocha", "./test.js" , "--reporter", "mocha-junit-reporter", "--reporter-options","./test-results.xml"]
Both command will do the same.
test-results.xml file be generate in the folder .
I am answering my own question, I have solve this problem by using NGINX server which is open source.
I have added form tag in index.html of mocha and wrote on function on submit form to run mocha suit, this will return you output , parse that output and make file of that according to your need like total success count, failure count etc. and gave to Jenkins.
As I am implementing an automated way to GUI test our webapplication with selenium I ran into some issues.
I am using selenese-runner to execute our Selenium test suites, created with Selenium IDE as a post build action in Jenkins.
This works perfeclty fine, as the build fails when something is wrong, and the build succeeds if all tests are passed. And the results are stored on a per build basis as HTML files, generated be selenese-runner.
My problem is however, that I seem to be unable to find a way, how to display these results in the respective jenkins build.
Does anyone have an idea how to solve this issue. Or maybe I am on the wrong path at all?
Your help is highly appreciated!
I believe the JUnit plugin should do what you want, but it doesn't work for me.
My config uses this shell script to run the tests (you can see the names of all my test suites):
/usr/bin/Xvfb &
export DISPLAY=localhost:0.0
cd ${WORKSPACE}
java -jar ./test/selenium/bin/selenese-runner.jar --baseurl http://${testenvironment} --screenshot-on-fail ./seleniumResults/ --html-result ./seleniumResults/ ./test/selenium/Search_TestSuite.html ./test/selenium/Admin_RegisteredUser_Suite.html ./test/selenium/Admin_InternalUser_Suite.html ./test/selenium/PortfolioAgency_Suite.html ./test/selenium/FOAdmin_Suite.html ./test/selenium/PublicWebsite_Suite.html ./test/selenium/SystemAdmin_Content_Suite.html ./test/selenium/SystemAdmin_MetaData_Suite.html
killall Xvfb
And I can see the result of the most recent test (you can see the name of my jenkins task folder)
http://<JENKINS.MY.COMPANY>/job/seleniumRegressionTest/ws/seleniumResults/index.html
Earlier tests are all saved on the Jenkins server, so I can view them if I need to.
I have created a python script which extracts some links from a website using beautiful soup. Now this python script writes an HTML code and saves it to an HTML file, say test.html. Whenever the user clicks refresh button on his Android app (created using jQuery Mobile), I want to display test.html in the app. How can I so this?
Instead of writing out the test.html file you should return it as the output of the python script. So your python script will sit on your webserver as an API. Your Android app will call the python script asynchronously and when the python script finishes it will return the test.html contents as a string to your app to display. If the python script takes a long time you may want to run it continuously on your server and then serve the results from a file.
Edited to add: Here is a post to send you down the road of setting up your python script to be accessible with an HTTP request. How to run python script in webpage
Edited again to add: Here is a post on asynchronous in Android : http://www.justinmccandless.com/blog/Now+in+Android%3A+Asynchronous+Web+API+Calls
Also documentation on HTTP calls: http://developer.android.com/reference/java/net/HttpURLConnection.html
How do I explicitly say with my go test command to run only tests for the main package and not others in my source directory.
At the moment it's working with $go test -v. But... I am using goconvey as well and it seems to be running recursively. According to this page https://github.com/smartystreets/goconvey/wiki/Profiles I have a file where I can pass arguments into the go test command. I know you can go test -v ./... for recursive or go test -c packagename/... but how do I just do it for the main?
Profiles is one to accomplish this, but you can also specify a 'depth' for the runner:
$ goconvey -depth=0
A value of 0 limits the runner to the working directory.
Run goconvey -help for details.