Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
256 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
PackageNames | ||
jQuery | ||
EntityFramework |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by a tool. | ||
// Runtime Version:4.0.30319.18051 | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
|
||
namespace NuGetGallery.FunctionalTests | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Microsoft.VisualStudio.TestTools.WebTesting; | ||
using Microsoft.VisualStudio.TestTools.WebTesting.Rules; | ||
|
||
|
||
[DeploymentItem("tests\\nugetgallery.functionaltests\\PackageNames.csv")] | ||
[DataSource("PackageNames", "Microsoft.VisualStudio.TestTools.DataSource.CSV", "|DataDirectory|\\PackageNames.csv", Microsoft.VisualStudio.TestTools.WebTesting.DataBindingAccessMethod.Sequential, Microsoft.VisualStudio.TestTools.WebTesting.DataBindingSelectColumns.SelectOnlyBoundColumns, "PackageNames#csv")] | ||
[DataBinding("PackageNames", "PackageNames#csv", "PackageNames", "PackageNames.PackageNames#csv.PackageNames")] | ||
public class EditPackageTest : WebTest | ||
{ | ||
|
||
public EditPackageTest() | ||
{ | ||
this.PreAuthenticate = true; | ||
} | ||
|
||
public override IEnumerator<WebTestRequest> 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<ValidationEventArgs>(validationRule1.Validate); | ||
//} | ||
//if ((this.Context.ValidationLevel >= Microsoft.VisualStudio.TestTools.WebTesting.ValidationLevel.Low)) | ||
//{ | ||
// ValidationRuleResponseTimeGoal validationRule2 = new ValidationRuleResponseTimeGoal(); | ||
// validationRule2.Tolerance = 0D; | ||
// this.ValidateResponseOnPageComplete += new EventHandler<ValidationEventArgs>(validationRule2.Validate); | ||
//} | ||
|
||
//Do initial login to be able to perform package management. | ||
WebTestRequest logonGet = AssertAndValidationHelper.GetLogonGetRequest(); | ||
yield return logonGet; | ||
logonGet = null; | ||
WebTestRequest logonPost = AssertAndValidationHelper.GetLogonPostRequest(this); | ||
yield return logonPost; | ||
logonPost = null; | ||
|
||
WebTestRequest request1 = new WebTestRequest("https://staging.nuget.org/packages/SimpleTestPackageA/12.0.0/Edit"); | ||
request1.ExpectedResponseUrl = "https://staging.nuget.org/Users/Account/LogOn?ReturnUrl=%2fpackages%2fSimpleTestP" + | ||
"ackageA%2f12.0.0%2fEdit"; | ||
// request1.QueryStringParameters.Add("Parameter1", this.Context["PackageNames.PackageNames#csv.PackageNames"].ToString()); | ||
ExtractHiddenFields extractionRule1 = new ExtractHiddenFields(); | ||
extractionRule1.Required = true; | ||
extractionRule1.HtmlDecode = true; | ||
extractionRule1.ContextParameterName = "1"; | ||
request1.ExtractValues += new EventHandler<ExtractionEventArgs>(extractionRule1.Extract); | ||
yield return request1; | ||
request1 = null; | ||
|
||
|
||
|
||
WebTestRequest request3 = new WebTestRequest("https://staging.nuget.org/packages/SimpleTestPackageA/12.0.0/Edit"); | ||
request3.Method = "POST"; | ||
request3.ExpectedResponseUrl = "https://staging.nuget.org/packages/SimpleTestPackageA/12.0.0"; | ||
FormPostHttpBody request3Body = new FormPostHttpBody(); | ||
request3Body.FormPostParameters.Add("__RequestVerificationToken", this.Context["$HIDDEN1.__RequestVerificationToken"].ToString()); | ||
request3Body.FormPostParameters.Add("Edit.VersionTitle", "Edit Package Demo1"); | ||
request3Body.FormPostParameters.Add("Edit.Description", "My package description."); | ||
request3Body.FormPostParameters.Add("Edit.Summary", ""); | ||
request3Body.FormPostParameters.Add("Edit.IconUrl", ""); | ||
request3Body.FormPostParameters.Add("Edit.ProjectUrl", ""); | ||
request3Body.FormPostParameters.Add("Edit.Authors", "bhuvana"); | ||
request3Body.FormPostParameters.Add("Edit.Copyright", ""); | ||
request3Body.FormPostParameters.Add("Edit.Tags", "demo"); | ||
request3Body.FormPostParameters.Add("Edit.ReleaseNotes", ""); | ||
request3.Body = request3Body; | ||
WebTestRequest request3Dependent1 = new WebTestRequest("https://staging.nuget.org/api/v2/service-alert"); | ||
request3Dependent1.QueryStringParameters.Add("cachebust", "1377492797562", false, false); | ||
request3.DependentRequests.Add(request3Dependent1); | ||
yield return request3; | ||
request3 = null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
PackageNames | ||
jQuery | ||
EntityFramework |
Binary file added
BIN
+481 KB
...UITests/PackageManagement/WebTest1.e4305e86-77a2-4d80-a0e4-432e0a405492.rec.webtestresult
Binary file not shown.
Oops, something went wrong.