How to make a FitNesse test require explicit running - fitnesse

Is there a way to mark a fitnesse test such that it will not be run as part of a suite, but it can still be run manually?
We have our FitNesse tests running as part of our continuous integration, so new tests that are not yet implemented cause the build to fail. We'd like a way to allow our testers and BAs to be able to add new tests that will fail while still continuing to validate the existing tests as part of continuous integration.
Any suggestions?

The best way to do this is with suite tags. You can mark tests with a tag from the properties page and then you can filter for the or filter to exclude them.
In this case I would exclude with "NotOnCI" tag. Then add the following argument to the URL:
ExcludeSuiteFilter=NotOnCI
This might look like this then as the full URL:
Http://localhost:8080/FrontPage?test&ExcludeSuiteFilter=NotOnCI
You can select multiple tags by splitting with commas, but they act as "or",Not "and".
Check the FitNesse user guide for more details. http://fitnesse.org/FitNesse.UserGuide.TestSuites.TagsAndFilters

Would it make sense to have multiple Suites, one for regression tests that should always pass, and another one for the tests that are not yet implemented?
Testers and BAs can add tests/suites to the latter suite and the CI server only runs tests in the former suite.
Once a developer believes he has implemented the behavior they can move the test/suite relating to that functionality to the 'regression' suite so that it will be checked in continuous integration.
This might make the status of a test/suite a bit more explicit/obvious than just having a tag. It would also provide a clear handover from development to test/BA to indicate the implementation is finished.
If you just want to have a test/suite not run during an overall run of a suite that contains the particular test/suite you could also just tick 'Skip (Recursive)' in the properties page of that test/suite (below 'Page Type').

Related

JIRA - [XRAY]- How to batch append tests from one existing test plan to another existing test plan

I have two test plans with a lot of tests. I want to select all in one test plan, and add these tests to another existing test plan, leaving the second with all the original tests plus the ones appended from the first.
When I select all the tests in the first test plan, there are options to create a test execution, a test set, but nothing to add to test plan (which is what you see if you are in the testing board)
I don't want to have to open each test individually and add it to the second test plan, as I already have them in a list in the first one. TIA.
You have two options to do what you are searching for, that is adding tests from one Test Plan to another:
Create a Filter that will have all the tests that you want to add and then add those using the Add Tests option like below:
Add those tests to a Test Set and then add the Tests to the Test Plan through the Test Set, like below:
Thanks, thats done it for me! :)

Automated Test Results - JUnit -> How to do ordinary grouping/formatting?

I am new around here, I have done a lot of googling, searching on this site and asking around and have not found a satisfactory answer.
I develop automated tests, UI as well as API. These are then run by TFS and the results are put into a JUnit xml document, which is then read by TFS. But alas the formatting is atrocious and leaves one unable to use the output for anything.
Vis:
There is no information about the Test Suite (which is there in the XML), the actual request sent (which is in the log) or response received and so one is left with absolutely no context to understand what has actually taken place (which request was sent, what test group/suite it belongs to and what any potential error was).
As far as I have been able to uncover, TFS simply has little to no support of proper test result formatting when it comes to automated testing. I am very surprised by this in 2018. Not even any documentation that allows me to develop my report structure/format in some kind of script.
What alternatives do I have? Can I automatically attach a generated HTML report somehow in TFS? Can I output more info anywhere?
You can group by Test Suite, Owner, Priority etc...
And you can double click the specific test result and navigate to the test run Summary to see more information there, also you can attach files there.
More information please see Review continuous test results after a build

SpecFlow scenario exclusion

I would like all my scenarios to run, but I'd like to tag some scenarios so they are only excluded when running in certain environments. For example, when a scenario has no tags I want it to run in all environments, but if I tag it with #dev I want it to be excluded from all non-dev environments.
Is there a way to use scope binding to achieve this or is it better implemented with execution flags on the test runner?
Other than flags passed to the test runner, I was thinking maybe a scenario hook would be possible, but not sure how to implement the exclude condition because once the scenario has started I can't find a way to abort it.
When using xUnit, Tags are translated into Traits.
With them, you can filter which scenarios you want to execute.
This runs all tests with the #dev tag:
xunit.console.exe ... -trait "Category=dev"
Brendan Connolly wrote a nice blog post about xUnit traits: http://www.brendanconnolly.net/organizing-tests-with-xunit-traits/
About aborting an already started scenario: This is not possible.

Query to get all test cases in a static test suite?

I am using VSTS to maintain our test cases.
I have created a test suite named Login Tests inside test plan foundation, which contains all the scenarios for login validation.
I want to add all existing test cases which are in Login Tests to my new test plan. Currently, I am manually copying and pasting the IDs in the search query,but is there any way where I can get all the test cases inside a suite.
No, there is no way to do as you describe.
However there is an easy workflow change that will allow you to do this. You have some manual work to get there, but once there things will be better. You should go through all of your Test Cases in the manual Suite and tag them with "tests-login".
Once done you can easily create Query Based suites anywhere with the correct list and control the list using the Tag.
Right Click the suit in the VSTS Test manager folder and Export to email you can select multiple suit and past in excel from email

Revert snapshot before or after each test method in a TFS build-deploy-test workflow?

I have a scenario that requires me to revert to a clean snapshot before or after each Coded UI test method is executed. I have researched using the TFS Lab Management API (see http://blogs.microsoft.co.il/shair/2011/12/22/tfs-api-part-42-getting-started-with-lab-management-api/) to revert to a specific snapshot as part of the TestInitialize and/or TestCleanup method, but I can only get this to work when executed locally. When executed on a remote machine I get errors authenticating to the TFS service.
My other option is to somehow do a 'foreach test in testrun' into the build process template (LabDefaultTemplate.11.xaml). I have identified the area that I think this would fit best, but cannot find any documentation on running a loop on each test.
Is this something that is possible, or is there somehow a built in method to accomplish this that I have overlooked?
To do what you propose you should switch to Release Management and create a separate test run for each of your groupings, in your case each test. You can use RM to orchestrate looping through each of your runs and executing then.
http://nakedalm.com/execute-tests-release-management-visual-studio-2013/
However running a UI test should not break your application and I would suggest that either your tests are way too long, or there is some flaw in the design of your application.

Resources