From cac47598fb37d8ea900c48badb25513cdea856cf Mon Sep 17 00:00:00 2001 From: Jay Zoldak Date: Fri, 25 Jul 2014 09:37:14 -0400 Subject: [PATCH] Use clear and send_keys instead of action chains in page object methods --- .../acceptance/pages/studio/component_editor.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/common/test/acceptance/pages/studio/component_editor.py b/common/test/acceptance/pages/studio/component_editor.py index 0215d20c52..ca2e50e4c1 100644 --- a/common/test/acceptance/pages/studio/component_editor.py +++ b/common/test/acceptance/pages/studio/component_editor.py @@ -1,6 +1,5 @@ from bok_choy.page_object import PageObject from selenium.webdriver.common.keys import Keys -from selenium.webdriver.common.action_chains import ActionChains from utils import click_css from selenium.webdriver.support.ui import Select @@ -57,12 +56,12 @@ class ComponentEditorView(PageObject): Sets the text field with given label (display name) to the specified value, and presses Save. """ elem = self.get_setting_element(label) - # Click in the field, delete the value there. - action = ActionChains(self.browser).click(elem) - for _x in range(0, len(elem.get_attribute('value'))): - action = action.send_keys(Keys.BACKSPACE) - # Send the new text, then Tab to move to the next field (so change event is triggered). - action.send_keys(value).send_keys(Keys.TAB).perform() + + # Clear the current value, set the new one, then + # Tab to move to the next field (so change event is triggered). + elem.clear() + elem.send_keys(value) + elem.send_keys(Keys.TAB) self.save() def set_select_value_and_save(self, label, value):