Beispiel #1
0
 def __init__(self, driver, base_url):
     super().__init__(driver, base_url, "/host")
     self.header = PageHeader(self.driver, self.base_url)
     self.footer = PageFooter(self.driver, self.base_url)
     self.table = CommonTableObj(self.driver, self.base_url,
                                 HostListLocators.HostTable)
     self.host_popup = HostCreatePopupObj(self.driver, self.base_url)
Beispiel #2
0
 def __init__(self, driver, base_url, bundle_id: int):
     super().__init__(driver, base_url, "/bundle/{bundle_id}/main", bundle_id=bundle_id)
     self.header = PageHeader(self.driver, self.base_url)
     self.footer = PageFooter(self.driver, self.base_url)
     self.config = CommonConfigMenuObj(self.driver, self.base_url)
     self.bundle_id = bundle_id
     self.toolbar = CommonToolbar(self.driver, self.base_url)
Beispiel #3
0
 def __init__(self, driver, base_url):
     if self.MENU_SUFFIX is None:
         raise AttributeError('You should explicitly set MENU_SUFFIX in class definition')
     super().__init__(driver, base_url, "/admin/" + self.MENU_SUFFIX)
     self.header = PageHeader(self.driver, self.base_url)
     self.footer = PageFooter(self.driver, self.base_url)
     self.config = CommonConfigMenuObj(self.driver, self.base_url)
     self.table = CommonTableObj(self.driver, self.base_url)
     self.toolbar = CommonToolbar(self.driver, self.base_url)
Beispiel #4
0
 def __init__(self, driver, base_url, provider_id: int):
     if self.MENU_SUFFIX is None:
         raise AttributeError('You should explicitly set MENU_SUFFIX in class definition')
     super().__init__(driver, base_url, "/provider/{provider_id}/" + self.MENU_SUFFIX, provider_id=provider_id)
     self.header = PageHeader(self.driver, self.base_url)
     self.footer = PageFooter(self.driver, self.base_url)
     self.config = CommonConfigMenuObj(self.driver, self.base_url)
     self.provider_id = provider_id
     self.toolbar = CommonToolbar(self.driver, self.base_url)
     self.table = CommonTableObj(self.driver, self.base_url)
     self.group_config = GroupConfigList(self.driver, self.base_url)
 def test_check_footer_for_authorised_user(self, app_fs):
     """Test footer for authorised user"""
     params = {"docs": "docs.arenadata.io/adcm/notes"}
     footer = PageFooter(app_fs.driver, app_fs.adcm.url)
     footer.check_all_elements()
     with wait_for_new_window(app_fs.driver):
         footer.click_version_link_in_footer()
     with allure.step(f"Check new opened page: {params['docs']}"):
         BasePageObject(app_fs.driver,
                        app_fs.adcm.url).wait_url_contains_path(
                            params["docs"])
Beispiel #6
0
 def __init__(self,
              driver,
              base_url,
              host_id: int,
              cluster_id: Optional[int] = None):
     if self.MENU_SUFFIX is None:
         raise AttributeError(
             'You should explicitly set MENU_SUFFIX in class definition')
     super().__init__(
         driver,
         base_url,
         "/cluster/{cluster_id}/host/{host_id}/" +
         self.MENU_SUFFIX if cluster_id else "/host/{host_id}/" +
         self.MENU_SUFFIX,
         cluster_id=cluster_id,
         host_id=host_id,
     )
     self.header = PageHeader(self.driver, self.base_url)
     self.footer = PageFooter(self.driver, self.base_url)
     self.config = CommonConfigMenuObj(self.driver, self.base_url)
     self.host_id = host_id
     self.toolbar = CommonToolbar(self.driver, self.base_url)
