diff --git a/docs/source/contrib.rst b/docs/source/contrib.rst deleted file mode 100644 index 3ff48b1..0000000 --- a/docs/source/contrib.rst +++ /dev/null @@ -1,20 +0,0 @@ -Contrib -******* - -This package provides support for the following BalderHub projects: - -BalderHub Project ``balderhub-html`` -==================================== - -Pages ------ - -.. autoclass:: balderhub.auth.contrib.html.pages.LoginPage - :members: - - -Setup Features --------------- - -.. autoclass:: balderhub.auth.contrib.html.setup_features.UserLoginFeature - :members: diff --git a/docs/source/index.rst b/docs/source/index.rst index f7aa80e..2e8b20e 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -26,4 +26,3 @@ This is a BalderHub project that provides different features and scenarios for t features.rst examples.rst utilities.rst - contrib.rst diff --git a/setup.cfg b/setup.cfg index 14d3095..c8cf139 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,10 +30,6 @@ project_urls = packages = balderhub.auth balderhub.auth.lib - balderhub.auth.contrib - balderhub.auth.contrib.html - balderhub.auth.contrib.html.pages - balderhub.auth.contrib.html.setup_features balderhub.auth.lib.scenario_features balderhub.auth.lib.scenario_features.client balderhub.auth.lib.scenario_features.client.role diff --git a/src/balderhub/auth/contrib/__init__.py b/src/balderhub/auth/contrib/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/balderhub/auth/contrib/html/__init__.py b/src/balderhub/auth/contrib/html/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/balderhub/auth/contrib/html/pages/__init__.py b/src/balderhub/auth/contrib/html/pages/__init__.py deleted file mode 100644 index 2820f14..0000000 --- a/src/balderhub/auth/contrib/html/pages/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -from .login_page import LoginPage - -__all__ = [ - 'LoginPage', -] diff --git a/src/balderhub/auth/contrib/html/pages/login_page.py b/src/balderhub/auth/contrib/html/pages/login_page.py deleted file mode 100644 index 64d3c4a..0000000 --- a/src/balderhub/auth/contrib/html/pages/login_page.py +++ /dev/null @@ -1,51 +0,0 @@ -from typing import Union, List - -import balderhub.html.lib.scenario_features - -import balderhub.html.lib.utils.components as html -from balderhub.url.lib.utils import Url - - -class LoginPage(balderhub.html.lib.scenario_features.HtmlPage): - """ - HTML Page for normal login pages as abstract base class - all abstract methods/properties needs to be defined in - subclass - """ - - @property - def url(self) -> Url: - """ - :return: non-schema url the login page is located at - """ - raise NotImplementedError - - @property - def applicable_on_url_schema(self) -> Union[Url, List[Url]]: - return self.url - - def open(self) -> None: - """ - This method opens the login page. - """ - self.driver.navigate_to(self.url) - - @property - def input_username(self) -> html.inputs.HtmlTextInput: - """ - :return: Html input field where the username needs to be filled - """ - raise NotImplementedError - - @property - def input_password(self) -> html.inputs.HtmlPasswordInput: - """ - :return: Html input field where the password needs to be filled - """ - raise NotImplementedError - - @property - def btn_login(self) -> html.HtmlButtonElement: - """ - :return: HTML button to submit the login form - """ - raise NotImplementedError diff --git a/src/balderhub/auth/contrib/html/setup_features/__init__.py b/src/balderhub/auth/contrib/html/setup_features/__init__.py deleted file mode 100644 index 87fbd52..0000000 --- a/src/balderhub/auth/contrib/html/setup_features/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -from .user_login_feature import UserLoginFeature - -__all__ = [ - "UserLoginFeature" -] diff --git a/src/balderhub/auth/contrib/html/setup_features/user_login_feature.py b/src/balderhub/auth/contrib/html/setup_features/user_login_feature.py deleted file mode 100644 index 8bdecaa..0000000 --- a/src/balderhub/auth/contrib/html/setup_features/user_login_feature.py +++ /dev/null @@ -1,25 +0,0 @@ -import balderhub.auth.lib.scenario_features.client.user_login_feature - -from balderhub.auth.contrib.html.pages.login_page import LoginPage - - -class UserLoginFeature(balderhub.auth.lib.scenario_features.client.user_login_feature.UserLoginFeature): - """ - Implementation of the user login feature for using the :class:`balderhub.contrib.html.pages.LoginPage` HTML pages - """ - - page = LoginPage() - - def insert_username(self, username: str) -> None: - self.page.input_username.wait_to_be_clickable_for(1).type_text(username, clean_before=True) - - def insert_password(self, password: str) -> None: - self.page.input_password.wait_to_be_clickable_for(1).type_text(password, clean_before=True) - - def submit_login(self) -> None: - self.page.btn_login.wait_to_be_clickable_for(1).click() - - def is_already_logged_in(self): - # TODO improve - self.page.open() - return not self.page.is_applicable()