Skip to content

Commit c2a1c5d

Browse files
authored
Merge pull request #40 from mayadata-io/dmaas-fix
Fix dmaas page and retention count attribute added
2 parents 73628c1 + d57d288 commit c2a1c5d

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed

main/pages/clusters/applications/DmaasPage.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
SELECT_AWS_REGION = (By.XPATH, "//div[@class='form-group w-25']//select[@class='form-control']")
1919
MINIO_URL_FIELD = (By.XPATH, "//input[@placeholder='http://minio.example.com']")
2020
MINIO_HREF = (By.XPATH, "//a[contains(text(),'Get credential for Minio')]")
21-
SELECT_INTERVAL_FIELD = (By.XPATH, "//div[@class='form-group']//select[@class='form-control']")
21+
SELECT_INTERVAL_FIELD = (By.XPATH, "//div[@class='mt-0']//select[@class='form-control']")
2222
SELECT_MINUTE_FIELD = (By.XPATH, "//span[contains(text(),'Minute(s)')]/preceding-sibling::select[1]")
2323
SELECT_HOUR_FIELD = (By.XPATH, "//span[contains(text(),'Hour')]/preceding-sibling::select[1]")
2424
SELECT_TIME_FIELD = (By.XPATH, "//input[@placeholder='Select time']")
@@ -33,14 +33,16 @@
3333
SCHEDULE_REMOVE_ICON = (By.CSS_SELECTOR, ".mi.mi-trash.mi-1x")
3434
SCHEDULE_RESTORE_ICON = (By.CSS_SELECTOR, ".mi.mi-cloud-reload.mi-1x")
3535
SCHEDULE_DELETE_BUTTON = (By.CSS_SELECTOR, ".btn.btn-danger")
36-
SEARCH_FIELD = (By.XPATH, "//input[@placeholder='Find a Schedule..']")
37-
SCHEDULE_HREF = (By.XPATH, "//span[contains(text(),'sch-')]")
36+
SEARCH_FIELD = (By.XPATH, "//input[@placeholder='Find a schedule']")
37+
SCHEDULE_HREF = (By.XPATH, "//span[contains(., 'sch-')]")
3838
LIST_OF_BACKUPS = (By.XPATH, "//table[@class='table table-sm']//tbody")
3939
BACKUP_TABLE = (By.CSS_SELECTOR, "table.table.table-sm tbody tr")
4040
BACK_BUTTON = (By.CSS_SELECTOR, ".mi.mi-arrow-left-curve.mi-1x")
4141
MODAL_TITLE = (By.XPATH, "//h5[@class='modal-title']")
4242
MODAL_YES_BUTTON = (By.XPATH, "//button[@class='btn btn-primary']")
4343
CSTOR_SLIDER = (By.XPATH, "//span[@class='slider round']")
44+
RETENTION_COUNT = (By.XPATH, "//input[@id='retention-count']")
45+
4446

4547
class DmaasPage(BasePage):
4648
new_schedule_name = ""
@@ -76,7 +78,6 @@ def click_new_schedule_button(self):
7678

7779
def click_add_cloud_credential_button(self):
7880
print("Click 'Add Cloud Credential' button")
79-
# self.wait_element_visible(MINIO_HREF)
8081
self.wait_element_present(ADD_CLOUD_CREDENTIAL).click()
8182
return DmaasPage(self.driver)
8283

@@ -105,7 +106,7 @@ def select_provider_credential(self, name):
105106
print("Select Provider credential '%s'" % name)
106107
select = self.wait_element_present(SELECT_PROVIDER_CREDENTIALS)
107108
for option in select.find_elements_by_tag_name('option'):
108-
if option.text in name:
109+
if name in option.text:
109110
option.click()
110111
break
111112
self.sleep(10)
@@ -130,7 +131,7 @@ def select_interval(self, name):
130131
print("Select Interval '%s'" % name)
131132
select = self.wait_element_present(SELECT_INTERVAL_FIELD)
132133
for option in select.find_elements_by_tag_name('option'):
133-
if option.text == name:
134+
if name in option.text:
134135
option.click()
135136
break
136137
return DmaasPage(self.driver)
@@ -139,7 +140,7 @@ def select_minutes(self, minute):
139140
print("Select Minute '%s'" % minute)
140141
select = self.wait_element_present(SELECT_MINUTE_FIELD)
141142
for option in select.find_elements_by_tag_name('option'):
142-
if option.text == minute:
143+
if minute in option.text:
143144
option.click()
144145
break
145146
return DmaasPage(self.driver)
@@ -148,7 +149,7 @@ def select_hour(self, hour):
148149
print("Select Hour '%s'" % hour)
149150
select = self.wait_element_present(SELECT_HOUR_FIELD)
150151
for option in select.find_elements_by_tag_name('option'):
151-
if option.text == hour:
152+
if hour in option.text:
152153
option.click()
153154
break
154155
return DmaasPage(self.driver)
@@ -338,3 +339,8 @@ def click_cstor_based_backup(self):
338339
print("Click 'cStor based' slider button")
339340
self.wait_element_present(CSTOR_SLIDER).click()
340341
return DmaasPage(self.driver)
342+
343+
def enter_retention_count(self, count):
344+
print("Enter '%s' into 'Backup retention count' field" % count)
345+
self.wait_element_present(RETENTION_COUNT).send_keys(count)
346+
return DmaasPage(self.driver)

