public void InstallClientSideLibraries_FromFolder_SmokeTest() { RemoveExistingManifest(); InstallDialogTestExtension installDialogTestExtension = OpenWizardFromSolutionExplorerItem("wwwroot"); installDialogTestExtension.Library = "[email protected]"; installDialogTestExtension.WaitForFileSelectionsAvailable(); installDialogTestExtension.ClickInstall(); string pathToLibrary = Path.Combine(SolutionRootPath, ProjectName, "wwwroot", "jquery-validate"); string[] expectedFiles = new[] { Path.Combine(pathToLibrary, "jquery.validate.js"), Path.Combine(pathToLibrary, "localization", "messages_ar.js"), }; string manifestContents = @"{ ""version"": ""1.0"", ""defaultProvider"": ""cdnjs"", ""libraries"": [ { ""library"": ""[email protected]"", ""destination"": ""wwwroot/jquery-validate/"" } ] }"; Helpers.FileIO.WaitForRestoredFiles(pathToLibrary, expectedFiles, caseInsensitive: true, timeout: 20000); Assert.AreEqual(manifestContents, File.ReadAllText(_pathToLibmanFile)); }
private void SetLibraryAndClickInstall(string nodeName, string library) { SolutionExplorerItemTestExtension solutionExplorerItemTestExtension = SolutionExplorer.FindItemRecursive(nodeName); solutionExplorerItemTestExtension.Select(); InstallDialogTestService installDialogTestService = VisualStudio.Get<InstallDialogTestService>(); InstallDialogTestExtension installDialogTestExtenstion = installDialogTestService.OpenDialog(); installDialogTestExtenstion.SetLibrary(library); installDialogTestExtenstion.ClickInstall(); }
private InstallDialogTestExtension OpenWizardFromSolutionExplorerItem(string nodeName) { SolutionExplorerItemTestExtension solutionExplorerItemTestExtension = SolutionExplorer.FindItemRecursive(nodeName); solutionExplorerItemTestExtension.Select(); InstallDialogTestService installDialogTestService = VisualStudio.Get <InstallDialogTestService>(); InstallDialogTestExtension installDialogTestExtenstion = installDialogTestService.OpenDialog(); return(installDialogTestExtenstion); }
public void NpmPackageWithLatestTag_LoadsFileMetadata(string provider) { InstallDialogTestExtension installDialogTestExtenstion = OpenWizardFromSolutionExplorerItem("wwwroot"); try { installDialogTestExtenstion.Provider = provider; installDialogTestExtenstion.Library = "jquery@latest"; installDialogTestExtenstion.WaitForFileSelectionsAvailable(); } finally { installDialogTestExtenstion.Close(); } }
public void InstallClientSideLibraries_DefaultProviderIsSelectedOnDialogOpen() { _libmanConfig = _webProject[LibManManifestFile]; DocumentWindowTestExtension document = _libmanConfig.Open(); Editor.Caret.MoveToExpression("version"); Editor.Caret.MoveToEndOfLine(); Editor.KeyboardCommands.Enter(); Editor.Edit.InsertTextInBuffer(@"""defaultProvider"": ""jsdelivr"","); InstallDialogTestExtension installDialogTestExtension = OpenWizardFromSolutionExplorerItem("wwwroot"); Verify.Strings.AreEqual("jsdelivr", installDialogTestExtension.Provider); installDialogTestExtension.Close(); document.Close(saveIfDirty: false); }