def test_env_delete_button_sure(self): env = SysEnvironmentPage(self.driver) self.url = '/managecenter/system/environment' env.open(self.url) env.login_action('admin', 'admin') time.sleep(3) env.new_environment('test_delete_successful', 'test_delete_successful', '1', '1', 'test_delete_successful') time.sleep(3) env.input_variable_name('test_delete_successful') time.sleep(3) env.checkbox_one() time.sleep(3) env.butto_delect_click() time.sleep(3) env.delete_sure_button() time.sleep(3) env.input_variable_name('env_delete_button_sure') try: self.assertEqual(env.show_no_content_error(), '暂无内容') log().info('Judge success, and the result is:' + env.show_no_content_error()) except Exception as e: log().exception('Failing judgment, the result is:') log().exception(e) insert_img(self.driver, 'test_delete_button_sure.jpg')
def test_env_editor_page_save(self): env = SysEnvironmentPage(self.driver) self.url = '/managecenter/system/environment' env.open(self.url) env.login_action('admin', 'admin') time.sleep(3) env.new_environment('test_editor_successful', 'test_editor_successful', '1', '1', 'test_editor_successful') time.sleep(3) env.input_variable_name('test_editor_successful') time.sleep(3) env.checkbox_one() time.sleep(3) env.button_editor_click() time.sleep(3) env.editor_environment('change_test_editor_successful', '2', '2', 'change_test_editor_successful') time.sleep(3) try: self.assertEqual(env.test_newpage_editor_save_error(), 'change_test_editor_successful') log().info('Judge success, and the result is:' + env.test_newpage_editor_save_error()) except Exception as e: log().exception('Failing judgment, the result is:') log().exception(e) insert_img(self.driver, 'env_editor_page_save.jpg')
def test_env_export_button_one(self): env = SysEnvironmentPage(self.driver) self.url = '/managecenter/system/environment' env.open(self.url) env.login_action('admin', 'admin') time.sleep(3) env.checkbox_one() time.sleep(3) env.button_export_click() time.sleep(5) insert_img(self.driver, 'env_export_button_one.jpg')
def test_env_delete_button_more(self): env = SysEnvironmentPage(self.driver) self.url = '/managecenter/system/environment' env.open(self.url) env.login_action('admin', 'admin') time.sleep(3) env.checkbox_one() time.sleep(3) env.butto_delect_click() time.sleep(3) try: self.assertEqual(env.test_delete_button_more_error(), '确定要删除吗?') log().info('Judge success, and the result is:' + env.test_delete_button_more_error()) except Exception as e: log().exception('Failing judgment, the result is:') log().exception(e) insert_img(self.driver, 'env_delete_button_more.jpg')
def test_env_editor_page_one(self): env = SysEnvironmentPage(self.driver) self.url = '/managecenter/system/environment' env.open(self.url) env.login_action('admin', 'admin') time.sleep(3) env.checkbox_one() time.sleep(3) env.button_editor_click() time.sleep(3) text = str(env.env_editor_page_successful_error()) log().info(text) errot_text = text[0:6] log().info(errot_text) try: self.assertEqual(errot_text, '编辑环境变量') log().info('Judge success, and the result is:' + errot_text) except Exception as e: log().exception('Failing judgment, the result is:') log().exception(e) insert_img(self.driver, 'env_editor_page_one.jpg')