mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed feature tests.
This commit is contained in:
parent
a4c12555cb
commit
f6d8f9f5c5
@ -468,21 +468,27 @@ class QueryToolJourneyTest(BaseFeatureTest):
|
||||
new_value = cell_value + 1
|
||||
# Try to update value
|
||||
ActionChains(self.driver).double_click(cell_el).perform()
|
||||
time.sleep(0.1)
|
||||
ActionChains(self.driver).send_keys(new_value).perform()
|
||||
time.sleep(0.1)
|
||||
ActionChains(self.driver).send_keys(Keys.TAB).perform()
|
||||
time.sleep(0.3)
|
||||
# Check if the value was updated
|
||||
# Finding element again to avoid stale element
|
||||
# reference exception
|
||||
cell_el = self.page. \
|
||||
find_by_xpath(QueryToolLocators.
|
||||
output_cell_xpath.format(2, cell_index))
|
||||
return int(cell_el.text) == new_value
|
||||
cell_el = self.page.find_by_xpath(
|
||||
QueryToolLocators.output_cell_xpath.format(2, cell_index))
|
||||
if cell_el.get_attribute('aria-selected') and \
|
||||
cell_el.text == '':
|
||||
ActionChains(self.driver).send_keys(new_value).perform()
|
||||
ActionChains(self.driver).send_keys(Keys.ENTER).perform()
|
||||
# Check if the value was updated
|
||||
# Finding element again to avoid stale element
|
||||
# reference exception
|
||||
cell_el = self.page. \
|
||||
find_by_xpath(QueryToolLocators.
|
||||
output_cell_xpath.format(2, cell_index))
|
||||
return int(cell_el.text) == new_value
|
||||
else:
|
||||
print('Double click not succeeded in try- ' + str(
|
||||
retry), file=sys.stderr)
|
||||
retry -= 1
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
print('Exception while reading cell value', file=sys.stderr)
|
||||
print('Exception while reading cell value in try ' +
|
||||
str(retry), file=sys.stderr)
|
||||
retry -= 1
|
||||
if retry == 0:
|
||||
raise Exception(e)
|
||||
|
@ -220,7 +220,7 @@ CREATE TABLE public.nonintpkey
|
||||
"""
|
||||
cell_type = data[2]
|
||||
value = data[0]
|
||||
retry = 3
|
||||
retry = 4
|
||||
while retry > 0:
|
||||
self.wait.until(EC.visibility_of_element_located(
|
||||
(By.XPATH, xpath)), CheckForViewDataTest.TIMEOUT_STRING
|
||||
@ -252,12 +252,17 @@ CREATE TABLE public.nonintpkey
|
||||
def _update_numeric_cell(self, cell_el_xpath, value):
|
||||
try:
|
||||
cell_el = self.page.find_by_xpath(cell_el_xpath)
|
||||
if value == 'clear':
|
||||
cell_el.find_element(By.CSS_SELECTOR, 'input').clear()
|
||||
if cell_el.get_attribute('aria-selected') and \
|
||||
cell_el.text == '':
|
||||
if value == 'clear':
|
||||
cell_el.find_element(By.CSS_SELECTOR, 'input').clear()
|
||||
else:
|
||||
ActionChains(self.driver).send_keys(value).perform()
|
||||
ActionChains(self.driver).send_keys(Keys.TAB).perform()
|
||||
return True
|
||||
else:
|
||||
ActionChains(self.driver).send_keys(value).perform()
|
||||
ActionChains(self.driver).send_keys(Keys.TAB).perform()
|
||||
return True
|
||||
print('Cell is NOT selected yet.', file=sys.stderr)
|
||||
return False
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
print('Exception occurred while updating int cell',
|
||||
@ -326,7 +331,6 @@ CREATE TABLE public.nonintpkey
|
||||
checkbox_el.click()
|
||||
# Sets false
|
||||
ActionChains(self.driver).click(checkbox_el).perform()
|
||||
ActionChains(self.driver).send_keys(Keys.TAB).perform()
|
||||
return True
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
@ -387,7 +391,7 @@ CREATE TABLE public.nonintpkey
|
||||
items.sort(reverse=False)
|
||||
for idx in items:
|
||||
# rowindex starts with 2 and 1st colindex is rownum
|
||||
time.sleep(0.5)
|
||||
time.sleep(0.2)
|
||||
cell_xpath = CheckForViewDataTest\
|
||||
._get_cell_xpath(str(idx + 1), row + 1)
|
||||
self._update_cell(cell_xpath, data[str(idx)])
|
||||
|
Loading…
Reference in New Issue
Block a user