Skip to content

Commit 9b12075

Browse files
authored
Merge pull request #482 from arangodb/feature/fix_312_compatibility
Feature/fix 312 compatibility
2 parents 9309622 + 4d2471c commit 9b12075

File tree

2 files changed

+76
-20
lines changed

2 files changed

+76
-20
lines changed

release_tester/selenium_ui_test/pages/collection_page.py

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def __init__(self, webdriver, cfg):
106106

107107
self.select_schema_tab_id = "//*[@id='subNavigationBarPage']/ul[2]/li[5]/a"
108108

109-
self.select_settings_tab_id = "//*[@id='subNavigationBarPage']/ul[2]/li[4]/a"
109+
110110
self.select_settings_name_textbox_id = '//*[@id="change-collection-name"]'
111111
self.select_settings_wait_type_id = "change-collection-sync"
112112
self.select_newer_settings_save_btn_id = "modalButton4"
@@ -138,7 +138,6 @@ def __init__(self, webdriver, cfg):
138138
self.select_row4_id = "//div[@id='docPureTable']/div[2]/div[5]"
139139
self.document_id = "document-id"
140140
self.select_filter_reset_btn_id = "/html//button[@id='resetView']"
141-
self.select_settings_tab_id = "//*[@id='subNavigationBar']/ul[2]/li[4]/a"
142141
self.select_renamed_doc_collection_id = '//*[@id="collection_testDocRenamed"]/div/h5'
143142
self.select_computedValueCol_id = '//*[@id="collection_ComputedValueCol"]/div/h5'
144143

@@ -1269,6 +1268,8 @@ def select_schema_tab(self):
12691268
def select_settings_tab(self, is_cluster, check=False):
12701269
"""Selecting settings tab from the collection submenu"""
12711270
self.click_submenu_entry("Settings")
1271+
time.sleep(10)
1272+
self.wait_for_ajax()
12721273
if check:
12731274
if not is_cluster:
12741275
select_settings_name_textbox_sitem = self.locator_finder_by_xpath(self.select_settings_name_textbox_id)
@@ -1369,10 +1370,38 @@ def test_computed_values(self):
13691370
warning = 'button-warning'
13701371
self.ace_set_value(warning, compute_query, True)
13711372

1372-
# print('go back to collection tab')
1373-
self.navbar_goto("collections")
1374-
self.select_computedValueCol()
1375-
1373+
print('go back to collection tab')
1374+
# Define the maximum number of retries
1375+
max_retries = 3
1376+
retry_count = 0
1377+
1378+
while retry_count < max_retries:
1379+
try:
1380+
self.webdriver.refresh()
1381+
self.wait_for_ajax()
1382+
# Navigate to collections page
1383+
self.navbar_goto("collections")
1384+
self.wait_for_ajax()
1385+
1386+
# Attempt to select computed value column
1387+
self.select_computedValueCol()
1388+
1389+
# If successful, break out of the loop
1390+
break
1391+
except Exception as e:
1392+
# If an error occurs, print the error message
1393+
print(f"Error occurred while selecting computed value column: {e}")
1394+
1395+
# Increment retry count
1396+
retry_count += 1
1397+
1398+
# If maximum retries reached, raise an error
1399+
if retry_count == max_retries:
1400+
raise RuntimeError("Failed to select computed value column after multiple retries")
1401+
1402+
# Wait for a few seconds before retrying
1403+
time.sleep(3)
1404+
13761405
self.navigate_to_col_content_tab()
13771406

13781407
# print('Select add new document to collection button')

release_tester/selenium_ui_test/pages/support_page.py

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,42 @@ def click_on_link(self, link_id):
4343

4444
def loop_through_link_traversal(self, print_statement, link_list, assertion_list):
4545
"""this method will be loop through all the list links"""
46+
import time
47+
48+
# Define the maximum number of retries
49+
max_retries = 3
50+
4651
i = 0
4752
while i < len(link_list):
4853
print(print_statement[i])
49-
title = self.click_on_link(link_list[i])
50-
try:
51-
assert title == assertion_list[i], f"Expected page title {assertion_list[i]} but got {title}"
52-
except AssertionError:
53-
print(f"Assertion Error occurred! for {assertion_list[i]}\n")
54-
i = i + 1
54+
title = None
55+
try_count = 0
56+
57+
# Attempt the operation up to max_retries times
58+
while try_count < max_retries:
59+
try:
60+
title = self.click_on_link(link_list[i])
61+
self.wait_for_ajax()
62+
assert title == assertion_list[i], f"Expected page title {assertion_list[i]} but got {title}"
63+
break # If successful, break out of the retry loop
64+
except Exception as e:
65+
# If an error occurs, print the error message
66+
print(f"Error occurred: {e}")
67+
68+
# Increment retry count
69+
try_count += 1
70+
71+
# If maximum retries reached, raise an error
72+
if try_count == max_retries:
73+
print(f"Failed after {max_retries} attempts for link: {link_list[i]}")
74+
break # Break out of the retry loop
75+
76+
# Wait for a few seconds before retrying
77+
time.sleep(3)
78+
79+
# Move to the next link
80+
i += 1
81+
5582

5683
def click_on_btn(self, link_id):
5784
"""this method will execute multiple backup restore tab documentation"""
@@ -204,20 +231,20 @@ def driver_and_integration_link(self):
204231
# link name for all the Drivers and Integration link
205232
arangodb_java_driver = '//*[@id="documentation"]/div/div[5]/ul/li[1]/a'
206233
arangojs_java_script = '//*[@id="documentation"]/div/div[5]/ul/li[2]/a'
207-
arangodb_php = '//*[@id="documentation"]/div/div[5]/ul/li[3]/a'
208-
arangodb_go_driver = '//*[@id="documentation"]/div/div[5]/ul/li[4]/a'
209-
arangodb_spring_data = '//*[@id="documentation"]/div/div[5]/ul/li[5]/a'
210-
arangodb_spark_connector = '//*[@id="documentation"]/div/div[5]/ul/li[6]/a'
234+
arangodb_go_driver = '//*[@id="documentation"]/div/div[5]/ul/li[3]/a'
235+
arangodb_spring_data = '//*[@id="documentation"]/div/div[5]/ul/li[4]/a'
236+
arangodb_spark_connector = '//*[@id="documentation"]/div/div[5]/ul/li[5]/a'
237+
drivers_and_integration = '//*[@id="documentation"]/div/div[5]/ul/li[6]/a'
211238

212239
Official_print_statement = ['Checking ArangoDB Java Driver link \n',
213240
'Checking ArangoJS - Javascript Driver link \n',
214-
'Checking ArangoDB-PHP link \n',
215-
'Checking ArangoDB Go Driver link \n',
241+
'Checking ArangoDB Go driver link \n',
216242
'Checking Go to ArangoDB Spring Data page link \n',
217-
'Checking Go to ArangoDB Spark Connections page link\n']
243+
'Checking Go to ArangoDB Spark Connections page link \n',
244+
'Checking Go to Drivers and Integration start page link\n']
218245

219246
drivers_and_integration = [arangodb_java_driver, arangojs_java_script, arangodb_php, arangodb_go_driver,
220-
arangodb_spring_data, arangodb_spark_connector]
247+
arangodb_spring_data, drivers_and_integration]
221248

222249
driver_integration_assertion_check = ['ArangoDB Java driver | ArangoDB Documentation',
223250
'ArangoDB Node.js driver | ArangoDB Documentation',

0 commit comments

Comments
 (0)