From aa813b7f8c2824c50d415cd6f7f16f6071dbea07 Mon Sep 17 00:00:00 2001 From: Christian Arenas Date: Wed, 28 Jun 2017 19:09:29 +0200 Subject: [PATCH] Add CatalogApi load test --- .../Catalog.API/GetCatalogBrands.webtest | 18 +++ .../Catalog.API/GetCatalogFiltered.webtest | 20 +++ .../Catalog.API/GetCatalogTypes.webtest | 18 +++ .../LoadTest/Catalog.API/GetItem.webtest | 19 +++ .../LoadTest/Catalog.API/GetItemPic.webtest | 19 +++ .../LoadTest/Catalog.API/GetItems.webtest | 18 +++ .../Catalog.API/GetItemsByName.webtest | 19 +++ test/Services/LoadTest/GetItemCoded.cs | 45 +++++++ test/Services/LoadTest/LoadTest.csproj | 27 +++- .../LoadTest/WebMVC/AddProducts.webtest | 16 +-- .../WebMVC/AddProductsWithLogin.webtest | 58 ++------- .../LoadTest/WebMVC/CatalogFilter.webtest | 94 ++------------ .../LoadTest/WebMVC/CreateNewOrder.webtest | 118 +++--------------- test/Services/LoadTest/WebMVC/Login.webtest | 30 +---- .../LoadTest/WebMVC/LoginAndLogout.webtest | 46 +------ test/Services/LoadTest/WebMVC/Logout.webtest | 16 +-- 16 files changed, 252 insertions(+), 329 deletions(-) create mode 100644 test/Services/LoadTest/Catalog.API/GetCatalogBrands.webtest create mode 100644 test/Services/LoadTest/Catalog.API/GetCatalogFiltered.webtest create mode 100644 test/Services/LoadTest/Catalog.API/GetCatalogTypes.webtest create mode 100644 test/Services/LoadTest/Catalog.API/GetItem.webtest create mode 100644 test/Services/LoadTest/Catalog.API/GetItemPic.webtest create mode 100644 test/Services/LoadTest/Catalog.API/GetItems.webtest create mode 100644 test/Services/LoadTest/Catalog.API/GetItemsByName.webtest create mode 100644 test/Services/LoadTest/GetItemCoded.cs diff --git a/test/Services/LoadTest/Catalog.API/GetCatalogBrands.webtest b/test/Services/LoadTest/Catalog.API/GetCatalogBrands.webtest new file mode 100644 index 000000000..457d7fec5 --- /dev/null +++ b/test/Services/LoadTest/Catalog.API/GetCatalogBrands.webtest @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/Services/LoadTest/Catalog.API/GetCatalogFiltered.webtest b/test/Services/LoadTest/Catalog.API/GetCatalogFiltered.webtest new file mode 100644 index 000000000..aa0d32c89 --- /dev/null +++ b/test/Services/LoadTest/Catalog.API/GetCatalogFiltered.webtest @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/Services/LoadTest/Catalog.API/GetCatalogTypes.webtest b/test/Services/LoadTest/Catalog.API/GetCatalogTypes.webtest new file mode 100644 index 000000000..7c5d08c94 --- /dev/null +++ b/test/Services/LoadTest/Catalog.API/GetCatalogTypes.webtest @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/Services/LoadTest/Catalog.API/GetItem.webtest b/test/Services/LoadTest/Catalog.API/GetItem.webtest new file mode 100644 index 000000000..bb187e0ee --- /dev/null +++ b/test/Services/LoadTest/Catalog.API/GetItem.webtest @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/Services/LoadTest/Catalog.API/GetItemPic.webtest b/test/Services/LoadTest/Catalog.API/GetItemPic.webtest new file mode 100644 index 000000000..715e09172 --- /dev/null +++ b/test/Services/LoadTest/Catalog.API/GetItemPic.webtest @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/Services/LoadTest/Catalog.API/GetItems.webtest b/test/Services/LoadTest/Catalog.API/GetItems.webtest new file mode 100644 index 000000000..86dc6ab80 --- /dev/null +++ b/test/Services/LoadTest/Catalog.API/GetItems.webtest @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/Services/LoadTest/Catalog.API/GetItemsByName.webtest b/test/Services/LoadTest/Catalog.API/GetItemsByName.webtest new file mode 100644 index 000000000..5306dcd68 --- /dev/null +++ b/test/Services/LoadTest/Catalog.API/GetItemsByName.webtest @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/Services/LoadTest/GetItemCoded.cs b/test/Services/LoadTest/GetItemCoded.cs new file mode 100644 index 000000000..e2c9162ec --- /dev/null +++ b/test/Services/LoadTest/GetItemCoded.cs @@ -0,0 +1,45 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace LoadTest { + using System; + using System.Collections.Generic; + using System.Text; + using Microsoft.VisualStudio.TestTools.WebTesting; + using Microsoft.VisualStudio.TestTools.WebTesting.Rules; + + + public class GetItemCoded : WebTest { + + public GetItemCoded() { + this.Context.Add("WebServer", ""); + this.PreAuthenticate = true; + this.Proxy = "default"; + } + + public override IEnumerator GetRequestEnumerator() { + // Initialize validation rules that apply to all requests in the WebTest + if ((this.Context.ValidationLevel >= Microsoft.VisualStudio.TestTools.WebTesting.ValidationLevel.Low)) { + ValidateResponseUrl validationRule1 = new ValidateResponseUrl(); + this.ValidateResponse += new EventHandler(validationRule1.Validate); + } + if ((this.Context.ValidationLevel >= Microsoft.VisualStudio.TestTools.WebTesting.ValidationLevel.Low)) { + ValidationRuleResponseTimeGoal validationRule2 = new ValidationRuleResponseTimeGoal(); + validationRule2.Tolerance = 0D; + this.ValidateResponseOnPageComplete += new EventHandler(validationRule2.Validate); + } + + WebTestRequest request1 = new WebTestRequest((this.Context["WebServer"].ToString() + "/api/v1/Catalog/Items/1")); + request1.Headers.Add(new WebTestRequestHeader("Referer", (this.Context["WebServer"].ToString() + "/swagger/"))); + yield return request1; + request1 = null; + } + } +} diff --git a/test/Services/LoadTest/LoadTest.csproj b/test/Services/LoadTest/LoadTest.csproj index 65ba7779a..8b4b86b08 100644 --- a/test/Services/LoadTest/LoadTest.csproj +++ b/test/Services/LoadTest/LoadTest.csproj @@ -51,10 +51,35 @@ + + + PreserveNewest + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + PreserveNewest + Always @@ -78,8 +103,6 @@ - - diff --git a/test/Services/LoadTest/WebMVC/AddProducts.webtest b/test/Services/LoadTest/WebMVC/AddProducts.webtest index 9984ed55e..27866030d 100644 --- a/test/Services/LoadTest/WebMVC/AddProducts.webtest +++ b/test/Services/LoadTest/WebMVC/AddProducts.webtest @@ -12,21 +12,9 @@ - - - - -
- - - - -
- - - + -
+
diff --git a/test/Services/LoadTest/WebMVC/AddProductsWithLogin.webtest b/test/Services/LoadTest/WebMVC/AddProductsWithLogin.webtest index 1f60026a7..eb498329f 100644 --- a/test/Services/LoadTest/WebMVC/AddProductsWithLogin.webtest +++ b/test/Services/LoadTest/WebMVC/AddProductsWithLogin.webtest @@ -1,21 +1,9 @@  - - - - -
- - - - -
- - - + -
+
@@ -62,19 +50,7 @@ - - - - -
- - - - -
- - - +
@@ -105,21 +81,21 @@ - + - + -
+
- + -
+
-
+
@@ -136,21 +112,9 @@ - - - - -
- - - - -
- - - + -
+
diff --git a/test/Services/LoadTest/WebMVC/CatalogFilter.webtest b/test/Services/LoadTest/WebMVC/CatalogFilter.webtest index 2cbbfbda8..8765dc042 100644 --- a/test/Services/LoadTest/WebMVC/CatalogFilter.webtest +++ b/test/Services/LoadTest/WebMVC/CatalogFilter.webtest @@ -1,21 +1,9 @@  - - - - -
- - - - -
- - - + -
+
@@ -62,19 +50,7 @@ - - - - -
- - - - -
- - - +
@@ -94,21 +70,9 @@ - - - - -
- - - - -
- - - + -
+
@@ -140,21 +104,9 @@ - - - - -
- - - - -
- - - + -
+
@@ -186,21 +138,9 @@ - - - - -
- - - - -
- - - + -
+
@@ -211,21 +151,9 @@ - - - - -
- - - - -
- - - + -
+
diff --git a/test/Services/LoadTest/WebMVC/CreateNewOrder.webtest b/test/Services/LoadTest/WebMVC/CreateNewOrder.webtest index e14a30f62..019b83a0b 100644 --- a/test/Services/LoadTest/WebMVC/CreateNewOrder.webtest +++ b/test/Services/LoadTest/WebMVC/CreateNewOrder.webtest @@ -1,21 +1,9 @@  - - - - -
- - - - -
- - - + -
+
@@ -62,19 +50,7 @@ - - - - -
- - - - -
- - - +
@@ -94,21 +70,9 @@ - - - - -
- - - - -
- - - + -
+
@@ -123,21 +87,9 @@ - - - - -
- - - - -
- - - + -
+
@@ -166,21 +118,9 @@ - - - - -
- - - - -
- - - + -
+
@@ -270,21 +210,9 @@ - - - - -
- - - - -
- - - + -
+
@@ -306,31 +234,19 @@ - + -
+
- + -
+
- - - - -
- - - - -
- - - + -
+
diff --git a/test/Services/LoadTest/WebMVC/Login.webtest b/test/Services/LoadTest/WebMVC/Login.webtest index 17e02a408..f88f13583 100644 --- a/test/Services/LoadTest/WebMVC/Login.webtest +++ b/test/Services/LoadTest/WebMVC/Login.webtest @@ -1,21 +1,9 @@  - - - - -
- - - - -
- - - + -
+
@@ -62,19 +50,7 @@ - - - - -
- - - - -
- - - +
diff --git a/test/Services/LoadTest/WebMVC/LoginAndLogout.webtest b/test/Services/LoadTest/WebMVC/LoginAndLogout.webtest index ffb94543d..431239376 100644 --- a/test/Services/LoadTest/WebMVC/LoginAndLogout.webtest +++ b/test/Services/LoadTest/WebMVC/LoginAndLogout.webtest @@ -1,21 +1,9 @@  - - - - -
- - - - -
- - - + -
+
@@ -62,19 +50,7 @@ - - - - -
- - - - -
- - - +
@@ -94,21 +70,9 @@ - - - - -
- - - - -
- - - + -
+
diff --git a/test/Services/LoadTest/WebMVC/Logout.webtest b/test/Services/LoadTest/WebMVC/Logout.webtest index b8ca3e0a7..1fa2b87a9 100644 --- a/test/Services/LoadTest/WebMVC/Logout.webtest +++ b/test/Services/LoadTest/WebMVC/Logout.webtest @@ -1,21 +1,9 @@  - - - - -
- - - - -
- - - + -
+