tests/dmaas_test.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ def test_verify_restore_jiva_aws_dmaas_schedule(self, driver, url, region):
434434
.select_interval("Hourly") \
435435
.select_minutes("05") \
436436
.select_hour("03") \
437+
.enter_retention_count("5") \
437438
.click_schedule_now_button() \
438439
.confirm_aws_schedule() \
439440
.verify_dmass_schedule_present() \
@@ -470,6 +471,7 @@ def test_verify_restore_hostpath_aws_dmaas_schedule(self, driver, url, region):
470471
.select_interval("Hourly") \
471472
.select_minutes("05") \
472473
.select_hour("03") \
474+
.enter_retention_count("5") \
473475
.click_schedule_now_button() \
474476
.confirm_aws_schedule() \
475477
.verify_dmass_schedule_present() \
@@ -506,6 +508,7 @@ def test_verify_restore_cstor_aws_dmaas_schedule(self, driver, url, region):
506508
.select_interval("Hourly") \
507509
.select_minutes("05") \
508510
.select_hour("03") \
511+
.enter_retention_count("5") \
509512
.click_schedule_now_button() \
510513
.confirm_aws_schedule() \
511514
.verify_dmass_schedule_present() \
@@ -542,6 +545,7 @@ def test_verify_restore_device_aws_dmaas_schedule(self, driver, url, region):
542545
.select_interval("Hourly") \
543546
.select_minutes("05") \
544547
.select_hour("03") \
548+
.enter_retention_count("5") \
545549
.click_schedule_now_button() \
546550
.confirm_aws_schedule() \
547551
.verify_dmass_schedule_present() \
@@ -582,8 +586,8 @@ def test_verify_restore_jiva_minio_dmaas_schedule(self, driver, url, minio):
582586
.select_interval("Hourly") \
583587
.select_minutes("05") \
584588
.select_hour("03") \
589+
.enter_retention_count("5") \
585590
.click_schedule_now_button() \
586-
.confirm_aws_schedule() \
587591
.verify_dmass_schedule_present() \
588592
.search_dmaas_schedule() \
589593
.click_dmaas_schedule("Active") \
@@ -620,6 +624,7 @@ def test_verify_restore_jiva_mysql_dmaas_schedule(self, driver, url, region):
620624
.select_interval("Hourly") \
621625
.select_minutes("05") \
622626
.select_hour("03") \
627+
.enter_retention_count("5") \
623628
.click_schedule_now_button() \
624629
.confirm_aws_schedule() \
625630
.verify_dmass_schedule_present() \
@@ -656,8 +661,8 @@ def test_verify_restore_hostpath_minio_dmaas_schedule(self, driver, url, minio):
656661
.select_interval("Hourly") \
657662
.select_minutes("05") \
658663
.select_hour("03") \
664+
.enter_retention_count("5") \
659665
.click_schedule_now_button() \
660-
.confirm_aws_schedule() \
661666
.verify_dmass_schedule_present() \
662667
.search_dmaas_schedule() \
663668
.click_dmaas_schedule("Active") \
@@ -692,8 +697,8 @@ def test_verify_restore_cstor_minio_dmaas_schedule(self, driver, url, minio):
692697
.select_interval("Hourly") \
693698
.select_minutes("05") \
694699
.select_hour("03") \
700+
.enter_retention_count("5") \
695701
.click_schedule_now_button() \
696-
.confirm_aws_schedule() \
697702
.verify_dmass_schedule_present() \
698703
.search_dmaas_schedule() \
699704
.click_dmaas_schedule("Active") \
@@ -728,8 +733,8 @@ def test_verify_restore_device_minio_dmaas_schedule(self, driver, url, minio):
728733
.select_interval("Hourly") \
729734
.select_minutes("05") \
730735
.select_hour("03") \
736+
.enter_retention_count("5") \
731737
.click_schedule_now_button() \
732-
.confirm_aws_schedule() \
733738
.verify_dmass_schedule_present() \
734739
.search_dmaas_schedule() \
735740
.click_dmaas_schedule("Active") \
@@ -776,6 +781,7 @@ def test_verify_restore_cstor_minio_non_restic_dmaas_schedule(self, driver, url,
776781
.select_interval("Hourly") \
777782
.select_minutes("05") \
778783
.select_hour("03") \
784+
.enter_retention_count("5") \
779785
.click_schedule_now_button() \
780786
.confirm_aws_schedule() \
781787
.verify_dmass_schedule_present() \
@@ -790,4 +796,4 @@ def test_verify_restore_cstor_minio_non_restic_dmaas_schedule(self, driver, url,
790796
.find_schedule() \
791797
.enter_schedule() \
792798
.open_schedules_page() \
793-
.verify_restore_status("Success")
799+
.verify_restore_status("Success")

0 commit comments

Comments
 (0)