Beispiel #7
0
 def __init__(self, driver, base_url, cluster_id: int, service_id: int,
              component_id: int):
     if self.MENU_SUFFIX is None:
         raise AttributeError(
             'You should explicitly set MENU_SUFFIX in class definition')
     super().__init__(
         driver,
         base_url,
         "/cluster/{cluster_id}/service/{service_id}/component/{component_id}/"
         + self.MENU_SUFFIX,
         cluster_id=cluster_id,
         service_id=service_id,
         component_id=component_id,
     )
     self.cluster_id = cluster_id
     self.service_id = service_id
     self.component_id = component_id
     self.header = PageHeader(self.driver, self.base_url)
     self.footer = PageFooter(self.driver, self.base_url)
     self.config = CommonConfigMenuObj(self.driver, self.base_url)
     self.toolbar = CommonToolbar(self.driver, self.base_url)
     self.table = CommonTableObj(self.driver, self.base_url)
     self.group_config = GroupConfigList(self.driver, self.base_url)
Beispiel #8
0
 def __init__(self, driver, base_url):
     super().__init__(driver, base_url, "/provider")
     self.header = PageHeader(self.driver, self.base_url)
     self.footer = PageFooter(self.driver, self.base_url)
Beispiel #9
0
 def __init__(self, driver, base_url):
     super().__init__(driver, base_url, "/task")
     self.header = PageHeader(self.driver, self.base_url)
     self.footer = PageFooter(self.driver, self.base_url)
     self.table = CommonTableObj(self.driver, self.base_url,
                                 TaskListLocators.Table)
Beispiel #10
0
 def __init__(self, driver, base_url, job_id: int):
     super().__init__(driver, base_url, "/job/{job_id}", job_id=job_id)
     self.header = PageHeader(self.driver, self.base_url)
     self.footer = PageFooter(self.driver, self.base_url)
     self.job_id = job_id
     self.toolbar = CommonToolbar(self.driver, self.base_url)
Beispiel #11
0
 def __init__(self, driver, base_url):
     super().__init__(driver, base_url, "/cluster")
     self.header = PageHeader(self.driver, self.base_url)
     self.footer = PageFooter(self.driver, self.base_url)
     self.table = CommonTableObj(self.driver, self.base_url,
                                 ClusterListLocators.ClusterTable)
Beispiel #12
0
class LoginPage(BasePageObject):
    """Login Page class"""
    def __init__(self, driver, base_url):
        super().__init__(driver, base_url, "/login")
        self.header = PageHeader(self.driver, self.base_url)
        self.footer = PageFooter(self.driver, self.base_url)

    @allure.step('Check elements on login page')
    def check_all_elements(self):
        """Check elements on login page"""
        self.header.check_unauth_page_elements()
        self.assert_displayed_elements([
            LoginPageLocators.login_form_block,
            LoginPageLocators.login_input,
            LoginPageLocators.password_input,
            LoginPageLocators.login_btn,
        ])
        self.footer.check_all_elements()

    @allure.step('Get warning text on login page')
    def get_login_warning_text(self, timeout: int = None) -> str:
        """Get warning text on login page"""
        def _get_text():
            assert self.find_element(
                LoginPageLocators.login_warning).text != ""

        wait_until_step_succeeds(_get_text,
                                 period=1,
                                 timeout=timeout or self.default_loc_timeout)
        return self.find_element(LoginPageLocators.login_warning).text

    @allure.step('Check warning text on login page')
    def check_error_message(self, message):
        """Check warning text on login page"""
        self.wait_element_visible(LoginPageLocators.login_warning)
        current_error = self.get_login_warning_text()
        with allure.step(f"Check message '{message}'"):
            assert current_error == message, f"There should be error '{message}' and not '{current_error}'"

    @allure.step('Check login button unavailable')
    def check_check_login_button_unavailable(self):
        """Check login button unavailable"""
        assert self.find_element(
            LoginPageLocators.login_btn).get_attribute("disabled") == "true"

    @allure.step('Fill login form with {username}: {password}')
    def fill_login_user_form(self, username, password):
        """Fill login form"""
        self.wait_element_visible(LoginPageLocators.login_form_block)
        self.clear_by_keys(LoginPageLocators.login_input)
        self.send_text_to_element(element=LoginPageLocators.login_input,
                                  text=username)
        self.clear_by_keys(LoginPageLocators.password_input)
        self.send_text_to_element(element=LoginPageLocators.password_input,
                                  text=password)

    @allure.step('Login with {username}: {password}')
    def login_user(self, username, password):
        """Do login"""
        self.fill_login_user_form(username, password)
        self.find_and_click(locator=LoginPageLocators.login_btn)