コード例 #1
0
ファイル: FirstTastTests.cs プロジェクト: Irrrka/QAAutomation
        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
        }
コード例 #2
0
        public void OpenTab(NetPage pageToOpen)
        {
            NestedSwitcher.SetActivePage(pageToOpen);
            var cargopage = pageToOpen.GetComponent <GUI_CargoPage>();

            cargopage.OpenTab();
            cargopage.UpdateTab();
            DirectoryText.SetValueServer(cargopage.DirectoryName);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        private void ActivatePage(NetPage page)
        {
            pageSwitcher.SetActivePage(page);

            if (page == pageWaiting)
            {
                this.RestartCoroutine(UpdateWaitingMessage(), ref updateWaitingMessageCoroutine);
            }
            else
            {
                this.TryStopCoroutine(ref updateWaitingMessageCoroutine);
            }
        }
コード例 #5
0
ファイル: GUI_PDA.cs プロジェクト: ewy0/unitystation
        /// <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);
        }
コード例 #6
0
ファイル: FirstTastTests.cs プロジェクト: Irrrka/QAAutomation
        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);
        }
コード例 #7
0
    //绑定列表数据
    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();
        }
    }
コード例 #8
0
 public void RefreshSubpageLabel(NetPage oldPage, NetPage newPage)
 {
     NestedPageName.SetValueServer(newPage.name);
 }
コード例 #9
0
 public void OpenSubPage(NetPage page)
 {
     mainController.OpenPageOnSwitcher(subSwitcher, page);
 }
コード例 #10
0
ファイル: GUI_Cargo.cs プロジェクト: Basipek/unitystation
 public void OpenTab(NetPage pageToOpen)
 {
     NestedSwitcher.SetActivePage(pageToOpen);
     pageToOpen.GetComponent <GUI_CargoPage>().OpenTab();
 }
コード例 #11
0
ファイル: GUI_Cargo.cs プロジェクト: Basipek/unitystation
 public void RefreshSubpage(NetPage oldPage, NetPage newPage)
 {
     DirectoryText.SetValueServer(newPage.GetComponent <GUI_CargoPage>().DirectoryName);
 }
コード例 #12
0
ファイル: GUI_PDA.cs プロジェクト: ewy0/unitystation
 /// <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);
 }