Testcase selection in CPPUnit - cppunit

Is it possible to select which test cases to run in CPPUnit like it is done in NUnit? May be using some config file?
Thanks, Rakesh.

You can use the MFCTestRunner if you're looking for a GUI where you can click to select tests.
You'll have to edit your test main application if you want to select which test to run via config file. See this answer that might serve you with a description of how to do it.

Related

Is it possible to skip dynamically one of the Cypress tests - meaning one feature file and with its step definitions?

I've a list of features files and the list of the related step definitions. Every feature file refers to some specific functionality of the website.
According to some environment variables defined in package.json and representing the theme of the website, I might need to skip entirely some of the feature files (and obviously their step definition), due to missing feature for some specific theme.
To give some code examples:
"test:cy:run:daylight": "PORT=9000 CYPRESS_THEME=daylight cypress run",
"test:cy:run:darkness": "PORT=9001 CYPRESS_THEME=darkness cypress run",
feature files list:
daylight.feature
afternoon.feature
evening.feature
night.feature
with the relative definitions:
daylight.spec.js
afternoon.spec.js
evening.spec.js
night.spec.js
So in case of CYPRESS_THEME=darkness I would like to skip entirely from my testing process the features evening.feature and night.feature
How to do that? Ideas?
This example is with fake data, my real scenarios includes many more features and themes, so unluckily splitting test in different folders or using Cypress tag is not an efficient option.
Another not efficient idea I am thinking of is to put conditionals in every step definition Given, When and Then with the help of the detection of the Cypress.env('THEME') but obviously I would prefer not to follow this approach.
Anything else? Thanks
The correct answer would be to tag the tests and run only specific tags... if such a feature existed. I believe #mosaad is wrong on his second point; the --tag command line parameter merely adds meta data to the run from what I understand. It doesn't restrict which spec files get run.
If I were you I'd just try to get creative with your folder structure. Alternatively you can implement this person's workaround, which seems a bit heavy to me but probably gets the job done.
You can split tests into 2 folders and run only the files in this folder
cypress run --spec "cypress/integration/daylight/**/*"
Or you can use tags and run tests with the correct tag
cypress run --record --tag "daylight"

Azure DevOps Test Case Questions

I have a couple of things I have been trying to work out with no success.
I am using Azure DevOps in the cloud not locally.
Is it possible to simply paste screen captures into Test Case Steps.
When running manual test cases the Runner header displays an icon to Show Description, where do I enter this description in the test case, I have tried the Summary Tab Description with no success.
Image of description issue
Andy put me on the right track, I had to extract the process associated with my project then modify the TestCase.xml. I had to change the FieldName from using Microsoft.VSTS.Common.DescriptionHtml to System.Description
Q1: Is it possible to simply paste screen captures into Test Case Steps.
No, copy/paste screen captures is not supported in Test Case Steps, we can only attach the screenshots as attachments.
Q2: Where do I enter this description in the test case, I have tried
the Summary Tab Description with no success.
Yes, you can enter the description in Summary Tab, make sure you have saved the test case after entering the description. Tested on my side and everything works as expected.

Modx script after package installation

I need to write a plugin that needs to create table in database and some setting from installation form. I can easily create form but I have difficulty to run the script after installation to read options and create table. Is it possible at all to run such simple script or maybe you need to create everything like for example models, vehicles and so on?
I would appreciate if anyone could give me directions how to do it. Modx documentation is not clear about this and https://github.com/splittingred/Doodles/tree/production sample repo contains multiple elements I'm not familiar with and I believe don't need at all
Typically you'd use a resolver to run code after the install.
While in the question comments the setup options are discussed, the package attributes there are actually executed to generate the setup options form, not to process the results.
The docs are a tad dated (mostly the screenshots), but Creating a 3rd party build script explains the different parts of a build script, and what they're for, with a fair bit of examples.
The piece you're looking for is this:
$vehicle->resolve('php',array(
'source' => $sources['resolvers'] . 'setupoptions.resolver.php',
));
You'll need to have a $vehicle (perhaps from a category or other object you're adding to the build) and the file in the provided location. Inside the resolver file you can use $object->xpdo as an instance of the modX class to do your thing.

Zephyr to Test Rail migration - Is it possible?

We are currently looking at Testrail as an alternative to using the Zephyr plugin within JIRA as Testrail looks to give us better test case and reporting management than Zephyr does.
Currently faced with the usual problem when changing tools of how to migrate our existing test cases from one to the other.
I know there are importer tools to get Excel spreadsheet cases into Testrail, so that is ok.
The problem I'm facing is how to get the test scripts out of Zephyr.
Does anyone know of any similar plugins to export test cases/scripts from Zephyr to Excel?
I've tried using the inbuilt export function, but it only seems to export the basic case details, not the individual test steps.
Any help greatly appreciated.
the inbuilt export definitely exports the test steps. I am looking at my own exported test cases with test steps right now in xls and csv formats
However the export has many many columns, the test step part is easy to miss.
In my XLS the test steps are in columns BF, BG, and BH. Of course yours are likely to be different, I am only giving you those column names as an example of how many columns you will have to scroll past.
XLS: For example test case EX-123 with 4 steps there will 4 rows merged together until the test steps col. So the "key", "Summary" columns will be 4 rows merged together..
CSV: The all the info is on the 1'st row.. and then at the test step column each test step has a row.
Just take a test case you know has steps, and start to scroll right through the columns and you'll see the steps .
Having done some further investigation myself, it appears there are multiple ways to extract parts of the tests from Zephyr.
If you use the 'Search' function to locate a test and then choose to Export via the Export button in the test case frame itself then you get a summary of the test information but WITHOUT the test steps.
If you use the 'Search' function to locate a test and then choose to Export via the Export button in the test case frame itself then you get a summary of the test information but WITHOUT the test steps.
If you use the Export button from the top of the window (there should be 'Share', 'Export' and 'Tools' buttons) you get additional options.
Selecting the option for 'Excel (All fields)' will extract full test case information, including all the fields.
A slightly quicker way to extract them is to Search for executed tests and from the 'Executed Tests Summary', select a test via the checkbox next to the test and select 'Export'.
This gives the option to extract the test information, including test steps, as CSV, XLS, HTML, XML or RSS.
As stated above, this is a large file and the test step information not readily apparent. (My steps were started in column CH!)
It is also worth noting that each line within the test step appears in a different cell, so importing to another tool will definitely require a lot of reformatting of the test step information.

How to rename a Testcase or Teststep using Groovy in SoapUi

I am re factoring large sets of tests in SoapUi.
Is there a way to automate creation and renaming of test cases/test steps through Groovy?
Thanks.
Possibly not what you're looking for but I've had some success manually editing the test suite xml using find and replace in a text editor. You need to be careful and make sure to back up a copy.
You can run Groovy code within SoapUI using SoapUI Groovy Console plugin. This way, you can change any property you want programmatically (within API constraints of course).
As for technical details on how to solve your actual problem, I can only refer you to this blog post and SoapUI's javadoc. Based on the blog post, you need to figure out what's given to you, and based on the API, you need to figure out how to achieve what you need.
In my case, I started with my project being bound as a project variable, and moved on from there.
There is really not so much information in the question about what you really need to achieve, but given the little you provided, one way to go would be to directly modify the soapUI project XML file. I have done this with some success in the past. The last I used soapUI, it UI did not come with massive refactoring functionality.

Resources