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 }
public void OpenTab(NetPage pageToOpen) { NestedSwitcher.SetActivePage(pageToOpen); var cargopage = pageToOpen.GetComponent <GUI_CargoPage>(); cargopage.OpenTab(); cargopage.UpdateTab(); DirectoryText.SetValueServer(cargopage.DirectoryName); }
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); }
private void ActivatePage(NetPage page) { pageSwitcher.SetActivePage(page); if (page == pageWaiting) { this.RestartCoroutine(UpdateWaitingMessage(), ref updateWaitingMessageCoroutine); } else { this.TryStopCoroutine(ref updateWaitingMessageCoroutine); } }
/// <summary> /// Opens the page on the given switcher, setting it as the current page. /// Runs the page's lifecycle methods if it implements IPageCleanupable or IPageReadyable. /// </summary> /// <param name="switcher">The switcher that the page is associated with</param> /// <param name="page">The page to set as the current page for the given switcher</param> public void OpenPageOnSwitcher(NetPageSwitcher switcher, NetPage page) { if (switcher.CurrentPage is IPageCleanupable cleanupable) { cleanupable.OnPageDeactivated(); } if (page is IPageReadyable readyable) { readyable.OnPageActivated(); } switcher.SetActivePage(page); }
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); }
//绑定列表数据 protected void BindRpt() { int totalRecord = 0; //总记录条数 int pageIndex = Request["pageindex"] == null ? 1 : Convert.ToInt32(Request["pageindex"]); //当前页码 int pageSize = 3; //每页条数 string parms = ""; //传递给下一页的条件 string sql = GetSql(out parms); //传递给SQL的查询条件 FenYe fy = new FenYe(); DataTable list = fy.GetList("View_LvLines", "*", "id desc", pageIndex, pageSize, sql, out totalRecord); NetPage pa = new NetPage(pageIndex, pageSize, totalRecord, "loadlineData.aspx", parms, 10); //pagetext = pa.CreatePageHtml();//生成分页html if (list != null) { this.rptList.DataSource = list; this.rptList.DataBind(); } }
public void RefreshSubpageLabel(NetPage oldPage, NetPage newPage) { NestedPageName.SetValueServer(newPage.name); }
public void OpenSubPage(NetPage page) { mainController.OpenPageOnSwitcher(subSwitcher, page); }
public void OpenTab(NetPage pageToOpen) { NestedSwitcher.SetActivePage(pageToOpen); pageToOpen.GetComponent <GUI_CargoPage>().OpenTab(); }
public void RefreshSubpage(NetPage oldPage, NetPage newPage) { DirectoryText.SetValueServer(newPage.GetComponent <GUI_CargoPage>().DirectoryName); }
/// <summary> /// Tells the main page switcher to set the current page. /// </summary> /// <param name="page">The page to set as the current page</param> public void OpenPage(NetPage page) { OpenPageOnSwitcher(mainSwitcher, page); }