Browse Source

Add new basket api url to test

pull/241/head
Christian Arenas 7 years ago
parent
commit
4e9524c9b0
6 changed files with 23 additions and 23 deletions
  1. +11
    -12
      test/Services/FunctionalTests/Services/Basket/BasketScenariosBase.cs
  2. +5
    -7
      test/Services/IntegrationTests/Services/Basket/BasketScenarioBase.cs
  3. +2
    -1
      test/Services/LoadTest/Basket.API/AddBasket.webtest
  4. +1
    -1
      test/Services/LoadTest/Basket.API/Checkout.webtest
  5. +2
    -1
      test/Services/LoadTest/Basket.API/DeleteBasket.webtest
  6. +2
    -1
      test/Services/LoadTest/Basket.API/GetBasket.webtest

+ 11
- 12
test/Services/FunctionalTests/Services/Basket/BasketScenariosBase.cs View File

@ -1,14 +1,13 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.TestHost;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace FunctionalTests.Services.Basket
namespace FunctionalTests.Services.Basket
{ {
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.TestHost;
using System.IO;
public class BasketScenariosBase public class BasketScenariosBase
{ {
private const string ApiUrlBase = "api/v1/basket";
public TestServer CreateServer() public TestServer CreateServer()
{ {
var webHostBuilder = new WebHostBuilder(); var webHostBuilder = new WebHostBuilder();
@ -22,14 +21,14 @@ namespace FunctionalTests.Services.Basket
{ {
public static string GetBasketByCustomer(string customerId) public static string GetBasketByCustomer(string customerId)
{ {
return $"/{customerId}";
return $"{ApiUrlBase}/{customerId}";
} }
} }
public static class Post public static class Post
{ {
public static string CreateBasket = "/";
public static string Checkout = "/checkout";
public static string CreateBasket = $"{ApiUrlBase}/";
public static string Checkout = $"{ApiUrlBase}/checkout";
} }
} }
}
}

+ 5
- 7
test/Services/IntegrationTests/Services/Basket/BasketScenarioBase.cs View File

@ -1,15 +1,13 @@
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.TestHost; using Microsoft.AspNetCore.TestHost;
using Microsoft.eShopOnContainers.Services.Basket.API;
using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text;
namespace IntegrationTests.Services.Basket namespace IntegrationTests.Services.Basket
{ {
public class BasketScenarioBase public class BasketScenarioBase
{ {
private const string ApiUrlBase = "api/v1/basket";
public TestServer CreateServer() public TestServer CreateServer()
{ {
var webHostBuilder = new WebHostBuilder(); var webHostBuilder = new WebHostBuilder();
@ -23,14 +21,14 @@ namespace IntegrationTests.Services.Basket
{ {
public static string GetBasket(int id) public static string GetBasket(int id)
{ {
return $"{id}";
return $"{ApiUrlBase}/{id}";
} }
} }
public static class Post public static class Post
{ {
public static string Basket = "";
public static string CheckoutOrder = "checkout";
public static string Basket = $"{ApiUrlBase}/";
public static string CheckoutOrder = $"{ApiUrlBase}/checkout";
} }
} }
} }

+ 2
- 1
test/Services/LoadTest/Basket.API/AddBasket.webtest View File

@ -65,7 +65,7 @@
<FormPostParameter Name="session_state" Value="{{$HIDDEN1.session_state}}" RecordedValue="ZxRKRHGaGBxyciYNO7yxXNcHb8MxcvGDfUWuUVaCkNo.5de6fc3970ef99b7b67328e1df0e93ce" CorrelationBinding="" UrlEncode="True" /> <FormPostParameter Name="session_state" Value="{{$HIDDEN1.session_state}}" RecordedValue="ZxRKRHGaGBxyciYNO7yxXNcHb8MxcvGDfUWuUVaCkNo.5de6fc3970ef99b7b67328e1df0e93ce" CorrelationBinding="" UrlEncode="True" />
</FormPostHttpBody> </FormPostHttpBody>
</Request> </Request>
<Request Method="POST" Guid="d24fe957-0cbb-46d4-8478-974de57e5cba" Version="1.1" Url="{{BasketApiServer}}" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False">
<Request Method="POST" Guid="d24fe957-0cbb-46d4-8478-974de57e5cba" Version="1.1" Url="{{BasketApiServer}}/api/{{ApiVersion}}/basket" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False">
<Headers> <Headers>
<Header Name="Authorization" Value="Bearer {{$HIDDEN1.access_token}} " /> <Header Name="Authorization" Value="Bearer {{$HIDDEN1.access_token}} " />
<Header Name="Accept" Value="application/json" /> <Header Name="Accept" Value="application/json" />
@ -80,6 +80,7 @@
<ContextParameter Name="IdentityApiServer" Value="http://" /> <ContextParameter Name="IdentityApiServer" Value="http://" />
<ContextParameter Name="BasketApiServer" Value="http://" /> <ContextParameter Name="BasketApiServer" Value="http://" />
<ContextParameter Name="UserId" Value="" /> <ContextParameter Name="UserId" Value="" />
<ContextParameter Name="ApiVersion" Value="v1" />
</ContextParameters> </ContextParameters>
<ValidationRules> <ValidationRules>
<ValidationRule Classname="Microsoft.VisualStudio.TestTools.WebTesting.Rules.ValidateResponseUrl, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" DisplayName="Response URL" Description="Validates that the response URL after redirects are followed is the same as the recorded response URL. QueryString parameters are ignored." Level="Low" ExectuionOrder="BeforeDependents" /> <ValidationRule Classname="Microsoft.VisualStudio.TestTools.WebTesting.Rules.ValidateResponseUrl, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" DisplayName="Response URL" Description="Validates that the response URL after redirects are followed is the same as the recorded response URL. QueryString parameters are ignored." Level="Low" ExectuionOrder="BeforeDependents" />


+ 1
- 1
test/Services/LoadTest/Basket.API/Checkout.webtest View File

@ -65,7 +65,7 @@
<FormPostParameter Name="session_state" Value="{{$HIDDEN1.session_state}}" RecordedValue="ZxRKRHGaGBxyciYNO7yxXNcHb8MxcvGDfUWuUVaCkNo.5de6fc3970ef99b7b67328e1df0e93ce" CorrelationBinding="" UrlEncode="True" /> <FormPostParameter Name="session_state" Value="{{$HIDDEN1.session_state}}" RecordedValue="ZxRKRHGaGBxyciYNO7yxXNcHb8MxcvGDfUWuUVaCkNo.5de6fc3970ef99b7b67328e1df0e93ce" CorrelationBinding="" UrlEncode="True" />
</FormPostHttpBody> </FormPostHttpBody>
</Request> </Request>
<Request Method="POST" Guid="d24fe957-0cbb-46d4-8478-974de57e5cba" Version="1.1" Url="{{BasketApiServer}}/checkout" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False">
<Request Method="POST" Guid="d24fe957-0cbb-46d4-8478-974de57e5cba" Version="1.1" Url="{{BasketApiServer}}/api/{{ApiVersion}}/checkout" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False">
<Headers> <Headers>
<Header Name="Authorization" Value="Bearer {{$HIDDEN1.access_token}}" /> <Header Name="Authorization" Value="Bearer {{$HIDDEN1.access_token}}" />
<Header Name="Accept" Value="application/json" /> <Header Name="Accept" Value="application/json" />


+ 2
- 1
test/Services/LoadTest/Basket.API/DeleteBasket.webtest View File

@ -65,7 +65,7 @@
<FormPostParameter Name="session_state" Value="{{$HIDDEN1.session_state}}" RecordedValue="ZxRKRHGaGBxyciYNO7yxXNcHb8MxcvGDfUWuUVaCkNo.5de6fc3970ef99b7b67328e1df0e93ce" CorrelationBinding="" UrlEncode="True" /> <FormPostParameter Name="session_state" Value="{{$HIDDEN1.session_state}}" RecordedValue="ZxRKRHGaGBxyciYNO7yxXNcHb8MxcvGDfUWuUVaCkNo.5de6fc3970ef99b7b67328e1df0e93ce" CorrelationBinding="" UrlEncode="True" />
</FormPostHttpBody> </FormPostHttpBody>
</Request> </Request>
<Request Method="DELETE" Guid="d24fe957-0cbb-46d4-8478-974de57e5cba" Version="1.1" Url="{{BasketApiServer}}/{{UserId}}" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False">
<Request Method="DELETE" Guid="d24fe957-0cbb-46d4-8478-974de57e5cba" Version="1.1" Url="{{BasketApiServer}}/api/{{ApiVersion}}/{{UserId}}" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False">
<Headers> <Headers>
<Header Name="Authorization" Value="Bearer {{$HIDDEN1.access_token}} " /> <Header Name="Authorization" Value="Bearer {{$HIDDEN1.access_token}} " />
<Header Name="Accept" Value="application/json" /> <Header Name="Accept" Value="application/json" />
@ -79,6 +79,7 @@
<ContextParameter Name="IdentityApiServer" Value="http://" /> <ContextParameter Name="IdentityApiServer" Value="http://" />
<ContextParameter Name="BasketApiServer" Value="http://" /> <ContextParameter Name="BasketApiServer" Value="http://" />
<ContextParameter Name="UserId" Value="" /> <ContextParameter Name="UserId" Value="" />
<ContextParameter Name="ApiVersion" Value="v1" />
</ContextParameters> </ContextParameters>
<ValidationRules> <ValidationRules>
<ValidationRule Classname="Microsoft.VisualStudio.TestTools.WebTesting.Rules.ValidateResponseUrl, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" DisplayName="Response URL" Description="Validates that the response URL after redirects are followed is the same as the recorded response URL. QueryString parameters are ignored." Level="Low" ExectuionOrder="BeforeDependents" /> <ValidationRule Classname="Microsoft.VisualStudio.TestTools.WebTesting.Rules.ValidateResponseUrl, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" DisplayName="Response URL" Description="Validates that the response URL after redirects are followed is the same as the recorded response URL. QueryString parameters are ignored." Level="Low" ExectuionOrder="BeforeDependents" />


+ 2
- 1
test/Services/LoadTest/Basket.API/GetBasket.webtest View File

@ -65,7 +65,7 @@
<FormPostParameter Name="session_state" Value="{{$HIDDEN1.session_state}}" RecordedValue="ZxRKRHGaGBxyciYNO7yxXNcHb8MxcvGDfUWuUVaCkNo.5de6fc3970ef99b7b67328e1df0e93ce" CorrelationBinding="" UrlEncode="True" /> <FormPostParameter Name="session_state" Value="{{$HIDDEN1.session_state}}" RecordedValue="ZxRKRHGaGBxyciYNO7yxXNcHb8MxcvGDfUWuUVaCkNo.5de6fc3970ef99b7b67328e1df0e93ce" CorrelationBinding="" UrlEncode="True" />
</FormPostHttpBody> </FormPostHttpBody>
</Request> </Request>
<Request Method="GET" Guid="d24fe957-0cbb-46d4-8478-974de57e5cba" Version="1.1" Url="{{BasketApiServer}}/{{UserId}}" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False">
<Request Method="GET" Guid="d24fe957-0cbb-46d4-8478-974de57e5cba" Version="1.1" Url="{{BasketApiServer}}/api/{{ApiVersion}}/{{UserId}}" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False">
<Headers> <Headers>
<Header Name="Authorization" Value="Bearer {{$HIDDEN1.access_token}} " /> <Header Name="Authorization" Value="Bearer {{$HIDDEN1.access_token}} " />
<Header Name="Accept" Value="application/json" /> <Header Name="Accept" Value="application/json" />
@ -79,6 +79,7 @@
<ContextParameter Name="IdentityApiServer" Value="http://" /> <ContextParameter Name="IdentityApiServer" Value="http://" />
<ContextParameter Name="BasketApiServer" Value="http://" /> <ContextParameter Name="BasketApiServer" Value="http://" />
<ContextParameter Name="UserId" Value="" /> <ContextParameter Name="UserId" Value="" />
<ContextParameter Name="ApiVersion" Value="v1" />
</ContextParameters> </ContextParameters>
<ValidationRules> <ValidationRules>
<ValidationRule Classname="Microsoft.VisualStudio.TestTools.WebTesting.Rules.ValidateResponseUrl, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" DisplayName="Response URL" Description="Validates that the response URL after redirects are followed is the same as the recorded response URL. QueryString parameters are ignored." Level="Low" ExectuionOrder="BeforeDependents" /> <ValidationRule Classname="Microsoft.VisualStudio.TestTools.WebTesting.Rules.ValidateResponseUrl, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" DisplayName="Response URL" Description="Validates that the response URL after redirects are followed is the same as the recorded response URL. QueryString parameters are ignored." Level="Low" ExectuionOrder="BeforeDependents" />


Loading…
Cancel
Save