public void TestMethod_IsssueCenterAnonLogin() { //Read the datasheet ReadData(); //Withoutlogin //Navigate to IssueCenter string navigateURL; navigateURL = _Url + "/bugs-wishes/"; CommonFunctions.HandleSpashScreen(myManager, myManager.ActiveBrowser); myManager.ActiveBrowser.NavigateTo(navigateURL); Thread.Sleep(5000); myManager.ActiveBrowser.WaitUntilReady(); myManager.ActiveBrowser.RefreshDomTree(); ObjIssueCenter issueCenter = new ObjIssueCenter(myManager); //tables with no data are not visible to the user at this stage //ReleseNotes Table verification HtmlDiv ReleaseNotesArea = issueCenter.ReleseNotesDiv.As <HtmlDiv>(); HtmlTable ReleaseNotesTable = ReleaseNotesArea.Find.AllByTagName <HtmlTable>("table")[0]; //TopVoted Table verification HtmlDiv TopVotedArea = issueCenter.ReleseNotesDiv.As <HtmlDiv>(); }
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)); }