How to use swagger (swagger.yaml) to make API testing easier? - testing

I am using swagger for documenting my API. Now I want to write python test for end to end testing of the api. How will swagger.yaml file help me in this process?

You can use Swagger Codegen to generate Python API client, which comes with test files.
Here are some examples of test files auto-generated by Swagger Codegen
https://github.com/swagger-api/swagger-codegen/tree/master/samples/client/petstore/python/test
Then you can update the test files with the actual tests you want to conduct.

Related

How I can make the URL of my summary report public to share in Karate framework [duplicate]

I'm trying to get reporting working for Karate DSL, and it's proven a challenge because my team uses Circle CI instead of Jenkins. Cucumber reporting seems to only work for Jenkins.
I've had a look at this documentation, here:
https://github.com/intuit/karate/tree/master/karate-demo#example-report
https://github.com/jenkinsci/cucumber-reports-plugin
I was wondering if there is a circle friendly equivalent you could recommend? It'd be even better if the reports could be generated in the terminal. It's going to be a hard sell to convince my team to change CI tools just so I can implement a test framework.
Thanks!
Here's what I suggest:
If you follow the demo / doc instructions - you will get the HTML reports in say target/cucumber-html-reports, and this is "pure Maven and Java", no dependency on CircleCI at all so far.
Now all you need to do is somehow make these HTML reports accessible via the web. In Jenkins, there is an HTML Publisher Plugin. I am not familiar with CircleCI but a quick search suggests that there is a way to expose links to build artifacts.
Also note that when you follow the demo, Java JUnit XML reports would also be output to target/cucumber-reports. It looks like CircleCI has support for these which means that it should be able to derive the build pass/fail status and stats if configured right.
Also note that Karate now enables you to write custom reports: https://stackoverflow.com/a/66773839/143475

SOAPUI and testrail integration

Can anyone help me with the Integration of SOAPUI and Testrail. If there is any Youtube or any other tutorials please share
After execution of testcases from soapui the status should get updated in testrail
https://discuss.gurock.com/t/how-to-log-into-testrail-api-with-soapui/10849
Can u try this??
Also Test rail api is exposed.. you can take the code and convert that code in to jar put in to soapui/bin/ext folder. Now u write a groovy code to use that library
You might want to have a look at (Agiletestware Firefly plugin for ReadyAPI (SoapUI Pro).
It integrates with ReadyAPI and upload test results (including HTTP/SOAP request and response) into TestRail for each run of your tests in ReadyAPI.
Here is the link to the documentation: https://www.agiletestware.com/docs/firefly-docs/en/latest/
Disclaimer: Agiletestware Firefly is a commercial product and I'm a developer of this product

Running all Tests in Production Template in Shopware 6.3.5.2

We are building a shop for a customer on Shopware 6.3.5.2 and want to use tests to
ensure that core functionality is not broken by our customizations (static plugins)
write new tests for new functionality
There is Running End-to-End Tests but this seems to be for core development and uses psh.phar which is not available in the production template.
How should this be done?
edit
This question is meant a bit broader and concerns also Unit Tests.
Actually, you can use the E2E tests of the platform project - as Cypress itself doesn't care where to run the test against. However, as you already noticed you cannot use psh commands to run them. You may run the tests though the basic Cypress commands, setting your shop's url as baseUrl of the tests, for example via this command:
./node_modules/.bin/cypress run --config baseUrl="<your-url>"
It works with cypress open as well.
The only thing what may become troublesome is the setToInitialState command in most of the tests which takes care about the clean up of shopware's database using psh scripts, unfortunately. You may need to adjust it by overriding the command in order to reset the database of the Production template.
I hope I was able to help a bit. 🙏
There are actually two parts here:
ensure that core functionality is not broken by our customizations (static plugins)
write new tests for new functionality
re 1: For regression tests like this I would suggest end-to-end tests. Either test through the UI with tools like selenium or through the HTTP API (I don't know if the shopware API is sufficient for extensive regression tests).
re 2: Since plugins do not run on their own I would extract all relevant functionality into plain old PHP classes that are independent of shopware and test those in isolation. Explore if some of that functionality can be made visible through an API and test the plugin integration through this. Depending on the actual plugin you might have to resort to UI tests again.

Automation tests using Cucumber, SoapUI and Selenium

I'd like to use Cucumber linked with SoapUI and Selenium in order to create an automation functional test.
I only found one website about it, describing that first I have to create a SoapUI project and save it as a .xml file. Then I should include this file into the test project using Cucumber and Selenium.
My first question is what configuration do I have to do for that ? (in the pom.xml file when using Maven for example or in any configuration file for Jenkins)
My second and last question is : if I launch every night with Jenkins (let's say that as an example) my tests, do I have to launch first the SoapUI project and import it again in the test project to run my tests in a good way ?
Thanks for your answers
I think you can use REST Assured for you API testing.
Use cucumber for your BDD statement, use java for there step definition and REST Assured for all the API request stuff.
Wrap all your automation with well written Gherkin and you'll need no other documentation. Think about that. BDD (specification by example) is a requirements approach, not a testing approach.

How to export test suite from SOAP UI as .bat file?

I want to automate SOAP UI test suite running and for that I heard that we can export test suite as a batch program. I searched over internet about it but I didn't get any results on the same. Is it possible to export it into .bat file? If yes then can someone suggest me a way to do it?
The tests can be automated using soapUI tool. For that one needs to create a project which consists one or more test suite(s). Of course, each test suite contains one or more test case(s). A test case contains one or more test step(s) of different types like soap request, rest request, http request, groovy script, jdbc etc.
SoapUI saves a project as an xml file.
From the summary of the question, it appears that there is confusion for you or mixing different things together i.e., automating tests and executing them, and note that both are different.
Also exporting test suite is not related in this context and doesn't have impact on either automating tests or executing. And not sure, what caused you this confusion.
Automating Tests:
Project can be created if you have wsdl / wadl files for soap / rest respectively. More details can be found here. Also this resource will help to get started with functional testing using SoapUI.
Exporting Test Suite:
One can export a test suite from SoapUI project, but that will be of xml file again. This is mainly useful if you want to reuse the existing tests or move it to a different soapui project altogether.
Executing the Automated Tests:
Ultimately the goal is to execute the automated tests against the application under test and create the test report.
It is possible to run the tests in the following ways:
From SoapUI - the tests suites can be executed from SoapUI tool. Find more details from here. This method is useful when some wants to try the newly automated tests and make sure all his assertions are going thru after building thier test suite in SoapUI.
From Commandline - this method can be approached when some one wants to run the tests as part of Continuous Integration or do not wish to invoke SoapUI or run the tests headlessly both on windows and unix platforms. For this SOAPUI_HOME/bin/testrunner.bat or .sh scripts can be used. For more details see here.
Hope this clarifies or helps.