/// <summary> /// Selects more options in the widget designer /// </summary> public void MoreOptions() { HtmlAnchor moreOptions = EM.Navigation.NavigationWidgetEditScreen.MoreOptions .AssertIsPresent("Css class"); moreOptions.ScrollToVisible(); moreOptions.Focus(); moreOptions.MouseClick(); }
/// <summary> /// Selects more options in the widget designer /// </summary> public void MoreOptions() { HtmlAnchor moreOptions = EM.ScriptsAndStyles.ScriptsAndStylesEditScreen.MoreOptions .AssertIsPresent("More options"); moreOptions.ScrollToVisible(); moreOptions.Focus(); moreOptions.MouseClick(); }
/// <summary> /// Click count link /// </summary> public void ClickCountLink() { HtmlAnchor commentLink = this.EM.CommentsAndReviews.CommentsFrontend.LeaveAComment .AssertIsPresent("Comments count link"); commentLink.Wait.ForVisible(); commentLink.ScrollToVisible(); commentLink.MouseClick(); ActiveBrowser.WaitUntilReady(); }
/// <summary> /// Clicks the document. /// </summary> /// <param name="title">The title text.</param> public void ClickDocument(string title) { HtmlAnchor doc = ActiveBrowser.Find.ByExpression <HtmlAnchor>("tagname=a", "innertext=" + title) .AssertIsPresent(title); doc.Wait.ForVisible(); doc.ScrollToVisible(); doc.MouseClick(); ActiveBrowser.WaitUntilReady(); }
/// <summary> /// Selects expander in the widget designer /// </summary> /// <param name="title">The title.</param> public void ExpandOptions(string title) { HtmlAnchor expander = EM.Widgets.FeatherWidget.Get <HtmlAnchor>("class=Options-toggler ng-binding", "innerText={0}".Arrange(title)).AssertIsPresent("{0} span".Arrange(title)); expander.ScrollToVisible(); expander.Focus(); expander.MouseClick(); ActiveBrowser.RefreshDomTree(); expander.Refresh(); }
/// <summary> /// Click news title on the frontend /// </summary> /// <param name="newsTitle">News title</param> public void ClickNewsTitle(string newsTitle) { HtmlDiv frontendPageMainDiv = BAT.Wrappers().Frontend().Pages().PagesWrapperFrontend().GetPageContent(); HtmlAnchor newsAnchor = frontendPageMainDiv.Find.ByExpression <HtmlAnchor>("tagname=a", "InnerText=" + newsTitle) .AssertIsPresent("News with this title was not found"); newsAnchor.Wait.ForVisible(); newsAnchor.ScrollToVisible(); newsAnchor.MouseClick(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.WaitForUrl(newsTitle.ToLower().Replace(" ", "%20")); }
public void TestMethod_IssueCenterSearchFilter() { string HitscountString; int hitsCount; //Read the datasheet ReadData(); //Login to the system myManager.ActiveBrowser.NavigateTo(_Url); CommonFunctions.HandleSpashScreen(myManager, myManager.ActiveBrowser); myManager.ActiveBrowser.WaitUntilReady(); myManager.ActiveBrowser.RefreshDomTree(); CommonFunctions.Login(myManager, myManager.ActiveBrowser, _Uname, _Password); Thread.Sleep(7000); //Navigate to IssueCenter string navigateURL; navigateURL = _Url + "/bugs-wishes/"; myManager.ActiveBrowser.NavigateTo(navigateURL); Thread.Sleep(5000); //Search For a bug myManager.ActiveBrowser.WaitUntilReady(); myManager.ActiveBrowser.RefreshDomTree(); ObjIssueCenter issueCenter = new ObjIssueCenter(myManager); HtmlInputText SearchText = issueCenter.SearchTextBox.As <HtmlInputText>(); HtmlInputButton SearchButton = issueCenter.SearchButton.As <HtmlInputButton>(); SearchText.Text = _SearchText; SearchButton.MouseClick(); //It takes sometime to load the results Thread.Sleep(7000); myManager.ActiveBrowser.WaitUntilReady(); myManager.ActiveBrowser.RefreshDomTree(); HtmlTable ResultSet = issueCenter.SearchTable.As <HtmlTable>(); Element HitsCount = issueCenter.HitsCount; //HtmlDiv HitsCount = ResultSet.Find.ById("searchResultSummary").As<HtmlDiv>(); HitscountString = HitsCount.InnerText; hitsCount = CommonFunctions.ExtractNumberFromSrting(HitscountString); //Verify the number of rows are actually displyed in the table Assert.AreEqual(hitsCount, ResultSet.BodyRows.Count); Thread.Sleep(2000); myManager.ActiveBrowser.RefreshDomTree(); //verify search in rersult HtmlDiv div = myManager.ActiveBrowser.Find.ById("searchTbl_filter").As <HtmlDiv>(); HtmlInputSearch searchinResult = div.ChildNodes[0].ChildNodes[1].As <HtmlInputSearch>(); searchinResult.Text = _SearchInResult; myManager.Desktop.Mouse.Click(MouseClickType.LeftClick, searchinResult.GetRectangle()); myManager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter); Thread.Sleep(5000); ResultSet.Refresh(); myManager.ActiveBrowser.RefreshDomTree(); string result = ResultSet.Rows[0].Cells[0].InnerText; //Verify the searched sesult from the grid Assert.AreEqual(result, _SearchInResult); //open the popup ResultSet.Rows[0].MouseClick(MouseClickType.LeftDoubleClick); Thread.Sleep(5000); myManager.ActiveBrowser.WaitUntilReady(); myManager.ActiveBrowser.RefreshDomTree(); //Click on track This issue Element TrackSLider = issueCenter.TrackSlider; if (TrackSLider != null) { Thread.Sleep(2000); myManager.ActiveBrowser.Actions.Click(TrackSLider); Thread.Sleep(3000); myManager.ActiveBrowser.WaitUntilReady(); myManager.ActiveBrowser.RefreshDomTree(); HtmlDiv trackMessage = issueCenter.TrackValidator.As <HtmlDiv>(); string trackMessageext = trackMessage.InnerText; Assert.IsTrue(trackMessageext.Contains("Added to your tracking list.")); //remove from the tracking list Thread.Sleep(2000); myManager.ActiveBrowser.Actions.Click(TrackSLider); } //Add a comment ArtOfTest.WebAii.Core.Browser t1_frame = myManager.ActiveBrowser.Frames[0]; Element TextEditor = t1_frame.Find.ByXPath("/html/body"); myManager.ActiveBrowser.Actions.SetText(TextEditor, _Comment); HtmlAnchor Submitbutton = issueCenter.SubmitComment.As <HtmlAnchor>(); Submitbutton.ScrollToVisible(); Submitbutton.MouseClick(); //Click on open in a new tab HtmlAnchor OpenNewtab = issueCenter.OpenNewTab.As <HtmlAnchor>(); OpenNewtab.MouseClick(); Thread.Sleep(5000); myManager.ActiveBrowser.Refresh(); //Validate Comments in the page myManager.ActiveBrowser.WaitUntilReady(); myManager.ActiveBrowser.Window.SetFocus(); HtmlDiv Comments = issueCenter.Comments.As <HtmlDiv>(); Assert.IsTrue(Comments.InnerText.Contains(_Comment)); }