MSBuild email alert to list failed tests - msbuild

I'm using TFS, MSBuild and MSTest for automated build and test solution. When some unit tests fail; build partially succeeds and I get email just giving the error information.
Is there any way that I can customize the e-mail content? I want the failed test names and fail reason listed in the mail. Even the test result file as an attachment(1 MB) would do.
Thanks

There is a Jenkins plugin called "Email-ext plugin" link maybe that could help you. However, (I assume) you might need some kind of your own custom template to do what you want.
Example
You can attach a HTML page to your email, likewise you can customize as you want:
stackoverflow question

Related

How can I trigger a click from the console with Cypress?

I'm trying to run commands on cypress from the command line. For instance, selecting an element and clicking on it.
I'm trying to do this to try some tests without having to need to run all the previous steps at this point. I'm not sure if this is possible due to the sequential nature of cypress, but it would be really helpful if there was some way to do it. I assumed something like this would be possible from the developer tools console:
cy.get('[data-test="save button"]').click()
I'm aware this doesn't work, so I tried with now and then and some other weird strategies. Reading the documentation didn't help. At least the part I read. Any details are appreciated.
--- edit ---
The console is on the same chrome instance that contains the selector playground like shown in in the image below.

"How to get test run id from a specific release using TFS 2018 API"

We have a task in our release pipeline that runs Seleniumtests(Visual studio test task). The selenium tests run and we can after the run add an attachment to the testrun manually. We also manage to add an attachment with the api but we don't have a good way to extract the testrunid that is necessary for the upload.
How do we in a good way get the test run id from a release so we can bind the attachment to the right testrun. We only manage to get all test runs with the api, which is alot.
Where we want the attachment to be uploaded with the api
You can see test run id from the test log for a specific release.
So, the simplest way is getting the specific test run id with the REST API from the log.
GET https://{instance}/{project}/_apis/release/releases/{releaseId}/environments/{environmentId}/deployPhases/{releaseDeployPhaseId}/tasks/{taskId}/logs?api-version={version}
See Get task log for details.
EDIT Get Task Log v5
I am using the following API to get test results for the release,
GET https://{instance}/{project}/_apis/ResultDetailsByRelease?releaseId={RELEASE.RELEASEID}&releaseEnvId={RELEASE.ENVIRONMENTURID}
The test results included testRun ID or get failed tests only by using filter,
GET https://{instance}/{project}/_apis/ResultDetailsByRelease?releaseId={RELEASE.RELEASEID}&releaseEnvId=RELEASE.ENVIRONMENTURID}&%24filter=Outcome+eq+Failed

TFS Link testresult to Task

I have the next structure:
Bug
Dev task
Test Result with the failed test case
Tested by
For retest the bug I have created a RETEST task and link it to the bug. When I rerun the testcase I would like to add the passed test result to the RETEST task. How can I do? Or what is the best workflow?
You don't need to create a retest task for this case.
You could directly customize a workflow using States and Reasons for the Bug work item. Such as adding a state "Ready to Retest" for a Bug. And then assign this work item to the tester or tester group. Suggest you to use the Process Editor, available with the download of TFS Power Tools. The Process Template Editor provides a graphical user interface for customizing work items (field, workflow and the form) and process templates.
More ways for customize the workflow for a process please refer the tutorial from MSDN:
Customize the workflow for a process
Add or modify a work item type
Then you just need to directly link test result to the bug workitem. And in a Bug work item, you can click the HISTORY--ALL CAHNGES to track the history and process.

Script to send email notification in Teamcity

I have a requirement to send email to particular group when Teamcity's build goes green and red.
Does anyone has any idea about it ?
It is possible to configure user group and setup email notifications for this group inside TeamCity.
There are a few TeamCity plugins that you can leverage out of the box but the buildstatusnotifier
looks the most promising. You can also setup a job that gets triggerred upon completion of every build for the project you are tracking. This build will do the following:
Make a call for last status of the build project. See TeamCity REST documentation here for context. Replace "insert-base-url-here" with your teamcity base url & "btXXX" with your build id.
http://{insert-base-url-here}/app/rest/builds/buildType:(id:btXXX)/statusIcon
Save the result of this call in a DB or in a txt file
For every subsequent call, check to see if the new value is the same as the previous; if they are do not send an email. If the values do not match then proceed to step four
Send an email to the recipient/distribution list informing them of a change of status in the build status.
My personal preference will be to do all of these in an nant script but those are the steps to take.
You can also look at the Build-status tool (build-status.appspot.com) which can be setup and displayed in a highly visible place that your team will not miss should it turn red.

Jenkins_Selenium- Can someone please explain how to generate reports in jenkins and send it as attachement in email

Jenkins_Selenium- Can some one please explain how to generate reports in jenkins and send it as attachement in email. I tried SelenuimHTML report plugin and added it as post build action. In selenium results location i have given as testng-results. Is this correct?
Thanks,
Deepa
Just use TestNG as your test-runner. I will generate a "emailable report" HTML file, then you can use Jenkins EmailExt plugin to send with the attachment. If you want a more detailed report, some people use the Maven plugin called ReportNG to generate a emailable report but personally I don't think its any better.