Best SeLion code snippet using com.paypal.selion.android.sample.AppiumAndroidButtonShortClickTest.testButtonClick
Source:AppiumAndroidButtonShortClickTest.java
...39 textView = new UiTextView(TEXT_VIEW_LOCATOR);40 }41 @Test42 @MobileTest(appPath = PAGE_OBJECTS_APP_PATH)43 public void testButtonClick() throws InterruptedException {44 WebDriverWaitUtils.waitUntilElementIsVisible(ACTION_BUTTON_LOCATOR);45 menuButton.click(shortPressButton);46 shortPressButton.click(textView);47 String output = textView.getText();48 Assert.assertEquals(output.contains(CLICKED_TEXT), true, "Button center click not working properly");49 }50 @Test51 @MobileTest(appPath = PAGE_OBJECTS_APP_PATH)52 public void testButtonClickTopLeft() throws InterruptedException {53 WebDriverWaitUtils.waitUntilElementIsVisible(ACTION_BUTTON_LOCATOR);54 menuButton.click(shortPressButton);55 WebDriverWaitUtils.waitUntilElementIsVisible(SHORT_PRESS_BUTTON_LOCATOR);56 shortPressButton.clickTopLeft(textView);57 String output = textView.getText();58 Assert.assertEquals(output.contains(CLICKED_TEXT), true, "Button top left click not working properly");59 }60 @Test61 @MobileTest(appPath = PAGE_OBJECTS_APP_PATH)62 public void testButtonClickBottomRight() throws InterruptedException {63 WebDriverWaitUtils.waitUntilElementIsVisible(ACTION_BUTTON_LOCATOR);64 menuButton.click(shortPressButton);65 shortPressButton.clickBottomRight(textView);66 String output = textView.getText();67 Assert.assertEquals(output.contains(CLICKED_TEXT), true, "Button bottom right click not working properly");68 }69}...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!