def test_purchase_try_now_after_bought_none(root_manager, detail_screen): control.press(detail_screen.buy_button) control.press(detail_screen.buy_button) assert root_manager.current == 'tasks' tasks_screen = root_manager.get_screen('tasks') assert tasks_screen.family is None assert tasks_screen.tasks == []
def test_press_quick_test(menu, root_manager): assert menu.quick_test_button is not None control.press(menu.quick_test_button) assert not root_manager.has_screen('activity') assert root_manager.has_screen('tasks') assert not root_manager.has_screen('purchases') assert root_manager.current == 'tasks'
def test_gp_leaderboard_button(empty_data, menu, root_manager, running_app, mocker): assert menu.gp_leaderboard_button is not None show_leaderboard_mock = mocker.patch('gplay.GoogleClient.show_leaderboard') control.press(menu.gp_leaderboard_button) assert running_app.google_client.is_connected assert show_leaderboard_mock.call_count == 1
def test_press_overview(not_empty_data, menu, root_manager): assert menu.overview_button is not None control.press(menu.overview_button) assert root_manager.has_screen('activity') assert not root_manager.has_screen('tasks') assert not root_manager.has_screen('purchases') assert root_manager.current == 'activity'
def test_purchase_detail_screen_buy(detail_screen, billing, tracker): from utils import _ control.press(detail_screen.buy_button) assert detail_screen.buy_button.source == "atlas://data/atlas/purchases/play_now" assert detail_screen.buy_button.text == _("TRY NOW") assert_bought(billing, detail_screen.item_id, callbacks=[detail_screen.mark_purchased, detail_screen.thank_you_popup]) assert_tracker_event_sent(tracker, 'purchase', 'menu', detail_screen.item_id)
def test_purchase_try_now_after_bought(root_manager, detail_screen): import settings control.press(detail_screen.buy_button) control.press(detail_screen.buy_button) assert root_manager.current == 'tasks' tasks_screen = root_manager.get_screen('tasks') assert tasks_screen.family is None unlocked_tasks = settings.INAPP_PURCHASES[detail_screen.item_id]['unlocks_tasks'] assert tasks_screen.tasks == unlocked_tasks
def test_filter_panel(not_empty_data, root_manager, screen): filter_panel = screen.panel.filter_panel assert root_manager.get_screen('activity') is screen for button in filter_panel.buttons: control.press(button) filter_panel.family = button.family assert screen.family == button.family assert screen.panel.tab_panel.current_tab.family == button.family for tab in screen.panel.tab_panel.tab_list: assert tab.family == button.family
def test_tutorial_screen(running_app, root_manager): from screens.tutorial import TutorialScreen screen = TutorialScreen() manager = screen.main_manager assert manager.current == 'welcome' assert manager.has_screen('start_test') assert manager.has_screen('tasks_to_stats') assert manager.has_screen('categories') assert manager.has_screen('notifications') assert manager.has_screen('tasks') assert manager.has_screen('results') start_test_screen = manager.get_screen('start_test') press(start_test_screen.next_button) assert root_manager.current == 'tasks'
def main(args): combo('alt', '4') # Switch to game screen press('space') x, y = p.size() cx, cy = x // 2, y // 2 sleep(0.1) click(cx, cy, button='right') # Raise shields p.keyDown('w') while True: click(cx, cy - 50, clicks=10) sleep(0.1) p.keyUp('w') press('space') #combo('ctrl', '`') #txt = 'echo "This text was written by a bot!"' #write(txt) #press('enter') return 0
def test_tabs(not_empty_data, root_manager, screen): panel = screen.panel control.press(panel.day_tab) control.release(panel.day_tab) assert panel.tab_panel.current_tab == panel.day_tab control.press(panel.week_tab) control.release(panel.week_tab) assert panel.tab_panel.current_tab == panel.week_tab control.press(panel.progress_tab) control.release(panel.progress_tab) assert panel.tab_panel.current_tab == panel.progress_tab
async def process_callback_kb1btn1(callback_query: types.CallbackQuery): code = callback_query.data if callback_query.from_user.username != owner: pass elif code == 'vup': control.press('volumeup', 5) elif code == 'vdown': control.press('volumedown', 5) elif code == 'vmute': control.press('volumemute', 1) elif code == 'close': control.close() elif code == 'getlink': await bot.send_message(callback_query.from_user.id, control.getPageLink()) elif code == 'clip': await bot.send_message(callback_query.from_user.id, control.getClipBoard()) elif code == 'screen': await types.ChatActions.upload_photo() media = types.MediaGroup() mss.mss().shot(output="screen.png") media.attach_photo(types.InputFile("screen.png"), '') await bot.send_media_group(callback_query.from_user.id, media=media) elif code == 'status': await bot.send_message(callback_query.from_user.id, control.status(), parse_mode='markdown')
def main(args): combo('ctrl', '`') txt = 'echo "This text was written by a bot!"' write(txt) press('enter') return 0
def test_tutorial(menu, root_manager): assert menu.help_button is not None control.press(menu.help_button) assert root_manager.current == 'tutorial'
def test_purchase_button(menu, root_manager): assert menu.purchase_button is not None control.press(menu.purchase_button) assert not root_manager.has_screen('activity') assert root_manager.has_screen('purchases') assert root_manager.current == 'purchases'
def test_press_more_apps(empty_data, menu, root_manager, webbrowser): assert menu.more_apps_button is not None control.press(menu.more_apps_button) webbrowser.assert_called_once_with(settings.MORE_APPS_URL)
def test_press_feedback(empty_data, menu, root_manager, webbrowser): assert menu.feedback_button is not None control.press(menu.feedback_button) webbrowser.assert_called_once_with(settings.FACEBOOK_PAGE_URL)