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_newpage_appname_null(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_new_env', '', '1', '1', 'test_new_env') time.sleep(3) try: self.assertEqual(env.env_new_page_variable_error(), '此处为必填项,不能为空!') log().info('Judge success, and the result is:' + env.env_new_page_variable_error()) except Exception as e: log().exception('Failing judgment, the result is:') log().exception(e) insert_img(self.driver, 'env_newpage_appname_null.jpg')
def test_env_describe_query(self): env = SysEnvironmentPage(self.driver) self.url = '/managecenter/system/environment' env.open(self.url) env.login_action('admin', 'admin') time.sleep(3) env.input_describe_query('CRE数据库版本') time.sleep(3) try: self.assertIn('CRE数据库版本', env.test_describe_query_error()) log().info('Judge success, and the result is:' + env.test_describe_query_error()) except Exception as e: log().exception('Failing judgment, the result is:') log().exception(e) insert_img(self.driver, 'env_describe_query.jpg')
def test_env_variable_query(self): env = SysEnvironmentPage(self.driver) self.url = '/managecenter/system/environment' env.open(self.url) env.login_action('admin', 'admin') time.sleep(3) env.input_variable_name('DB_') time.sleep(3) try: self.assertEqual(env.env_new_page_save_error(), 'DB_VERSION') log().info('Judge success, and the result is:' + env.env_new_page_save_error()) except Exception as e: log().exception('Failing judgment, the result is:') log().exception(e) insert_img(self.driver, 'env_variable_query.jpg')
def test_env_appname_query(self): env = SysEnvironmentPage(self.driver) self.url = '/managecenter/system/environment' env.open(self.url) env.login_action('admin', 'admin') time.sleep(3) env.query_appname() time.sleep(5) try: self.assertEqual(env.test_appname_query_error(), 'APP') log().info('Judge success, and the result is:' + env.test_appname_query_error()) except Exception as e: log().exception('Failing judgment, the result is:') log().exception(e) insert_img(self.driver, 'env_appname_query.jpg')
def test_env_import_buttot_save(self): env = SysEnvironmentPage(self.driver) self.url = '/managecenter/system/environment' env.open(self.url) env.login_action('admin', 'admin') time.sleep(3) env.import_environment() time.sleep(3) try: self.assertEqual(env.test_import_buttot_sure_error(), '上传成功!') log().info('Judge success, and the result is' + env.test_import_buttot_sure_error()) except Exception as e: log().exception('Failing judgment, the result is') log().exception(e) insert_img(self.driver, 'env_import_buttot_save.jpg')
def test_env_export_button_all(self): env = SysEnvironmentPage(self.driver) self.url = '/managecenter/system/environment' env.open(self.url) env.login_action('admin', 'admin') time.sleep(3) env.button_export_click() time.sleep(3) try: self.assertEqual(env.test_export_button_all_error(), '导出全部?') log().info('Judge success, and the result is:' + env.test_export_button_all_error()) except Exception as e: log().exception('Failing judgment, the result is:') log().exception(e) insert_img(self.driver, 'env_export_button_all.jpg')
def test_env_newbutton_promptbox(self): env = SysEnvironmentPage(self.driver) self.url = '/managecenter/system/environment' env.open(self.url) env.login_action('admin', 'admin') time.sleep(2) env.button_new_click() time.sleep(3) try: self.assertEqual(env.env_new_page_error(), '新增环境变量') log().info('Judge success, and the result is:' + env.env_new_page_error()) except Exception as e: log().exception('Failing judgment, the result is:') log().exception(e) insert_img(self.driver, 'env_newbutton_promptbox.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_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_value() env.button_editor_click() time.sleep(3) try: self.assertEqual(env.env_new_page_editor_click_error(), '只能选择单条记录进行编辑!') log().info('Judge success, and the result is:' + env.env_new_page_editor_click_error()) except Exception as e: log().exception('Failing judgment, the result is:') log().exception(e) insert_img(self.driver, 'env_editor_page_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')