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; ...@@ -23,6 +23,25 @@ using Microsoft.VisualStudio.TestTools.LoadTesting;
23 23
24 namespace LIL_VSTT_Plugins 24 namespace LIL_VSTT_Plugins
25 { 25 {
26 [DisplayName("Stop Here After")]
27 [Description("Add this plugin to a request in order to force the webtest to stop after the request has finished.")]
28 public class StopHereAfter : WebTestRequestPlugin
29 {
30 [DisplayName("Fail the test"), DefaultValue(false), Description("If set to true will fail the test iteration.")]
31 public bool FailTest { get; set; }
32 public override void PostRequest(object sender, PostRequestEventArgs e)
33 {
34 base.PostRequest(sender, e);
35 e.WebTest.AddCommentToResult("STOP HERE AFTER: WebTest will stop after the next request because of Request Plugin 'Stop Here After' was added to it.");
36 if (FailTest)
37 {
38 e.WebTest.Outcome = Outcome.Fail;
39 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.");
40 }
41 e.WebTest.Stop();
42 }
43 }
44
26 [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.")] 45 [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.")]
27 public class ZipFileUploadBeforePost : WebTestRequestPlugin 46 public class ZipFileUploadBeforePost : WebTestRequestPlugin
28 { 47 {
......