2023-09-15 04:17:07 +00:00
|
|
|
import allure
|
|
|
|
|
|
|
|
from gui.components.base_popup import BasePopup
|
2023-10-06 08:33:42 +00:00
|
|
|
from gui.elements.button import Button
|
2024-02-13 09:04:24 +00:00
|
|
|
from gui.objects_map import names
|
2023-09-15 04:17:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
class TestnetModePopup(BasePopup):
|
|
|
|
def __init__(self):
|
|
|
|
super(TestnetModePopup, self).__init__()
|
2024-02-13 09:04:24 +00:00
|
|
|
self._cancel_button = Button(names.testnet_mode_cancelButton)
|
2024-02-27 08:30:54 +00:00
|
|
|
self._close_cross_button = Button(names.closeCrossPopupButton)
|
2024-02-13 09:04:24 +00:00
|
|
|
self._turn_on_button = Button(names.turn_on_testnet_mode_StatusButton)
|
|
|
|
self._turn_off_button = Button(names.turn_off_testnet_mode_StatusButton)
|
2023-09-15 04:17:07 +00:00
|
|
|
|
2023-09-27 12:26:10 +00:00
|
|
|
@allure.step('Close testnet mode modal with cross button')
|
2023-12-08 09:19:17 +00:00
|
|
|
def close_testnet_modal_with_cross_button(self, attempts: int = 2):
|
|
|
|
try:
|
|
|
|
self._close_cross_button.click()
|
|
|
|
except Exception as ec:
|
|
|
|
if attempts:
|
|
|
|
self.close_testnet_modal_with_cross_button(attempts - 1)
|
|
|
|
else:
|
|
|
|
raise ec
|
2023-09-27 12:26:10 +00:00
|
|
|
|
2023-12-05 13:23:02 +00:00
|
|
|
@allure.step('Confirm turning on in the testnet modal')
|
|
|
|
def turn_on_testnet_mode_in_testnet_modal(self):
|
2023-09-15 04:17:07 +00:00
|
|
|
self._turn_on_button.click()
|
|
|
|
self.wait_until_hidden()
|
|
|
|
|
2023-12-05 13:23:02 +00:00
|
|
|
@allure.step('Confirm turning off in the testnet modal')
|
2023-09-27 12:26:10 +00:00
|
|
|
def turn_off_testnet_mode_in_testnet_modal(self):
|
2023-09-15 04:17:07 +00:00
|
|
|
self._turn_off_button.click()
|
|
|
|
self.wait_until_hidden()
|
|
|
|
|
2023-12-05 13:23:02 +00:00
|
|
|
@allure.step('Cancel switching testnet mode in the testnet modal')
|
2023-09-27 12:26:10 +00:00
|
|
|
def click_cancel_button_in_testnet_modal(self):
|
2023-09-15 04:17:07 +00:00
|
|
|
self._cancel_button.click()
|
|
|
|
self.wait_until_hidden()
|