Ejemplo n.º 1
0
class ListMenuModel(WebstrModel):
    """
    auxiliary model for list menu (filter and order fields)
    """
    filter_by = form.Select(
        By.XPATH,
        '//select[contains(translate(@ng-model, "F", "f"), "filterBy")]')
    filter_input = form.TextInput(By.ID, 'filter')
    order_by = form.TextInput(By.XPATH,
                              '//select[contains(@ng-model, "orderBy")]')
    order_btn = form.Button(By.XPATH, '//button[contains(@ng-init, "Order")]')
Ejemplo n.º 2
0
class TasksMenuModel(FilterListMenuModel):
    """
    Tasks page top menu
    """
    header = PageElement(by=By.XPATH, locator="//h1[contains(text(),'Tasks')]")
    from_input = form.TextInput(
        By.XPATH,
        '//div[@ng-model="taskCntrl.date.fromDate"]/input')
    to_input = form.TextInput(
        By.XPATH,
        '//div[@ng-model="taskCntrl.date.toDate"]/input')
Ejemplo n.º 3
0
class TasksMenuModel(WebstrModel):
    """
    Tasks page top menu
    """
    header = PageElement(by=By.XPATH, locator="//h1[contains(text(),'Tasks')]")
    filter_by = form.Select(By.XPATH,
                            '//select[contains(@ng-model, "filterBy")]')
    filter_input = form.TextInput(By.ID, 'filter')
    from_input = form.TextInput(
        By.XPATH, '//div[@ng-model="taskCntrl.date.fromDate"]/input')
    to_input = form.TextInput(
        By.XPATH, '//div[@ng-model="taskCntrl.date.toDate"]/input')
Ejemplo n.º 4
0
class LoginPageModel(WebstrModel):
    """
    Common page model for the login page.
    """
    username = form.TextInput(by=By.ID, locator='username')
    password = form.PasswordInput(by=By.ID, locator='password')
    login_btn = form.Button(by=By.XPATH,
                            locator='//*[contains(@class,"btn-lg")]')
    error_label = PageElement(by=By.XPATH,
                              locator='//*[@ng-bind="loginCntrl.errorMsg"]/..')
Ejemplo n.º 5
0
class ExportDialogModel(OkCancelDlgModel):
    """
    model for 'Export to CSV' dialog
    """
    ok_btn = form.Button(By.XPATH,
                         '//export-data-modal//a[@ng-click="ctrl.export();"]')
    cancel_btn = form.Button(
        By.XPATH, '//export-data-modal//a[@ng-click="ctrl.dismiss();"]')
    mode = form.Select(By.XPATH, '//export-data-modal//select')
    time_format = form.TextInput(By.XPATH, '//export-data-modal//input')
Ejemplo n.º 6
0
class FilterListMenuModel(BaseListMenuModel):
    """
    auxiliary model for list menu (filter and order fields)

    NOTE: Click on filter_by and order_by opens a menu with some links
          such links has will be instanced from Page object
          a _link_text parameter will be used
          e.g. name = PageElement(by=By.LINK_TEXT, locator="Name")
    """
    filter_by = form.Button(
        By.XPATH,
        '//button[contains(translate(@uib-tooltip, "F", "f"), "filter by")]')
    filter_by_value = DynamicPageElement(by=By.LINK_TEXT, locator="%s")
    # TODO In some cases the following is Button
    #      in other case it's real TextInput
    #      if not be aware with value property usage
    filter_input = form.TextInput(By.XPATH,
                                  '//div[contains(@ng-if, "filterType")]')
    filter_input_value = filter_by_value
    order_by = form.Button(By.XPATH, '(//*[@id="hostSort"]//button)[1]')

    # note the element is present only if some filter is active
    clear_all_filters = PageElement(by=By.LINK_TEXT,
                                    locator="Clear All Filters")