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_editor_page_null(self): env = SysEnvironmentPage(self.driver) self.url = '/managecenter/system/environment' env.open(self.url) env.login_action('admin', 'admin') time.sleep(3) 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_null.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')