void ddlGuide_OnSelectionChanged(MonoBehaviourWindowPlus.DropDownList sender, int OldIndex, int NewIndex) { GuidePage tmp = KSPTips.lstGuidePages.FirstOrDefault(p => p.guide.Title == ddlGuide.Items[NewIndex]); CurrentPage = lstPages.IndexOf(tmp); UpdateGuidePage(); }
public void NUnitArticleHaveSublinksTests() { NetPage.Navigate("https://docs.microsoft.com/en-us/dotnet/"); NetPage.CoreGuide.Click(); GuidePage.NavigateToArticle(GuidePage.Tab); GuidePage.NavigateToSubArticle(GuidePage.SubTab); var sublinks = GuidePage.Sublinks.FindElements(By.TagName("li")); Assert.AreEqual(sublinks.Count, 5); //Driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(2); for (int i = 0; i < sublinks.Count; i++) { var positionBefore = GuidePage.GetPosition; var link = sublinks[i].FindElement(By.TagName("a")); link.Click(); var positionAfter = GuidePage.GetPosition; Assert.IsTrue(positionAfter > positionBefore); GuidePage.ScrollToTop(); } //TODO Bonus //TODO Navigate Only once }
private void ShowGuide(GuidePage topic = null) { var guide = new Guide(); guide.UserGuideAction += guide_UserGuideAction; if (topic != null) { guide.Topics.AddLast(topic); } guide.ShowDialog(); }
public void StartUp() { Driver = new ChromeDriver(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); Driver.Manage().Window.Maximize(); // Driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); IndexPage = new IndexPage(Driver); AccordionPage = new AccordionPage(Driver); NetPage = new NetPage(Driver); GuidePage = new GuidePage(Driver); }
public void NUnitPositiveVoteForSectionTests() { NetPage.Navigate("https://docs.microsoft.com/en-us/dotnet/"); NetPage.CoreGuide.Click(); GuidePage.NavigateToArticle(GuidePage.Tab); GuidePage.NavigateToSubArticle(GuidePage.SubTab); GuidePage.VotePositiveButton.Click(); //GuidePage.FeedBackInput.Click(); //GuidePage.FeedBackInput.Type("QAAutomationExam"); GuidePage.FeedbackSkip.Click(); var expectedText = "Thank you."; var actualText = GuidePage.FeedbackMessage.Text; Assert.AreEqual(expectedText, actualText); }
public ViewResult Guide(Traveler newTraveler) { /* * Problem: pass two different kinds of data to a page. * * Solution: Create a new class that contains all the data inside it * and pass that to the view as a ViewModel. */ GuidePage guidePage = new GuidePage() { Traveler = newTraveler, Destinations = TravelDestinations.Destinations }; /* * The data passed to this page must match the data type of the * @model in the .cshtml file. */ return(View("Guide2", guidePage)); }
private async void HelpButton_Click(object sender, RoutedEventArgs e) { var g = new GuidePage(); await g.ShowAsync(); }