# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Host page locators"""

from selenium.webdriver.common.by import By

from tests.ui_tests.app.helpers.locator import Locator, TemplateLocator
from tests.ui_tests.app.page.common.common_locators import (
    ObjectPageMenuLocators,
)


class HostLocators:
    """Host main page elements locators"""

    class MenuNavigation(ObjectPageMenuLocators):
        """Host main page main navigation elements locators"""

        ...


class HostActionsLocators(HostLocators):
    """Locators for Actions menu on host page"""

    action_name = Locator(By.CSS_SELECTOR, "app-action-card mat-card-title", "Action title in Actions menu")
    action_btn = TemplateLocator(
        By.XPATH,
        "//mat-card-title[text()='{}']/ancestor::mat-card-header//button",
        "Action in Actions menu",
    )
    action_run_btn = Locator(By.CSS_SELECTOR, "app-action-list>button", "Action run button")

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Host page locators"""

from selenium.webdriver.common.by import By

from tests.ui_tests.app.helpers.locator import Locator, TemplateLocator
from tests.ui_tests.app.page.common.common_locators import (
    ObjectPageMenuLocators,
)


class HostLocators:
    """Host main page elements locators"""

    class MenuNavigation(ObjectPageMenuLocators):
        """Host main page main navigation elements locators"""

        ...


class HostActionsLocators(HostLocators):
    """Locators for Actions menu on host page"""

    action_name = Locator(By.CSS_SELECTOR, "app-action-card mat-card-title", "Action title in Actions menu")
    action_btn = TemplateLocator(
        By.XPATH,
        "//mat-card-title[text()='{}']/ancestor::mat-card-header//button",
        "Action in Actions menu",
    )
    action_run_btn = Locator(By.CSS_SELECTOR, "app-action-list>button", "Action run button")

# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #      http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. Host page locators Host main page elements locators Host main page main navigation elements locators Locators for Actions menu on host page