Commit 06751c12 06751c12ee8be9b225946bbc94c6f134dc55b224 by Christian Gerdes

New Request Plugin: Stop Here After

Will stop the execution of a web test directly after the request were this plugin has been added. Optionally a property can be set to also fail the test if wanted, otherwise the test will Pass or Fail as normal.
1 parent 3221e0a9
......@@ -23,6 +23,25 @@ using Microsoft.VisualStudio.TestTools.LoadTesting;
namespace LIL_VSTT_Plugins
{
[DisplayName("Stop Here After")]
[Description("Add this plugin to a request in order to force the webtest to stop after the request has finished.")]
public class StopHereAfter : WebTestRequestPlugin
{
[DisplayName("Fail the test"), DefaultValue(false), Description("If set to true will fail the test iteration.")]
public bool FailTest { get; set; }
public override void PostRequest(object sender, PostRequestEventArgs e)
{
base.PostRequest(sender, e);
e.WebTest.AddCommentToResult("STOP HERE AFTER: WebTest will stop after the next request because of Request Plugin 'Stop Here After' was added to it.");
if (FailTest)
{
e.WebTest.Outcome = Outcome.Fail;
e.WebTest.AddCommentToResult("FAIL THE TEST: WebTest will fail after the next request because of option to fail the test was set to true in the plugin.");
}
e.WebTest.Stop();
}
}
[DisplayName("Zip File Upload"), Description("Creates an ZIP archive of each of the files to be uploaded using the files name and adding .zip. Warning, uses %TEMP% for temp storage.")]
public class ZipFileUploadBeforePost : WebTestRequestPlugin
{
......