コード例 #1
0
ファイル: models.py プロジェクト: mkudlej/usmqe-tests
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")]')
コード例 #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')
コード例 #3
0
ファイル: models.py プロジェクト: mkudlej/usmqe-tests
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')
コード例 #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"]/..')
コード例 #5
0
ファイル: models.py プロジェクト: mkudlej/usmqe-tests
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')
コード例 #6
0
ファイル: models.py プロジェクト: ebondare/usmqe-tests
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")