/// <summary> /// Method to verify Weight tracker page ui /// </summary> public void ValidatePageUI(List <string[]> elements, string trackerPageName) { string pagename = pageName; Thread.Sleep(3000); for (int i = 0; i < elements.Count(); i++) { string locatorname = elements.ElementAt(i)[3]; string elementname = elements.ElementAt(i)[2]; string action = elements.ElementAt(i)[4]; if (action.ToLower().Equals("verifytext")) { string expectedtxt = elements.ElementAt(i)[5]; string actual = AppiumKeywords.GetText(pagename, locatorname, pckgname); softAssertions.Add(elementname, expectedtxt, actual, "contains"); } else if (action.ToLower().Equals("verifyexists")) { bool actualstatus = AppiumKeywords.IsElementPresent(pagename, locatorname, pckgname); softAssertions.Add(elementname, true, actualstatus, "equals"); } if (i == 6) { pagename = trackerPageName; } } }
public void VerifyMessageToCoachScreen(List <string[]> messagetocoachui) { // Verify coach label, Hours of operation, send message and call now button for (int i = 0; i < messagetocoachui.Count; i++) { string elementname = messagetocoachui.ElementAt(i)[2]; string locatorname = messagetocoachui.ElementAt(i)[3]; string expectedtext = messagetocoachui.ElementAt(i)[4]; string actualtext = AppiumKeywords.GetText(pageName, locatorname, pckgname); softAssertions.Add(elementname, expectedtext, actualtext, "contains"); } }
private List <string[]> VerifyHAIsCompleted() { List <string[]> result = new List <string[]>(); string dashboard_ha_completion_percentage = AppiumKeywords.GetText(pageName, "dashboard_ha_100per"); bool textmatch = dashboard_ha_completion_percentage.Equals("100%"); string msg = "Element: Dashboard_HA_Completion_Percentage Expected: 100% Actual: " + dashboard_ha_completion_percentage; result.Add(new string[] { msg, textmatch.ToString() }); return(result); }
private List <string[]> CompleteHA() { List <string[]> result = new List <string[]>(); string ha_congratulations_text = AppiumKeywords.GetText(pageName, "ha_congratulations_text"); bool textmatch = ha_congratulations_text.Contains("CONGRATULATIONS!"); string msg = "Element: HA_Congratulation_Text Expected: CONGRATULATIONS! Actual: " + ha_congratulations_text; result.Add(new string[] { msg, textmatch.ToString() }); System.Threading.Thread.Sleep(3000); AppiumKeywords.Tap(pageName, "hacompletedclosebtn"); return(result); }
public List <string[]> ValidateHAReport() { List <string[]> result = new List <string[]>(); AppiumKeywords.Tap(pageName, "dashboard_ha_viewreportlink"); List <string[]> hareports = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "hareports"); for (int i = 0; i < hareports.Count; i++) { string elementlocatorname = hareports.ElementAt(i)[2]; string expreportdata = hareports.ElementAt(i)[3]; string actualreportdata = AppiumKeywords.GetText(pageName, elementlocatorname); bool textmatch = actualreportdata.Trim().Contains(expreportdata.Trim()); string msg = "Element : " + elementlocatorname + " , Expected : " + expreportdata + " , Actual : " + actualreportdata; result.Add(new string[] { msg, textmatch.ToString() }); } return(result); }
public string GetText() { return(AppiumKeywords.GetText(pageName, "messageareatxt", pckgname)); }
private List <string[]> FillHAModules() { List <string[]> result = new List <string[]>(); List <string[]> haelementdata = new List <string[]>(); haelementdata = CSVReaderDataTable.GetCSVData("CommonContent", pageName, "hamoduletitle"); for (int i = 0; i < haelementdata.Count; i++) { string elementname = haelementdata.ElementAt(i)[2]; string elementlocatorname = haelementdata.ElementAt(i)[3]; string expectedtext = haelementdata.ElementAt(i)[4]; string actualtext = AppiumKeywords.GetText(pageName, elementlocatorname); bool textmatch = actualtext.Contains(expectedtext); string msg = "Element: " + elementname + "Expected: " + expectedtext + "Actual: " + actualtext; result.Add(new string[] { msg, textmatch.ToString() }); System.Threading.Thread.Sleep(3000); switch (i) { case 0: FillYourInfoModule(); break; case 1: VerifySanphotReport(); break; case 2: FillAboutYouModule(); break; case 3: FillYourVitalModule(); break; case 4: FillDietModule(); break; case 5: FillTobaccoModule(); break; case 6: FillHistoryModule(); break; case 7: FillActivityModule(); break; case 8: FillEmotionalHealthModule(); break; case 9: FillAtWorkModule(); break; } System.Threading.Thread.Sleep(2000); } result.AddRange(CompleteHA()); return(result); }