def test_run_second_script(browser, config_host): destroy_world_script_page = DestroyWorldScript(browser, config_host) destroy_world_script_page.execute_script() expect(is_displayed(destroy_world_script_page.button_execute), "Execute button not found") expect(is_disabled(destroy_world_script_page.button_execute), "Execute button not disabled") expect(is_displayed(destroy_world_script_page.button_stop), "Stop button not found") expect(is_enabled(destroy_world_script_page.button_stop), "Stop button not enabled") expect(is_displayed(destroy_world_script_page.log), "Log panel not displayed") expect(is_displayed(destroy_world_script_page.users_input), "Input field not displayed") expect( len(destroy_world_script_page.executor_tabs) == 2, "Executor tabs amount is not 2, but {}".format( len(destroy_world_script_page.executor_tabs))) expect(is_displayed(destroy_world_script_page.active_executor_tab), "Tab is not active") assert_expectations()
def test_add_new_tab(browser, config_host): destroy_world_script_page = DestroyWorldScript(browser, config_host) destroy_world_script_page.add_new_tab_button.click() expect(is_displayed(destroy_world_script_page.script_description), "Script description not found") expect( not is_displayed(destroy_world_script_page.script_parameters_panel), "Parameters panel is shown, current script doesn't contain any parameter" ) expect(is_displayed(destroy_world_script_page.button_execute), "Execute button not found") expect(is_enabled(destroy_world_script_page.button_execute), "Execute button not enabled") expect(is_displayed(destroy_world_script_page.button_stop), "Stop button not found") expect(is_disabled(destroy_world_script_page.button_stop), "Stop button not disabled") expect(is_displayed(destroy_world_script_page.add_new_tab_button), "Add new tab button not displayed") assert_expectations()
def test_user_input(browser, config_host): destroy_world_script_page = DestroyWorldScript(browser, config_host) destroy_world_script_page.users_input.send_keys("Y" + Keys.ENTER) time.sleep(3) expect( destroy_world_script_page.log.get_attribute( "innerHTML") == destroy_world_script_page.first_step_log_content + destroy_world_script_page.second_step_log_content) expect(is_displayed(destroy_world_script_page.button_execute), "Execute button not found") expect(is_disabled(destroy_world_script_page.button_execute), "Execute button not disabled") expect(is_displayed(destroy_world_script_page.button_stop), "Stop button not found") expect(is_enabled(destroy_world_script_page.button_stop), "Stop button not enabled") assert_expectations()
def test_app_content(browser, config_host): home_page = Page(browser, config_host) for script_link in home_page.all_script_links: script_link.click() expect(is_displayed(home_page.sidebar), "Sidebar not found") expect(is_displayed(home_page.sidebar_header), "Header on sidebar not found") expect(is_displayed(home_page.sidebar_history_button), "History button on sidebar not found") expect(is_displayed(home_page.sidebar_scripts_list), "Scripts list not found") expect(is_displayed(home_page.sidebar_search_button), "Search button not found") expect(is_displayed(home_page.sidebar_header_link), "Header link not found") expect(is_displayed(home_page.main_app_content), "App content not found") expect(is_displayed(home_page.script_header), "Script header not found") expect(is_displayed(home_page.actions_panel), "Action panel not found") expect(is_displayed(home_page.button_execute), "Execute button not found") expect(is_enabled(home_page.button_execute), "Execute button not enabled") expect(is_displayed(home_page.button_stop), "Stop button not found") expect(is_disabled(home_page.button_stop), "Stop button not disabled") expect(not is_displayed(home_page.log), "Log panel is displayed before script run") expect(not is_displayed(home_page.users_input), "Input field is displayed before script run") assert_expectations()