Teamcity - How to display Cucumber reports in teamcity? - cucumber

Hi I have my automation test running in Team city and I have cucumber reports generated in target folder.
I have passed target folder as my artifact. I can see my reports are getting generated in my target folder. But how can I see the cucumber reports integrated in Teamcity. I have seen that there is an option for Regression Tests Tab in team city but not sure how to configure. Since I am pretty new to team city is there a way I can get my cucumber reports displayed.
Any suggestions?

Most likely, you will want to use a plugin. There is a cucumber plugin for teamcity listed here:
Third-party plugins
TeamCity - prints Cucumber results in a format for interpretation by a TeamCity build agent.
teamcity_formatter - Compatible with Cucumber 2.
cucumber_teamcity - Tested with Cucumber 1.3.18 and TeamCity 8.x.
The links give some insight on the plugin setup. You can also install these plugins through the Teamcity GUI by navigating to Administration > Plugins > Upload Plugin Zip.

Related

Not able to execute selenium test cases via Azure Devops release pipeline

I am trying to configure and run selenium test cases from Azure Devops Release pipeline. I did configure Visual studio Test Platform installer followed by Visual studio test. However, while running the 'test task', its erroring out stating
2019-12-22T11:31:50.7602521Z ##[warning]No test sources found matching the given filter '**\*csproj'
Am I missing something here or not doing proper configuration?
My main test case is being written in .cs file and tried including it in path as well but still same error.
Can someone please guide me?
thanks,
Pankaj
You have to add the path to the assemblies - dll. cs files are not used here as they are not compiled.
Provide the search pattern in the Test files field
Example search pattern:
**\publish\Test.Project.Name.dll
!**\*TestAdapter.dll
!**\obj\**
Have you built your project? Since you said you can see only files which are .cs or .csproj. You should first build your project to generate .dll files which are used in your vstest test files.
You can add the Visual Studio Build Task above the Visual Studio Test Task, then choose your project(.csproj or .sln) in the Solution Tag.
After building, you will see the .dll files in your Artifact, then, as Jonah said, you need to specify the location of the .dll file in Test files.

Run integration tests after deployment in Visual Studio Team Services

I have added a release definition in Visual Studio Team Services to deploy an application to a Azure cloud service. I'm trying to run some integration tests after a successful deployment:
But unfortunately tests are not run:
Warning: No test is available in C:\a\301532a74\Build\Api.Web.IntegrationTests\Api.Web.IntegrationTests.dll. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.
Information: Additionally, you can try specifying '/UseVsixExtensions' command if the test discoverer & executor is installed on the machine as vsix extensions and your installation supports vsix extensions. Example: vstest.console.exe myTests.dll /UseVsixExtensions:true
##[warning]No results found to publish.
I have installed the NUnit Test Adapter (nuget package) for all projects containing tests (unit tests and integration tests). The weird thing is that I am able to run the tests as part of a build but not as part of a release.
I also tried to set the Path to Custom Test Adapters but it doesn't seem to make a difference.
What I am missing here? Is there a better way to run some integration tests as part of a release?
This is usually caused by the NUnit test adapter cannot be found by VSTest.
Usually, In "Build" environment, NUnit test adapter is restored in working folder by nuget, so VSTest can find it during the testing. But in "Release" environment, NUnit test adapter does not exist by default. So you need to update your build definition to upload the NUnit test adapter files to "drop" and the NUnit test adapter will be avaiable in "Release" environment after the artifacts is downloaded. Then you can set the "Path to Custom Test Adapters" to "$(System.DefaultWorkingDirectory)\" and try again.
If you are using your own build agent, you can also place the NUnit Test Adapter in a permanent path that the build agent can access and set the "Path to Custom Test Adapters" to it. Or install NUnit test adapter extension for VS on the build agent and enter "/UseVsixExtensions:true" in "Visual Studio Test\Other console options".
I have found a solution for my problem, based on Eddie's suggestions:
Step 1 - Copy all NUnit assemblies to the output folder of the test project (set the Copy Local property to True)
Step 2 - Create an artifact that will contain all files of the bin folder of the test project. This will contain not only the test assemblies but also the NUnit assemblies
Step 3 - In the test task, set the Path to Custom Test Adapters to the artifacts folder that contains the test assemblies and the NUnit adapters assemblies
That's it! Next time you create a release and deploy to any environment tests will be executed.
My problem was that i didn´t have a testrunner for NUnit installed at all, since I´m using resharpers testrunner.
Therefore my solution was as simple as adding the nuget package, "NUnit3TestAdapter" version="3.4.0", to my test project.
In visualstudio.com (VS online) "Nuget restored adapters are automatically searched for." and you need not/should not specify a path for "Custom Test Adapters"
- I don´t know if this also works for NUnit test adapter version 2.

