def step_check_title(context, page): if page == PageName.CHILD_SETTINGS: assert_that( page_factory(PageName.CHILD_SETTINGS).title(), equal_to("Child Controls")) elif page == PageName.ADD_ANOTHER_CHILD: assert_that( page_factory(PageName.ADD_ANOTHER_CHILD).title(), equal_to("Who will play with this device?")) elif page == PageName.VIEW_USAGE_DETAILS: assert_that( page_factory(PageName.VIEW_USAGE_DETAILS).title(), equal_to("Usage Details for Vcc")) elif page == PageName.EDIT_PROFILE: assert_that( page_factory(PageName.EDIT_PROFILE).title(), equal_to("Edit profile for Vcc")) elif page == PageName.PROFILE_PERMISSION: assert_that( page_factory(PageName.PROFILE_PERMISSION).title(), equal_to("Profile Permissions")) elif page == PageName.TIME_CONTROLS: assert_that( page_factory(PageName.TIME_CONTROLS).title(), equal_to("Vcc's Time Controls"))
def step_check_title(context, page): if page == PageName.CHILD_SETTINGS: assert_that(page_factory(PageName.CHILD_SETTINGS).title(), equal_to("Child Controls")) elif page == PageName.ADD_ANOTHER_CHILD: assert_that(page_factory(PageName.ADD_ANOTHER_CHILD).title(), equal_to("Who will play with this device?")) elif page == PageName.VIEW_USAGE_DETAILS: assert_that(page_factory(PageName.VIEW_USAGE_DETAILS).title(), equal_to("Usage Details for Vcc")) elif page == PageName.EDIT_PROFILE: assert_that(page_factory(PageName.EDIT_PROFILE).title(), equal_to("Edit profile for Vcc")) elif page == PageName.PROFILE_PERMISSION: assert_that(page_factory(PageName.PROFILE_PERMISSION).title(), equal_to("Profile Permissions")) elif page == PageName.TIME_CONTROLS: assert_that(page_factory(PageName.TIME_CONTROLS).title(), equal_to("Vcc's Time Controls"))
def step_open_kid_ui_page(context, name): if name == 'end 1': context.packageApp = 'com.leapfrog.weeklyengagement' context.activityApp = 'com.leapfrog.weeklyengagement.MainActivity' page_factory(PageName.TITLE_END_1).launch_page(context.packageApp, context.activityApp) elif name == 'end 2': context.packageApp = 'com.leapfrog.dailyengagement' context.activityApp = 'com.leapfrog.dailyengagement.MenuActivity' page_factory(PageName.TITLE_END_2).launch_page(context.packageApp, context.activityApp) elif name == 'stretchy monkey': context.packageApp = 'com.leapfrog.ANDS.app.x00200026.AP_SM2' context.activityApp = 'com.leapfrog.ANDS.app.x00200026.AP_SM2.LFMainActivity' page_factory(PageName.TITLE_STRETCHY_MONKEY).launch_page(context.packageApp, context.activityApp) time.sleep(30)
def step_take_picture(context, type): page_factory(PageName.CAMERA).delete_all_pictures() if type == 'front': page_factory(PageName.CAMERA).take_front_camera() else: page_factory(PageName.CAMERA).take_back_camera()
def step_go_to_page(context): page_factory(PageName.PARENT_SETTINGS).click_child_controls()
def step_open_parent_settings_page(context): page_factory(PageName.PARENT_SETTINGS).launch_page(context.packageApp, context.activityApp)
def step_go_to_page(context): page_factory(PageName.CHILD_SETTINGS).click_profile_permission()
def step_go_to_page(context): page_factory(PageName.CHILD_SETTINGS).click_view_usage_details()
def step_go_to_page(context): page_factory(PageName.CHILD_SETTINGS).click_add_another_child()
def step_go_to_page(context): page_factory(PageName.CHILD_SETTINGS).click_first_child()
def step_go_to_page(context): page_factory(PageName.CHILD_SETTINGS).click_add_another_child()
def step_open_kid_ui_page(context): page_factory(PageName.KID_UI).launch_page(context.packageApp, context.activityApp)
def step_go_to_page(context): page_factory(PageName.PARENT_SETTINGS).click_all_apps()
def step_check_taken_picture(context): assert_that(page_factory(PageName.CAMERA).is_taken_picture(), equal_to(1)) page_factory(PageName.CAMERA).delete_all_pictures()
def step_take_picture(context, type): page_factory(PageName.CAMERA).delete_all_pictures() if type == 'front': page_factory(PageName.CAMERA).take_front_camera() else: page_factory(PageName.CAMERA).take_back_camera()
def step_check_taken_picture(context): assert_that(page_factory(PageName.CAMERA).is_taken_picture(), equal_to(1)) page_factory(PageName.CAMERA).delete_all_pictures()
def step_go_to_page(context): page_factory(PageName.PARENT_SETTINGS).click_all_apps()
def step_go_to_page(context): page_factory(PageName.CHILD_SETTINGS).click_view_usage_details()
def step_go_to_page(context): page_factory(PageName.CHILD_SETTINGS).click_first_child()
def step_go_to_page(context): page_factory(PageName.CHILD_SETTINGS).click_edit_profile()
def step_go_to_page(context): page_factory(PageName.CHILD_SETTINGS).click_edit_profile()
def step_go_to_page(context): page_factory(PageName.CHILD_SETTINGS).click_profile_permission()
def step_go_to_page(context): page_factory(PageName.CHILD_SETTINGS).click_time_controls()
def step_go_to_page(context): page_factory(PageName.CHILD_SETTINGS).click_time_controls()
def step_go_to_page(context): page_factory(PageName.PARENT_SETTINGS).click_child_controls()
def step_open_parent_settings_page(context): page_factory(PageName.PARENT_SETTINGS).launch_page(context.packageApp, context.activityApp)