@@ -0,0 +1,1779 @@
+import os%0Afrom appium import webdriver%0A%0A# capabilities for built-in email app%0Adesired_caps = %7B%7D%0Adesired_caps%5B'platformName'%5D = 'Android'%0Adesired_caps%5B'platformVersion'%5D = '5.1'%0Adesired_caps%5B'deviceName'%5D = 'Android Emulator'%0Adesired_caps%5B'appPackage'%5D = 'com.android.email'%0Adesired_caps%5B'appActivity'%5D = 'com.android.email.activity.Welcome'%0A%0A# email locator index%0Aemail_prefix = 'com.android.email:id/'%0Ato_field_locator = email_prefix + 'to'%0Asubject_field_locator = email_prefix + 'subject'%0Abody_field_locator = email_prefix + 'body'%0A%0Asend_button_locator = email_prefix + 'send'%0Acompose_button_locator = email_prefix + 'compose_button'%0Aconversation_list_view_locator = email_prefix + 'conversation_list_view'%0A%0Adef test_send_mail():%0A    driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)%0A    %0A    compose = driver.find_element_by_id(compose_button_locator)%0A    if compose.is_displayed():%0A        compose.click()%0A    %0A    to = driver.find_element_by_id(to_field_locator)%0A    subject = driver.find_element_by_id(subject_field_locator)%0A    body = driver.find_element_by_id(body_field_locator)%0A    send = driver.find_element_by_id(send_button_locator)%0A    %0A    to.send_keys('zapionator@gmail.com')%0A    subject.send_keys('Verify sending email')%0A    body.send_keys('Hello, this is a test from the testing script')%0A    send.click()%0A    %0A    # Verification%0A    conversation_list = driver.find_elements(conversation_list_view_locator)%0A    els = conversation_list.find_elements_by_id('android.widget.FrameLayout')%0A    loc_1 = els%5B0%5D.location %0A    loc_2 = els%5B3%5D.location%0A    els.swipe(loc_1%5B'x'%5D, loc_1%5B'y'%5D, loc_2%5B'x'%5D, loc_2%5B'y'%5D, 800)%0A    os.sleep(10)%0A    conversation_list.find_elements_by_id('android.widget.FrameLayout')%5B0%5D.click()%0A    %0A    %0A%0A%0A%0A    driver.quit()%0A

Add demo app for appium