Android Studio with Jenkins Integration

I guess many of you have performed here continuous integration of Jenkins with Android Studio.
I have performed the following steps:
Created a project from Android Studio.
Created a repository in GitHub.
Pushed the code base into the Github.
Configured Jenkins.
Now, my target is that whenever I perform some checkin operation of the Android code into the Github, then automatically Jenkins will create a build on the latest codebase.
I already have downloaded the necessary plugins that are required for Jenkins.
Can anybody tell me step by step how can I achieve the same, since I am not sure, how Jenkins will get the apk file that is getting created once Jenkins performs the build operation on the new codebase?
It is an old question, and may of no use for questioner, but it may help others looking for solution.
If you are looking for apk file then it is available in build path of workspace.
It looks like you are interested in CD part, then you can use "Google Play Android Publisher". It enables Jenkins to manage and upload Android app files (AAB or APK) to Google Play. please refer to following doc help from Jenkins:
https://plugins.jenkins.io/google-play-android-publisher/

analyzing changesets on checkin with teamcity

Our project uses visual studio 2012 with TFS, resharper, and teamcity. We are using MS build too.
We already have a CI build configured to run on every checkin with teamcity.
I'm looking for a way to get a report or warning (not a build failure) if anyone checks in a file with the string "debugger;" in it.
Any thoughts on how to do this? Is there a plugin or off the shelf tool that will do this? There are so many different tools available I'm not sure where to start.
Technically a custom PowerShell script will be able to do this.
I'm not sure what you're really trying to achieve. Why are you searching for files containing "debugger" in their content?

Testing using an upgraded VS2012 solution, but building in VS2010

So I've downloaded VS2012 RTM and upgraded my Coded UI test projects to the VS2012 versions.
The reason I have done this is because I was having issues with VS2010 Coded UI tools due to partial support of IE9.
So I ran the tests from my developer machine both locally and remotely (making use of the new Visual Studio agent tools), and the tests worked successfully. Presumably, the reason my tests now work is that VS2012 upgraded them so that they now work with IE9, right?
So - this is my problem. I want to automate these tests, by launching them from our build machine - but our build machine still runs on VS2010, and for the time-being this is not going to change.
So I checked in my new VS2012 Coded UI test solution into TFS and queued a new build - so the build machine built my solution. And the build was successful. All good there.
So, next I created a new test case in Microsoft Test Manager and associated with the ordered test list in my new solution. Then I launched the tests (using the existing VS2010 test controller) on my remote test environment (which has the existing VS2010 test agent tools).
But the tests failed - the same issues that affected my tests with the VS2010 Coded UI tests (due to lack of full support for IE9)
Why did they fail?
Do I need the new VS 2012 agent tools for my test controller and agents? Must I build my solution in VS2012?
Ideally, I don't want to have to install VS2012 RTM on my build machine - I want to do the minimum possible to get my tests working and automating.
Is there a way around this?
Your coded ui tests reference assemblies that come with VS installation or your agent's installation (the assemblies defininf the WpfControl, Mouse, Keyboard, Playback and other classes).
So if you run it on a build/test machine with older versions of the dll's the same issues are going to stay, the tests will not start using the newer fixed assemblies thatt were shipped with VS2012.
As a temporary workaround you can check what dll's you reference and make sure that the build process puts them in the same directory with your tests assembly. That way the lookup for them will find the in the current directory without using the /path and finding them in the VS installation directory.

Resources