Skip to content

Instantly share code, notes, and snippets.

@trix0
Created February 22, 2018 12:02
Show Gist options
  • Save trix0/1f53db42509dafeffa32aed279e3a6c5 to your computer and use it in GitHub Desktop.
Save trix0/1f53db42509dafeffa32aed279e3a6c5 to your computer and use it in GitHub Desktop.
const init=await client.init(); // appium init (lunch app)
logger.info("Running Signup email");
let random=Math.random().toString(36).substr(2, 5);
//////////////////////////////////// THIS CODE IS MANDATORY -> LEAVE IT HERE
let imageSize=await client.windowHandleSize();
imageSize=imageSize.value.height;
//////////////////////////////////// THIS CODE IS MANDATORY -> LEAVE IT HERE
await fnIsOnScreen(images["Login"+"_"+imageSize],client,20,"If on screen then app Loaded,Logout state true",4000,2000);
await fnClick(images["Login"+"_"+imageSize],client,5,"Click Login button",2000);
var package = await client.getCurrentPackage();
console.log(package);
await fnClick(images["EmailLoginButton"+"_"+imageSize],client,5,"Click Email Login button",2000);
await fnClick(images["YesButton"+"_"+imageSize],client,5,"Click Yes age button",2000);
await fnClick(images["EnterEmailField"+"_"+imageSize],client,5,"Click on Enter Email field",2000);
await client.keys("msa_"+random+"@pointvoucher.com");
await fnClearKeyBoard(client);
await fnClick(images["EmailNextButton"+"_"+imageSize],client,5,"Next email",500);
await fnClick(images["EnterPasswordField"+"_"+imageSize],client,5,"Click on Enter Password field",2000);
await client.keys("123123");
await fnClearKeyBoard(client);
await fnClick(images["PasswordNextButton"+"_"+imageSize],client,5,"Next password",100);
// await fnClick(images["AcceptTermsCircle"+"_"+imageSize],client,5,"Accept terms circle",500);
// await fnClick(images["TermsNextButton"+"_"+imageSize],client,5,"terms next button",500);
await fnClick(images["MyaccountButton"+"_"+imageSize],client,5,"My account button",500);
await fnClick(images["FillYourNameField"+"_"+imageSize],client,5,"Fill name",500);
await client.keys("testName");
await client.addValue("android=new UiSelector().className(\"android.widget.EditText\")","Test")
await fnClearKeyBoard(client);
await fnClick(images["BirthdayField"+"_"+imageSize],client,5,"BirthdayField ",500);
await client.keys('19951010');
//android.widget.EditText EditText
await client.click("android=new UiSelector().className(\"android.widget.EditText\")")
await client.keys('19951010');
//Perform the required action on the element
await fnClearKeyBoard(client);
await fnClick(images["CreateProfileButton"+"_"+imageSize],client,5,"create profile button ",500);
await fnIsOnScreen(images["CoinsIndicator"+"_"+imageSize],client,20,"If 0 coins then looged in",1000);
await fnClick(images["x_OverIntroVideo"+"_"+imageSize],client,5," x Button ",5000);
await fnClick(images["SettingsButton"+"_"+imageSize],client,5,"Settings Button ",500);
await fnClick(images["LogoutButton"+"_"+imageSize],client,5,"Logout Button ",500);
await fnClick(images["BigOkLogout"+"_"+imageSize],client,5,"Big Ok Logout button ",500);
await fnIsOnScreen(images["Login"+"_"+imageSize],client,20,"Logout status correct",5000);
await client.closeApp();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment