Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt hawk_test code to support testing for 12-SP2 #218

Merged
merged 2 commits into from
Aug 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions e2e_test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ RUN zypper -n install -y --no-recommends \
xorg-x11-server-Xvfb && \
zypper -n clean -a

RUN zypper -n install -y --no-recommends wget tar gzip
RUN zypper -n clean -a
RUN wget https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz
RUN tar xvf geckodriver-v0.26.0-linux64.tar.gz
RUN mv geckodriver /usr/local/bin
RUN zypper -n install -y --no-recommends \
gzip \
tar \
wget && \
zypper -n clean -a && \
wget -O- https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz | tar xf - -C /usr/local/bin/

RUN chmod +x /usr/local/bin/*

RUN useradd -l -m -d /test test
Expand Down
34 changes: 25 additions & 9 deletions e2e_test/hawk_test_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def find_element(self, bywhat, texto, tout=60):
return elem

def verify_success(self):
elem = self.find_element(By.CLASS_NAME, 'alert-success', 60)
elem = self.find_element(By.CLASS_NAME, 'alert-success', 60 * self.timeout_scale)
if not elem:
elem = self.find_element(By.PARTIAL_LINK_TEXT, 'Rename', 5)
if not elem:
Expand Down Expand Up @@ -323,11 +323,12 @@ def test_remove_cluster(self, cluster_name):
print("TEST: test_remove_cluster")
self.click_on('Dashboard')
self.check_and_click_by_xpath("Click on Dashboard", [Xpath.HREF_DASHBOARD])
elem = self.find_element(By.PARTIAL_LINK_TEXT, cluster_name)
if not elem:
print("ERROR: Couldn't find cluster [%s]. Cannot remove" % cluster_name)
return False
elem.click()
if Version(self.test_version) >= Version('12-SP3'):
elem = self.find_element(By.PARTIAL_LINK_TEXT, cluster_name)
if not elem:
print("ERROR: Couldn't find cluster [%s]. Cannot remove" % cluster_name)
return False
elem.click()
time.sleep(2 * self.timeout_scale)
elem = self.find_element(By.CLASS_NAME, 'close')
if not elem:
Expand All @@ -352,6 +353,13 @@ def test_remove_cluster(self, cluster_name):
if self.verify_success():
print("INFO: Successfully removed cluster: [%s]" % cluster_name)
return True
# HAWK2 version in 12-SP2 doesn't provide AJAX feedback for removal of cluster
if Version(self.test_version) < Version('12-SP3'):
self.click_on('Dashboard')
elem = self.find_element(By.PARTIAL_LINK_TEXT, cluster_name)
if not elem:
print("INFO: Successfully removed cluster: [%s]" % cluster_name)
return True
print("ERROR: Could not remove cluster [%s]" % cluster_name)
return False

Expand Down Expand Up @@ -533,9 +541,17 @@ def test_click_around_edit_conf(self):
print("TEST: test_click_around_edit_conf")
print("TEST: Will click on Constraints, Nodes, Tags, Alerts and Fencing")
self.check_edit_conf()
self.check_and_click_by_xpath("while checking around edit configuration",
[Xpath.HREF_CONSTRAINTS, Xpath.HREF_NODES, Xpath.HREF_TAGS,
Xpath.HREF_ALERTS, Xpath.HREF_FENCING])

click_list = [
Xpath.HREF_CONSTRAINTS, Xpath.HREF_NODES, Xpath.HREF_TAGS,
Xpath.HREF_ALERTS, Xpath.HREF_FENCING
]

# HAWK version below 12-SP3 does not provide link to fencing
MalloZup marked this conversation as resolved.
Show resolved Hide resolved
if Version(self.test_version) < Version("12-SP3"):
click_list.remove(Xpath.HREF_FENCING)

self.check_and_click_by_xpath("while checking around edit configuration", click_list)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while checking around is a bit to much familiar but I guess is ok, 😁

return self.test_status

def test_add_virtual_ip(self, virtual_ip):
Expand Down