class AndroidChromePageElements: # DEFINING LOCATORS # # BY XPATH btn_terms_accept_loc = (By.ID, r"com.android.chrome:id/terms_accept") btn_terms_accept = PageElement(btn_terms_accept_loc) btn_terms_accept_next_loc = (By.ID, r"com.android.chrome:id/next_button") btn_terms_accept_next = PageElement(btn_terms_accept_next_loc) btn_negative_loc = (By.ID, r"com.android.chrome:id/negative_button") btn_negative = PageElement(btn_negative_loc) btn_no_thanks_loc = (By.ID, r"com.android.chrome:id/negative_button") btn_no_thanks = PageElement(btn_no_thanks_loc)
class AndroidBelaxElements: # DEFINING LOCATORS # # Contact Header Button btn_contact_header_loc = (By.XPATH, "//a[@title='Contact Us']") btn_contact_header = PageElement(btn_contact_header_loc) # Contact us Button btn_contact_us_loc = ( By.XPATH, "//android.view.View[@content-desc='Contact Us Contact Us']") btn_contact_us = PageElement(btn_contact_us_loc) txt_first_name_loc = ( By.XPATH, "//android.widget.EditText[@resource-id='form_0036_fld_0_fn']") txt_first_name = PageElement(txt_first_name_loc) txt_last_name_loc = ( By.XPATH, "//android.widget.EditText[@resource-id='form_0036_fld_0_ln']") txt_last_name = PageElement(txt_last_name_loc) txt_email_loc = ( By.XPATH, "//android.widget.EditText[@resource-id='form_0036_fld_1']") txt_email = PageElement(txt_email_loc) txt_phone_loc = ( By.XPATH, "//android.widget.EditText[@resource-id='form_0036_fld_2']") txt_phone = PageElement(txt_phone_loc) sel_service_loc = ( By.XPATH, "//android.widget.EditText[@resource-id='form_0036_fld_3']") sel_service = PageElement(sel_service_loc) txt_description_loc = ( By.XPATH, "//android.widget.EditText[@resource-id='form_0036_fld_4']") txt_description = PageElement(txt_description_loc) btn_submit_loc = ( By.XPATH, "//android.view.View[@resource-id='form_0036_ao_submit_href']") btn_submit = PageElement(btn_submit_loc) lbl_message_sent_loc = ( By.XPATH, "//android.view.View[@content-desc='Thanks for your request!']") lbl_message_sent = PageElement(lbl_message_sent_loc)
def scroll_up_to(self, locator): i = 0 while i < 12: try: if self.driver.find_element(locator[0], locator[1]): return PageElement(locator) except NoSuchElementException: self.scroll_up() return None
class IosCalendarPageElement: # DEFINING LOCATORS # # Button for a higher view of calendar btn_higher_view_loc = ( By.XPATH, r'//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeNavigationBar[1]/XCUIElementTypeButton[1]' ) btn_higher_view = PageElement(btn_higher_view_loc) # Button for a lower view of calendar btn_lower_view_loc = (By.ACCESSIBILITY_ID, r"Today") btn_lower_view = PageElement(btn_lower_view_loc) # Date txt_date_loc = ( By.XPATH, r'//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeStaticText[1]' ) txt_date = PageElement(txt_date_loc) # Calendar Button btn_calendar_loc = ( By.XPATH, r'//*[@name="Toolbar"]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]' ) btn_calendar = PageElement(btn_calendar_loc) # Inbox button btn_inbox_loc = (By.ACCESSIBILITY_ID, r'Inbox') btn_inbox = PageElement(btn_inbox_loc) # year element in year view txt_year_yv_loc = ( By.XPATH, '//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeScrollView[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther[1]/XCUIElementTypeStaticText[1]' ) txt_year_yv = PageElement(txt_year_yv_loc)
class AndroidCalendarPageElement: btn_year_loc = (By.ID, 'mdtp_date_picker_year') btn_year = PageElement(btn_year_loc) txt_picker_day_loc = (By.ID, 'mdtp_date_picker_day') txt_picker_day = PageElement(txt_picker_day_loc) list_days_of_current_month_loc = ( By.XPATH, '//*[@resource-id="com.anydo:id/mdtp_animator"]/android.support.v7.widget.RecyclerView[1]/android.view.View[1]/android.view.View' ) list_days_of_current_month = MultiPageElement( list_days_of_current_month_loc) btn_cancel_loc = (By.ID, 'mdtp_cancel') btn_cancel = PageElement(btn_cancel_loc) btn_ok_loc = (By.ID, 'mdtp_ok') btn_ok = PageElement(btn_ok_loc) list_years_loc = ( By.XPATH, '//*[@resource-id="com.anydo:id/mdtp_animator"]/android.widget.ListView[1]/android.widget.TextView' ) list_years = MultiPageElement(list_years_loc) list_view_years_loc = ( By.XPATH, '//*[@resource-id="com.anydo:id/mdtp_animator"]/android.widget.ListView[1]' ) list_view_years = PageElement(list_view_years_loc) month_calendar_loc = ( By.XPATH, '//*[@resource-id="com.anydo:id/mdtp_animator"]/android.support.v7.widget.RecyclerView[1]/android.view.View[1]' ) month_calendar = PageElement(month_calendar_loc)
class AndroidCalculatorByImagesPageElements: # DEFINING LOCATORS # # BY XPATH # Numbers emu_current_package = "com.android.calculator2" rd_current_package = "com.google.android.calculator" btn_zero_img = "templates/calculator/zero_btn.png" btn_zero_loc = (By.IMAGE, fr.get_base64_by_image_path(btn_zero_img)) btn_zero = PageElement(btn_zero_loc) btn_one_loc = (By.IMAGE, r"//android.widget.Button[@text='1']") btn_one = PageElement(btn_one_loc) btn_two_loc = (By.IMAGE, r"//android.widget.Button[@text='2']") btn_two = PageElement(btn_two_loc) btn_three_loc = (By.IMAGE, r"//android.widget.Button[@text='3']") btn_three = PageElement(btn_three_loc) btn_four_loc = (By.IMAGE, r"//android.widget.Button[@text='4']") btn_four = PageElement(btn_four_loc) btn_five_loc = (By.IMAGE, r"//android.widget.Button[@text='5']") btn_five = PageElement(btn_five_loc) btn_six_loc = (By.IMAGE, r"//android.widget.Button[@text='6']") btn_six = PageElement(btn_six_loc) btn_seven_loc = (By.IMAGE, r"//android.widget.Button[@text='7']") btn_seven = PageElement(btn_seven_loc) btn_eight_loc = (By.IMAGE, r"//android.widget.Button[@text='8']") btn_eight = PageElement(btn_eight_loc) btn_nine_loc = (By.IMAGE, r"//android.widget.Button[@text='9']") btn_nine = PageElement(btn_nine_loc) # # Operations btn_add_loc = (By.IMAGE, r"//android.widget.Button[" r"@resource-id='" + emu_current_package + ":id/op_add' or" r"@resource-id='" + rd_current_package + ":id/op_add']") btn_add = PageElement(btn_add_loc) btn_sub_loc = (By.IMAGE, r"//android.widget.Button[@resource-id='" + emu_current_package + ":id/op_sub' or" r"@resource-id='" + rd_current_package + ":id/op_sub']") btn_sub = PageElement(btn_sub_loc) btn_div_loc = (By.IMAGE, r"//android.widget.Button[@resource-id='" + emu_current_package + ":id/op_div' or" r"@resource-id='" + rd_current_package + ":id/op_div']") btn_div = PageElement(btn_div_loc) btn_mul_loc = (By.IMAGE, r"//android.widget.Button[@resource-id='" + emu_current_package + ":id/op_mul' or" r"@resource-id='" + rd_current_package + ":id/op_mul']") btn_mul = PageElement(btn_mul_loc) btn_equ_loc = (By.IMAGE, r"//android.widget.Button[@text='=']") btn_equ = PageElement(btn_equ_loc) btn_del_loc = (By.IMAGE, r"//android.widget.Button[@resource-id='" + emu_current_package + ":id/del' or" r"@resource-id='" + rd_current_package + ":id/del']") btn_del = PageElement(btn_del_loc) # Result txt_result_loc = ( By.IMAGE, r"//android.widget.TextView[contains(@resource-id,'id/result')]") txt_result = PageElement(txt_result_loc)
class WindowsDesktopCalculatorPageElements: # DEFINING LOCATORS # # BY XPATH # Numbers btn_zero_loc = (By.NAME, r"Zero") btn_zero = PageElement(btn_zero_loc) btn_one_loc = (By.NAME, r"One") btn_one = PageElement(btn_one_loc) btn_two_loc = (By.NAME, r"Two") btn_two = PageElement(btn_two_loc) btn_three_loc = (By.NAME, r"Three") btn_three = PageElement(btn_three_loc) btn_four_loc = (By.NAME, r"Four") btn_four = PageElement(btn_four_loc) btn_five_loc = (By.NAME, r"Five") btn_five = PageElement(btn_five_loc) btn_six_loc = (By.NAME, r"Six") btn_six = PageElement(btn_six_loc) btn_seven_loc = (By.NAME, r"Seven") btn_seven = PageElement(btn_seven_loc) btn_eight_loc = (By.NAME, r"Eight") btn_eight = PageElement(btn_eight_loc) btn_nine_loc = (By.NAME, r"Nine") btn_nine = PageElement(btn_nine_loc) # # Operations btn_add_loc = (By.NAME, r"Plus") btn_add = PageElement(btn_add_loc) btn_sub_loc = (By.NAME, r"Minus") btn_sub = PageElement(btn_sub_loc) btn_mult_loc = (By.NAME, r"Multiply by") btn_mult = PageElement(btn_mult_loc) btn_div_loc = (By.NAME, r"Divide by") btn_div = PageElement(btn_div_loc) btn_equ_loc = (By.NAME, r"Equals") btn_equ = PageElement(btn_equ_loc) btn_clear_loc = (By.NAME, r"Clear") btn_clear = PageElement(btn_clear_loc) # Result txt_result_loc = (By.ACCESSIBILITY_ID, r"CalculatorResults") # txt_result_loc = (By.NAME, r"Main Display") txt_result = PageElement(txt_result_loc)
class AndroidCalculatorPageElements: # DEFINING LOCATORS # # BY XPATH # Numbers emu_current_package = "com.android.calculator2" rd_current_package = "com.google.android.calculator" btn_zero_loc = (By.XPATH, r"//android.widget.Button[@text='0']") btn_zero = PageElement(btn_zero_loc) btn_one_loc = (By.XPATH, r"//android.widget.Button[@text='1']") btn_one = PageElement(btn_one_loc) btn_two_loc = (By.XPATH, r"//android.widget.Button[@text='2']") btn_two = PageElement(btn_two_loc) btn_three_loc = (By.XPATH, r"//android.widget.Button[@text='3']") btn_three = PageElement(btn_three_loc) btn_four_loc = (By.XPATH, r"//android.widget.Button[@text='4']") btn_four = PageElement(btn_four_loc) btn_five_loc = (By.XPATH, r"//android.widget.Button[@text='5']") btn_five = PageElement(btn_five_loc) btn_six_loc = (By.XPATH, r"//android.widget.Button[@text='6']") btn_six = PageElement(btn_six_loc) btn_seven_loc = (By.XPATH, r"//android.widget.Button[@text='7']") btn_seven = PageElement(btn_seven_loc) btn_eight_loc = (By.XPATH, r"//android.widget.Button[@text='8']") btn_eight = PageElement(btn_eight_loc) btn_nine_loc = (By.XPATH, r"//android.widget.Button[@text='9']") btn_nine = PageElement(btn_nine_loc) # # Operations btn_add_loc = (By.XPATH, r"//android.widget.Button[" r"@resource-id='" + emu_current_package + ":id/op_add' or" r"@resource-id='" + rd_current_package + ":id/op_add']") btn_add = PageElement(btn_add_loc) btn_sub_loc = (By.XPATH, r"//android.widget.Button[@resource-id='" + emu_current_package + ":id/op_sub' or" r"@resource-id='" + rd_current_package + ":id/op_sub']") btn_sub = PageElement(btn_sub_loc) btn_div_loc = (By.XPATH, r"//android.widget.Button[@resource-id='" + emu_current_package + ":id/op_div' or" r"@resource-id='" + rd_current_package + ":id/op_div']") btn_div = PageElement(btn_div_loc) btn_mul_loc = (By.XPATH, r"//android.widget.Button[@resource-id='" + emu_current_package + ":id/op_mul' or" r"@resource-id='" + rd_current_package + ":id/op_mul']") btn_mul = PageElement(btn_mul_loc) btn_equ_loc = (By.XPATH, r"//android.widget.Button[@text='=']") btn_equ = PageElement(btn_equ_loc) btn_del_loc = (By.XPATH, r"//android.widget.Button[@resource-id='" + emu_current_package + ":id/del' or" r"@resource-id='" + rd_current_package + ":id/del']") btn_del = PageElement(btn_del_loc) # Result txt_result_loc = (By.XPATH, r"//android.widget.TextView[contains(@resource-id,'id/result')]") txt_result = PageElement(txt_result_loc) # Other Examples # By UIAutomation btn_zero_ui_automation_loc = (By.ANDROID_UIAUTOMATOR, r'new UiSelector().resourceId("com.android.calculator2:id/digit_0")') btn_zero_ui_automation = PageElement(btn_zero_ui_automation_loc) btn_one_ui_automation_loc = (By.ANDROID_UIAUTOMATOR, r'new UiSelector().resourceId("com.android.calculator2:id/digit_1")') btn_one_ui_automation = PageElement(btn_one_ui_automation_loc) # By CLASS NAME btn_two_class_name_loc = (By.CLASS_NAME, "android.widget.Button") btn_two_class_name = MultiPageElement(btn_two_class_name_loc) # By ID btn_three_id_loc = (By.ID, r"com.android.calculator2:id/digit_3") btn_three_id = PageElement(btn_three_id_loc) # By Accessibility ID btn_delete_accessibility_id_loc = (By.ACCESSIBILITY_ID, r"delete") btn_delete_accessibility_id = PageElement(btn_delete_accessibility_id_loc) # Advanced operations btn_advanced_op_accessibility_id_loc = (By.ACCESSIBILITY_ID, r"Advanced operations") btn_advanced_op_accessibility_id = PageElement(btn_advanced_op_accessibility_id_loc)
class AndroidAnydoPageElements: # DEFINING LOCATORS # # Add task button btn_add_task_loc = (By.ID, 'quick_add_button_container') btn_add_task = PageElement(btn_add_task_loc) # Go task button btn_task_loc = (By.ID, 'main_tabs_tasks') btn_task = PageElement(btn_task_loc) btn_later_today_loc = (By.XPATH, '//*[@text="Later today"]') btn_later_today = PageElement(btn_later_today_loc) btn_this_evening_loc = (By.XPATH, '//*[@text="This evening"]') btn_this_evening = PageElement(btn_this_evening_loc) btn_tomorrow_morning_loc = (By.XPATH, '//*[@text="Tomorrow morning"]') btn_tomorrow_morning = PageElement(btn_tomorrow_morning_loc) btn_next_week_loc = (By.XPATH, '//*[@text="Next week"]') btn_next_week = PageElement(btn_next_week_loc) btn_someday_loc = (By.XPATH, '//*[@resource-id="com.anydo:id/quickAddOptionButtonsContainer"]/android.widget.CheckBox[@text="Someday"]') btn_someday = PageElement(btn_someday_loc) btn_custom_loc = (By.XPATH, '//*[@text="Custom"]') btn_custom = PageElement(btn_custom_loc) btn_confirm_task_loc = (By.ID, 'quick_add_button_container') btn_confirm_task = PageElement(btn_confirm_task_loc) bar_day_loc = (By.ID, 'quickAddOptionContainer') bar_day = PageElement(bar_day_loc) btn_delete_task_loc = (By.ID, 'deleteTaskButton') btn_delete_task = PageElement(btn_delete_task_loc) list_tasks_loc = (By.ID, 'title') list_tasks = MultiPageElement(list_tasks_loc) txt_task_title_loc = (By.ID, 'quick_add_input') txt_task_title = PageElement(txt_task_title_loc) task_detail_loc = (By.ID, 'taskDetailsRecycler') task_detail = PageElement(task_detail_loc) btn_true_delete_button_loc = (By.ID, 'deleteButton') btn_true_delete_button = PageElement(btn_true_delete_button_loc) btn_keep_editing_loc = (By.ID, 'keepEditingButton') btn_keep_editing = PageElement(btn_keep_editing_loc)
class IosAnydoPageElements: # DEFINING LOCATORS # # Test Locator btn_test_loc = (By.XPATH, "//a[@title='IOs Button']") btn_test = PageElement(btn_test_loc)
class MacCalculatorPageElements: window_path = "/AXApplication[@AXTitle='Calculator']/AXWindow[0]" window_loc = (By.XPATH, window_path) result_group_path = window_path + "/AXGroup[0]" result_group_loc = (By.XPATH, result_group_path) basic_group_path = window_path + "/AXGroup[1]" basic_group_loc = (By.XPATH, basic_group_path) scientific_group_path = window_path + "/AXGroup[2]" scientific_group_loc = (By.XPATH, scientific_group_path) programmer_group_path = window_path + "/AXGroup[1]" programmer_group_loc = (By.XPATH, programmer_group_path) menu_bar_ax_path = "/AXApplication[@AXTitle='Calculator']/AXMenuBar" menu_bar_ax_loc = (By.XPATH, menu_bar_ax_path) # DEFINING LOCATORS # # BY XPATH # Numbers btn_zero_loc = (By.XPATH, basic_group_path + "/AXButton[@AXDescription='zero']") btn_zero = PageElement(btn_zero_loc) btn_one_loc = (By.XPATH, basic_group_path + "/AXButton[@AXDescription='one']") btn_one = PageElement(btn_one_loc) btn_two_loc = (By.XPATH, basic_group_path + "/AXButton[@AXDescription='two']") btn_two = PageElement(btn_two_loc) btn_three_loc = (By.XPATH, basic_group_path + "/AXButton[@AXDescription='three']") btn_three = PageElement(btn_three_loc) btn_four_loc = (By.XPATH, basic_group_path + "/AXButton[@AXDescription='four']") btn_four = PageElement(btn_four_loc) btn_five_loc = (By.XPATH, basic_group_path + "/AXButton[@AXDescription='five']") btn_five = PageElement(btn_five_loc) btn_six_loc = (By.XPATH, basic_group_path + "/AXButton[@AXDescription='six']") btn_six = PageElement(btn_six_loc) btn_seven_loc = (By.XPATH, basic_group_path + "/AXButton[@AXDescription='seven']") btn_seven = PageElement(btn_seven_loc) btn_eight_loc = (By.XPATH, basic_group_path + "/AXButton[@AXDescription='eight']") btn_eight = PageElement(btn_eight_loc) btn_nine_loc = (By.XPATH, basic_group_path + "/AXButton[@AXDescription='nine']") btn_nine = PageElement(btn_nine_loc) # # Operations btn_add_loc = (By.XPATH, basic_group_path + "/AXButton[@AXDescription='add']") btn_add = PageElement(btn_add_loc) btn_sub_loc = (By.XPATH, basic_group_path + "/AXButton[@AXDescription='subtract']") btn_sub = PageElement(btn_sub_loc) btn_mul_loc = (By.XPATH, basic_group_path + "/AXButton[@AXDescription='multiply']") btn_mul = PageElement(btn_mul_loc) btn_div_loc = (By.XPATH, basic_group_path + "/AXButton[@AXDescription='divide']") btn_div = PageElement(btn_div_loc) # Close app btn_close_loc = (By.XPATH, window_path + "/AXCloseButton") btn_close = PageElement(btn_close_loc) # Equal btn_eq_loc = (By.XPATH, basic_group_path + "/AXButton[@AXDescription='equals']") btn_eq = PageElement(btn_eq_loc) # Result txt_result_loc = (By.XPATH, result_group_path + "/AXStaticText[@AXDescription='main display']") txt_result = PageElement(txt_result_loc) # clear btn_clear_loc = (By.XPATH, basic_group_path + "/AXButton[@AXDescription='clear']") btn_clear = PageElement(btn_clear_loc)
class IosReminderPageElements: # Locator examples: btn = (By.ACCESSIBILITY_ID, r"Add") btn_loc = (By.XPATH, r"//*[@name='Add']") btn_loc = ( By.XPATH, r"//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeButton[1]" ) # DEFINING LOCATORS # # BY XPATH # + button # btn_add_loc = (By.ACCESSIBILITY_ID, r"Add") # btn_add_loc = (By.XPATH, r"//*[@name='Add']") btn_add_loc = ( By.XPATH, r"//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeButton[1]" ) btn_add = PageElement(btn_add_loc) # Add reminder option btn_add_reminder_loc = ( By.XPATH, r"//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[2]/XCUIElementTypeSheet[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther[3]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]" ) # btn_add_reminder_loc = (By.ACCESSIBILITY_ID, r"") btn_add_reminder = PageElement(btn_add_reminder_loc) # Add list option # btn_add_list_loc = (By.XPATH, r"//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[2]/XCUIElementTypeSheet[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther[3]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[3]/XCUIElementTypeButton[1]") btn_add_list_loc = (By.ACCESSIBILITY_ID, r"List") btn_add_list = PageElement(btn_add_list_loc) # Search # txt_search_reminder_loc = (By.XPATH, r"//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeSearchField[1]") txt_search_reminder_loc = (By.ACCESSIBILITY_ID, r"Search") txt_search_reminder = PageElement(txt_search_reminder_loc) # Cancel btn_cancel_loc = (By.ACCESSIBILITY_ID, r"Cancel") # btn_cancel_loc = (By.XPATH, r"//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[2]/XCUIElementTypeSheet[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[2]/XCUIElementTypeOther[2]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeButton[1]") btn_cancel = PageElement(btn_cancel_loc) # Schedule tab btn_schedule_tab_loc = (By.ACCESSIBILITY_ID, r"Scheduled") # btn_schedule_tab_loc = (By.XPATH, r"//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeScrollView[1]/XCUIElementTypeButton[1]") btn_schedule_tab = PageElement(btn_schedule_tab_loc) # Reminder tab btn_reminder_tab_loc = (By.ACCESSIBILITY_ID, r"Reminders") # btn_reminder_tab_loc = (By.XPATH, r"//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeScrollView[1]/XCUIElementTypeButton[2]") btn_reminder_tab = PageElement(btn_reminder_tab_loc) # Back btn_back_loc = (By.ACCESSIBILITY_ID, r"Stack of other lists") # btn_back_loc = (By.XPATH, r"//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeScrollView[1]/XCUIElementTypeButton[2]") btn_back = PageElement(btn_back_loc) # New Reminder btn_new_reminder_loc = (By.ACCESSIBILITY_ID, r"New reminder") # btn_new_reminder_loc = (By.XPATH, r"// XCUIElementTypeApplication[1] / XCUIElementTypeWindow[1] / XCUIElementTypeOther[1] / XCUIElementTypeOther[1] / \ # XCUIElementTypeScrollView[1] / XCUIElementTypeButton[1] / XCUIElementTypeOther[2] / XCUIElementTypeTable[1] / \ # XCUIElementTypeOther[1] / XCUIElementTypeTextView[1]") btn_new_reminder = PageElement(btn_new_reminder_loc) # More Info btn_more_info_loc = (By.ACCESSIBILITY_ID, r"More Info") # btn_more_info_loc = (By.XPATH, r"//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeScrollView[1]/XCUIElementTypeButton[1]/XCUIElementTypeOther[2]/XCUIElementTypeTable[1]/XCUIElementTypeOther[1]/XCUIElementTypeButton[1]") btn_more_info = PageElement(btn_more_info_loc) # >>>>>>>>>>>>>>< # Done btn_done_loc = (By.ACCESSIBILITY_ID, r"Done") # btn_done_loc = (By.XPATH, r"//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeNavigationBar[1]/XCUIElementTypeButton[1]") btn_done = PageElement(btn_done_loc) # Reminder Title txt_reminder_title_loc = ( By.XPATH, r"//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeTable[1]/XCUIElementTypeCell[1]/XCUIElementTypeTextView[1]" ) txt_reminder_title = PageElement(txt_reminder_title_loc) # Remind me day btn_reminder_day_loc = (By.ACCESSIBILITY_ID, r"Remind me on a day") # btn_reminder_day_loc = (By.XPATH, r"//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeTable[1]/XCUIElementTypeCell[2]/XCUIElementTypeSwitch[1]") btn_reminder_day = PageElement(btn_reminder_day_loc) # Priority None btn_priority_none_loc = (By.ACCESSIBILITY_ID, r"None") # btn_priority_none_loc = (By.XPATH, r"//*[@name='None']") btn_priority_none = PageElement(btn_priority_none_loc) # Priority ! btn_priority_low_loc = (By.ACCESSIBILITY_ID, r"Low") btn_priority_low = PageElement(btn_priority_low_loc) # Priority !! btn_priority_medium_loc = (By.ACCESSIBILITY_ID, r"Medium") btn_priority_medium = PageElement(btn_priority_medium_loc) # Priority !!! btn_priority_high_loc = (By.ACCESSIBILITY_ID, r"High") btn_priority_high = PageElement(btn_priority_high_loc) # Reminder Notes # txt_reminder_notes_loc = (By.XPATH, r"//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeTable[1]/XCUIElementTypeCell[4]/XCUIElementTypeTextView[1]") # txt_reminder_notes_loc = (By.XPATH, r"(// XCUIElementTypeTextView)[last()]") txt_reminder_notes_loc = ( By.XPATH, r"(//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeTable[1]//XCUIElementTypeTextView)[last()]" ) txt_reminder_notes = PageElement(txt_reminder_notes_loc) # Reminder btn_reminder_loc = ( By.XPATH, r"//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeScrollView[1]/XCUIElementTypeButton[2]" ) btn_reminder = PageElement(btn_reminder_loc) # Reminder search result block_reminder_list_loc = ( By.XPATH, r"//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeTable[1]" ) block_reminder_list = PageElement(block_reminder_list_loc) # First search result first_search_result_loc = ( By.XPATH, r"//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeTable[1]/XCUIElementTypeCell[1]" ) first_search_result = PageElement(first_search_result_loc) # First Reminder first_reminder_loc = ( By.XPATH, # r"//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeScrollView[1]/XCUIElementTypeButton[1]/XCUIElementTypeOther[1]/XCUIElementTypeTable[1]/XCUIElementTypeCell[1]") r"//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeOther[1]/XCUIElementTypeScrollView[1]/XCUIElementTypeButton[1]/XCUIElementTypeOther[2]/XCUIElementTypeTable[1]/XCUIElementTypeCell[1]" ) first_reminder = PageElement(first_reminder_loc)