BDD Tests are not recognized in command level - mstest

I am trying to run Specflow BDD tets in command line and looks like it doesn't recognized those tests. But I am able to run them in VS IDE
Not sure whether there is a path issue.
I tried other options as in the below link as well. No luck though
How do you run SpecFlow scenarios from the command line using MSTest

The Problem was, that the code-behind files of the feature files were not generated properly, because the configuration of the unitTestProvider was missing.
See the documentation for that here: http://www.specflow.org/documentation/Configuration/

Related

No spec files found when running Cypress using scripts in package.json

I am trying to use script aliases in the package.json file.
In order for something like this to open the test runner,
"cy:open:prod": "cypress open --env ENV=production",
I run the command npm run cy:open:prod in the command line in the same folder that package.json is located.
The script runs and opens the test runner, however no spec files are found.
In all the examples I have found it describes this approach. Is there something I am missing in configuation to point it to where my spec files are?
Thanks in advance.
There is nothing basically wrong with the scripts in package.json, they look normal and would not cause the problem you mention.
I suggest you check the specPattern setting in configuration, it should match the naming convention you have chosen to use for your specs.
See e2e settings for more details.
Of you still have trouble with it, start a new project and let Cypress set the configuration for you, it will automatically match up the specPattern to the default value.

no executable code found at line intellij 14

I am unable to debug remote applications due to: No executable code at line
I am running ultimate edition of Intellij, version 14.0.3. My application is running inside tomcat 8 and i'm building it from the command line using Maven. This problem appeared after i switched from the community edition to the ultimate edition.
Project sources are the same and I am able to connect to tomcat for remote debugging. The only issue is that all my breakpoints are invalidated.
Please advice on how to fix this issue.
Cheers.
Remove all IDEA related project files and open the project by the .pom file.
I've had the same problem. Simply compile the directory that the class resides, and the debugger will pick up the break point.
I had the same problem and I implemented a similar solution.
Remove all IDEA related project files and open the project by the .pom file.
I use Gradle for my projecto, so i removed the project from intellij and then reimported it.
I hope others could read it and helps them
if you are developing an Atlassian plug-in and connected to the server via remote debug, run atlas-package to sync deployed plug-in and your source code.
If you are running a maven project execute the following commands in cmd prompt.
mvn clean install
mvn compile
This will resolve the problem.
The solution that worked for me is much more embarrassing. I put the breakpoint on the wrong line.
You see two breakpoints, first one is working and the second one is complaining about "no executable code ...".
It turns out there really is no executable code, just a string.

Launching Ruby-Cucumber from IntelliJ (OSX)

I am in a new job and am using IntelliJ with Ruby and Cucumber.. all of which are new to me.
I have a working project based upon this project: https://github.com/jonathanchrisp/selenium-cucumber-ruby-kickstarter
So, from the command line, I run my project like this:
sudo cukesparse something
cukesparse is not my project but here is a quick description from github: "A simple command line parser to pass default and custom arguments into Cucumber with the power to define these as tasks in a config/tasks.yml file!"
(seems interesting enough to me)
So, from the command line I am able to execute this project without any problems. I am also able to "Build > Rebuild Project" without issue.
My question is regarding getting a Run Config to work. I have tried to go to Run > Edit Configurations, but have had no luck creating a config to start my run. When I try to click Ruby from the list of 'base configurations', IntelliJ doesn't seem to want me to pick it. The UI sort of doesn't respond.
I must be stuck with some obvious newbie booboo. Any tips greatly appreciated!
Which version of IntelliJ are you using? And do you have the Ruby and Base Cucumber plugins installed in IntelliJ? (From Intellij -> preferences -> Plugins). If not, the first step would be to install those.
Then you can create a run configuration by Run > Edit Configurations, selecting the required details. If you have further issues, a screengrab of your configuration (from Run > Edit Configurations) would be helpful.
I didn't ever get to the bottom of exactly what the issue was, but completely removing IntelliJ (using the comment from Jenny here: In IntelliJ on OS X, how do you clear out all global setting info, licensing etc. (external to any project)) and reinstalling with a very minimal plugin set fixed it. I basically only enabled the git plugin, then got the ruby plugin from the repository and no other plugins.
I did need to add the cucumber gem from the command line but that didn't turn out to be part of the problem. Something about the plugins I had selected was making some of the Run Configurations not function.

Running Mstest.exe without team foundation server.

I want to run tests in comman line using mstest.exe. Here is the command which I am trying to execute
MSTest.exe /platform:[x64] "/testcontainer:D:\Dev\tas\Tests.dll" /resultsfile:"D:\Dev\TestResults.xml"
But everytime I am getting error.
No Build Uri specified for publish operation.
For switch syntax, type "MSTest /help"
I am not using any teamFoundation server. How do I run this?
The /platform command line option is actually related to the publishing, not test execution (as described at http://msdn.microsoft.com/en-us/library/ms182489(v=vs.100).aspx). When you specify at least one publishing option, MSTest validates that the minimum required set of publishing options have been supplied.
Since you don't really want to publish, simply getting rid of the /platform option should fix the problem.

What command line arguments does Visual Studio use for running MsTest?

I'm trying to figure out which is the command line arguments used by Visual Studio when you run the MsTest tests, I guess it starts with:
MSTest.exe /testmetadata:%SolutionName%.vsmdi /testlist:
But I couldn't figure out how to fill the testlist parameter, because both the test list name and id get the following error:
The test list path 8c43105b-9dc1-4917-a39f-aa66a61bf5b6 cannot be found.
An error occurred while executing the /testlist switch.
I'm trying to figure out which is the command line arguments used by
Visual Studio when you run the MsTest tests
It depends on how do you run your tests from Visual Studio. See the following examples:
You are selecting some tests from the Test View window and run them
MSTest.exe /testcontainer:TestProject.dll /test:TestMethod1 /test:TestMethod2 ...
Your are running all the tests from the Test View window
MSTest.exe /testcontainer:TestProject.dll
You have filtered your tests by a category through Test View window and run this category
MSTest.exe /testcontainer:TestProject.dll /category:CategoryName
You have opened the *.vsmdi file and selected some TestLists to run
MSTest.exe /testmetadata:*.vsmdi /testlist:TestList1 /testlist:TestList2 ...
You are running Load or Ordered tests
MSTest.exe /testcontainer:LoadTest1.loadtest /testcontainer:OrderedTest1.orderedtest
You can combine the above examples (arguments) to create the MSTest command that suits on your case. The only restriction you have is that you cannot use the /testmetada and /testcontainer arguments together.
As for the TestList argument you just need to give as parameter the name of the list. If it is not found then your test list does not exist or it does not belong to the *.vsmdi you have defined on the /testmetadata argument.
I am sure that you have already done it, but you can check the following link:
MSTest.exe Command-Line Options
See following link. Even though this post is about msbuild. It uses exec task for calling mstest.
If you use /testlist you need to give metadata file.
You can use /testcontainer and give dll for your test project. It will run all of your tests.
/testcontainer:[file name] Load a file that contains tests. You can
Specify this option more than once to
load multiple test files.
Examples:
/testcontainer:mytestproject.dll
/testcontainer:loadtest1.loadtest

Resources