public void EditProgram(string programName, string editProgramName) { KeywordImplementation.SwipeVerticle(3, 0.50, 0.80, By.Name(programName)); Logger.logInfo(string.Format("Edit the patient with info '{0}'", programName)); KeywordImplementation.TypeText(By.Name(programName), editProgramName); ((AndroidDriver <OpenQA.Selenium.Appium.Android.AndroidElement>)Accessor.getDriver()).PressKeyCode(AndroidKeyCode.Back); }
public void ValidateAppVersion() { KeywordImplementation.SwipeVerticle(3, 0.50, 0.20, By.Id("itemTextViewRight"), true); string versionInfo = KeywordImplementation.UIObject(By.Id("itemTextViewRight"), TimeSpan.FromSeconds(2)).Text; if ((versionInfo.Split('.').Length - 1) == 3) { Logger.logSuccess(string.Format("Application version {0} displayed is correct", versionInfo)); } else { Logger.logFailure(string.Format("Application version {0} displayed is incorrect", versionInfo)); } }
public void ValidateContentsWithContentDesc(string objectName, bool isFound) { int swipeCnt = 0; bool check = false; string[] validationObjectArray = objectName.Split(';'); foreach (string obj in validationObjectArray) { while (swipeCnt != 3) { if (KeywordImplementation.waitForObjectExist(By.XPath("//*[contains(@content-desc,'" + obj + "')]"), TimeSpan.FromSeconds(1))) { check = true; break; } if (!check) { KeywordImplementation.SwipeVerticle(swipeCnt, 0.50, 0.20, By.XPath("//*[contains(@content-desc,'" + obj + "')]")); swipeCnt++; } else { break; } } string message = null; if (check == isFound) { message = isFound?string.Format("'{0}' is found", obj):string.Format("'{0}' is not found", obj); Logger.logSuccess(message); } else { message = isFound?string.Format("'{0}' is not found", obj):string.Format("'{0}' is found", obj); Logger.logFailure(message); } } Logger.logSnapshot(); }
public void ValidateContents(string contents) { string[] contentsArray = contents.Split(';'); foreach (string str in contentsArray) { bool check = false; //KeywordImplementation.SwipeVerticle(3,0.60,0.20,By.Name(str)); KeywordImplementation.SwipeVerticle(3, 0.60, 0.20, By.XPath("//*[contains(@text,'" + str + "')]")); if (KeywordImplementation.waitForObjectExist(By.XPath("//*[contains(@text,'" + str + "')]"), TimeSpan.FromSeconds(1))) { check = true; Logger.logSuccess(string.Format("Information '{0}' text has found", str)); } if (!check) { Logger.logFailure(string.Format("Information '{0}' text has not found", str)); } } Logger.logSnapshot(); }
public void TapOnWithSwipeDown(string objectName) { KeywordImplementation.SwipeVerticle(3, 0.20, 0.50, By.Name(objectName)); KeywordImplementation.Tap(objectName); }