FitNesse: how to add a single test page to multiple test suites - fitnesse

how to add a single test page to multiple test suites?
Please note that I want to get the suite name in SuiteSetUp during the test run. Is this possible in FitNesse?

how to add a single test page to multiple test suites
You simply create a page under your suite and include the test page.
Not sure about the second questions, sounds like you're trying to do dynamic include and that's not possible.
I.e.
!include $mySuite
where $mySuite is defined in SuiteSetUp. At least I couldn't find a solution.
You might want to consider generating the data in the SuiteSetUp and use something like parametrized includes.
Personally I found them to work better with symbols.

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! :)

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

Jenkins - view results in web browser

My Jenkins job runs many tests that create log files. In case of failure, I want to look at the log of the failed test. I'd rather use Jenkins web-server to do it, even have a link in the email it sends me.
Is there any plugin that can do it? Or maybe another way?
You provide few details in your question, so it is impossible to give specific advice. In a general level: this is already possible. When your test framework creates JUnit XML files with test results, the test output can be included between the <failure> and </failure> tags. Usually test frameworks should take care of this automatically, so you are probably not using a test framework and are manually generating the XML files containing test results?
I recommend you adopt some test framework. It is usually well worth the effort.

How to make a FitNesse test require explicit running

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').

Resources