How to run a single Specflow scenario in Resharper - bdd

I am using Specflow (http://specflow.org/) to write some integration tests and I would like to run a single Scenario. Is there any way to run a single scenario with Resharper 6? BTW I configured specflow to use MSTest.
My Specflow test looks like:
Feature: Customer management
Scenario: Add a new Customer into system
Given the User has entered the customer with the following data
| name | last_name | birthday |
| Peter | Stein | 12.09.1955 |
When the User has pressed the Save Button
Then the following customer should be stored in the data base
| name | last_name | birthday |
| Peter | Steim | 12.09.1955 |
Scenario: Second scenario.....
Scenario: Third scenario.....
I want to run only the first scenario.

If you are running with ReSharper as I am I just open the Feature file the right-click anywhere within a Scenario and select "Run Specflow Scenarios" from the pop-up menu. It runs just the one scenario you are in.
Please note, I am using ReSharper to run the tests.

what i do is pop open the generated c# file and find the generated test there and use my keyboard shortcuts i have set up for the resharper test runner to execute the specs (and could use the green/yellow balls with the mouse too). it's less than ideal and i agree it would be awesome if you could just execute from the feature file. i haven't found anything like that out there. would be a worthwhile project to try to figure out a way to make that happen with a plugin. not sure what that would take.

Each Scenario should end up becoming one MSTest. In ReSharper, I typically go into the Unit Test Explorer (Control+Alt+U), make sure the Group by is set to Projects and Namespaces, then navigate down to my Acceptance Test project, open up the namespace for my feature (I group feature files in directories to put them in matching namespaces), and expand the feature to see all of the individual tests/scenarios. Selecting just one of those and clicking the Run or Debug button should execute that one test.

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

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.

Saving a new Base URL to a test suite

I created a test suite that has 57 different tests in it for one of my environments. Now, I would like to implement the test suite to 10 other nearly identical environments. I have already done a dry run in the second environment and it runs well, the issue is that I need to go through and manually change the base url for each individual test every time I open the suite.
Ideally, Id like to have "Environment 1 test suite", "Environment 2 test suite", etc. When I click on a test suite, it opens the tests with the base url for the corresponding environment. I tried saving the modified suite. I tried saving the individual copies of the test cases. I cant figure out how to get the new copy of test cases to stop reverting to the original base url when I close and reopen the suite.
You should use a properties file. Provide the URL in a variable and then use this variable to set the Base URL in your scripts.
To add a properties file, create a text file such as TestData.js containing your base URL:
baseUrl="http://www.boogiesite.com"
Now add this file to Selenium IDE using IDE > Options > Options > General tab > Selenium IDE Extensions > browse and select file TestData.js.
Reference:
http://selftechy.com/2011/06/30/parameterization-of-tests-in-selenium-ide
A similar previous SO question provides more answers:
selenium IDE - how can I change the Base URL for all my tests in one go

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