Skip to content

Commit

Permalink
small fixes in UI tests
Browse files Browse the repository at this point in the history
Change-Id: I0c0dd03dbbf6c11def698b685d77b318aa2eb4ec
Reviewed-on: http://review.couchbase.org/69831
Reviewed-by: Andrei Baranouski <andrei.baranouski@gmail.com>
Tested-by: Andrei Baranouski <andrei.baranouski@gmail.com>
  • Loading branch information
andreibaranouski committed Nov 14, 2016
1 parent e1f84b5 commit 83a5050
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pytests/ui/uiqueryworkbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_create_indexes(self):
summary_result = self.input.param('summary_result', '')
summary_result = summary_result.replace('_STAR_', '*').replace('_SEM_', ';').decode('unicode_escape')
result_mode = self.input.param('mode', 'JSON')
if self.rest.get_nodes()[0].version >= '4.7' and result_mode in ['Plan Text', 'Plan']:
if self.rest.get_nodes()[0].version <= '4.7' and result_mode in ['Plan Text', 'Plan']:
self.log.info("skipp 'Plan Text', 'Plan' modes in version < 4.7")
return
init_query = self.input.param('init_query', '').replace('_STAR_', '*').replace('_SEM_', ';').decode(
Expand Down
13 changes: 9 additions & 4 deletions pytests/ui/uixdcrtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,14 @@ def create_replication(self, remote_cluster, bucket, remote_bucket, cancel=False
if 'logging' in advanced_settings:
self.controls.advanced_settings().logging.select(value=advanced_settings['logging'])
time.sleep(3)
if len([el for el in self.controls.errors_advanced_settings() if el.is_displayed() and el.get_text() != '']) > 0:
raise Exception('Advanced setting error: %s' % str([el.get_text() for el in self.controls.errors_advanced_settings()
if el.is_displayed() and el.get_text() != '']))
try:
errors = [el.get_text() for el in self.controls.errors_advanced_settings() if el.is_displayed() and el.get_text() != '']
except Exception as e:
self.tc.log.info("exception when tried to get errors", e)
errors = [el.get_text() for el in self.controls.errors_advanced_settings() if
el.is_displayed() and el.get_text() != '']
if len(errors):
raise Exception('Advanced setting error: %s' % str(errors))
if not cancel:
self.controls.create_replication_pop_up().replicate_btn.click()
else:
Expand All @@ -306,7 +311,7 @@ def create_replication(self, remote_cluster, bucket, remote_bucket, cancel=False
if error.is_displayed():
raise Exception('Replication is not created: %s' % error.get_text())
except StaleElementReferenceException as e:
self.tc.log.info ("No error displayed while creating/cancelling a Replication")
self.tc.log.info("No error displayed while creating/cancelling a Replication")

self.wait.until(lambda fn: self._cluster_replication_pop_up_reaction(),
"there is no reaction in %d sec" % self.wait._timeout)
Expand Down

0 comments on commit 83a5050

Please sign in to comment.