public void ChooseService(ServiceToTry serviceToTry) { if (!GraphBrowser.Url.Contains("/quick-start")) { GraphBrowser.Goto(GraphUtility.RemoveRedundantPartsfromExtractBaseAddress() + "/quick-start#try-it-out"); } int serviceIndex = (int)serviceToTry; string serviceSuffix = string.Empty; switch (serviceToTry) { case ServiceToTry.GetContacts: serviceSuffix = "-get-contacts"; break; case ServiceToTry.GetEvents: serviceSuffix = "-get-calendars"; break; case ServiceToTry.GetFiles: serviceSuffix = "-get-files"; break; case ServiceToTry.GetGroups: serviceSuffix = "-get-groups"; break; case ServiceToTry.GetMessages: serviceSuffix = "-get-mails"; break; case ServiceToTry.GetUsers: serviceSuffix = "-get-users"; break; default: break; } //var service = GraphBrowser.Driver.FindElement(By.Id("serviceOption"+serviceIndex)); var service = GraphBrowser.Driver.FindElement(By.Id("serviceOption" + serviceSuffix)); GraphBrowser.Click(service); currentSerivce = serviceToTry; }
public void TestInitialize() { GraphBrowser.Goto(GraphBrowser.BaseAddress); GraphBrowser.SetWindowSize(0, 0, true); GraphBrowser.Goto(GraphUtility.RemoveRedundantPartsfromExtractBaseAddress() + "/code-samples-and-sdks"); this._codeSamplesPage = new GraphCodeSamplesPage(); }
public void BVT_Graph_S03_TC10_CanLoadGettingStartedPlatformImages() { //Platform platform = Platform.PHP; //GraphPages.Office365Page.CardSetupPlatform.ChoosePlatform(platform); GraphBrowser.Goto(GraphUtility.RemoveRedundantPartsfromExtractBaseAddress() + "/quick-start#setup"); Assert.IsTrue(GraphPages.Office365Page.CanLoadImages()); }
public void Acceptance_Graph_S03_TC09_CanDownloadCode_Node() { Platform platform = Platform.Node; //Simulate app registration via hardcoded querystring GraphBrowser.Goto(GraphUtility.RemoveRedundantPartsfromExtractBaseAddress() + "/quick-start?appID=c4664f74-aec4-4462-93e9-fb84a25d1f28&appName=My%20Node.js%20App&redirectUrl=http://localhost:3000/login&platform=option-node"); Assert.IsTrue(GraphPages.Office365Page.CardSetupPlatform.IsShowingPlatformSetup(platform), "Failed to choose platform {0}, which should be picked from querystring and selected on page load", platform.ToString()); GraphPages.Office365Page.CardDownloadCode.DownloadCode(); Assert.IsTrue(GraphPages.Office365Page.CardDownloadCode.IsCodeDownloaded(), "Failed to download code and display post-download instructions."); }
public void ChoosePlatform(Platform platformName) { if (!GraphBrowser.Url.Contains("/quick-start")) { GraphBrowser.Goto(GraphUtility.RemoveRedundantPartsfromExtractBaseAddress() + "/quick-start#setup"); } //To account for iOS_Swift and iOS_Objective_C enums, since enum cannot contain - character but the div IDs contain - var platform = GraphBrowser.Driver.FindElement(By.Id("option-" + platformName.ToString().ToLower().Replace("_", "-"))); GraphBrowser.Click(platform); // Need refactor: Sometimes case failed for the platform setup text is not changed in time GraphBrowser.Wait(TimeSpan.FromSeconds(2)); }
public void BVT_Graph_S06_TC02_CanGoToLanguageSpecificExplorerPage() { //get the current language string prefix = GraphUtility.RemoveRedundantPartsfromExtractBaseAddress(); string locale = GraphUtility.GetLocaleFromUrl(prefix); //Find substring of base address ending before locale string addressWithoutLocale = prefix.Replace(locale, "/"); //string homePageLanguage = GraphBrowser.Url.Replace(prefix, ""); GraphBrowser.Goto(addressWithoutLocale + "/graph-explorer"); string currentUrl = GraphBrowser.Url; if (prefix.StartsWith("http:")) { currentUrl = currentUrl.Replace("https", "http"); } string explorerLanguage = GraphUtility.GetLocaleFromUrl(currentUrl); Assert.AreEqual(locale, explorerLanguage, "Graph explorer neutral URL should redirect to language specific page"); }
public void TestCleanup() { GraphBrowser.Goto(GraphBrowser.BaseAddress); }
public void TestInitialize() { GraphBrowser.Goto(GraphBrowser.BaseAddress); GraphBrowser.SetWindowSize(0, 0, true); }
public void TestCleanup() { GraphBrowser.Goto(GraphBrowser.BaseAddress); GraphBrowser.ZoomToPercent(100); }
public void BVT_Graph_S03_TC02_ShowTwoCardsByDefault() { GraphBrowser.Goto(GraphUtility.RemoveRedundantPartsfromExtractBaseAddress() + "/quick-start"); Assert.IsTrue(GraphUtility.CheckTwoCardsDisplayed(), "Default cards in Getting Started are not displayed correctly."); }